summaryrefslogtreecommitdiff
path: root/chromium/components/blocked_content
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-29 10:46:47 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-11-02 12:02:10 +0000
commit99677208ff3b216fdfec551fbe548da5520cd6fb (patch)
tree476a4865c10320249360e859d8fdd3e01833b03a /chromium/components/blocked_content
parentc30a6232df03e1efbd9f3b226777b07e087a1122 (diff)
downloadqtwebengine-chromium-99677208ff3b216fdfec551fbe548da5520cd6fb.tar.gz
BASELINE: Update Chromium to 86.0.4240.124
Change-Id: Ide0ff151e94cd665ae6521a446995d34a9d1d644 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/blocked_content')
-rw-r--r--chromium/components/blocked_content/android/BUILD.gn2
-rw-r--r--chromium/components/blocked_content/android/popup_blocked_infobar_delegate_unittest.cc8
-rw-r--r--chromium/components/blocked_content/popup_blocker_tab_helper.cc20
-rw-r--r--chromium/components/blocked_content/popup_blocker_tab_helper_unittest.cc20
-rw-r--r--chromium/components/blocked_content/popup_opener_tab_helper.cc2
-rw-r--r--chromium/components/blocked_content/popup_opener_tab_helper.h2
-rw-r--r--chromium/components/blocked_content/popup_tracker.cc5
-rw-r--r--chromium/components/blocked_content/popup_tracker.h2
-rw-r--r--chromium/components/blocked_content/safe_browsing_triggered_popup_blocker_unittest.cc8
9 files changed, 37 insertions, 32 deletions
diff --git a/chromium/components/blocked_content/android/BUILD.gn b/chromium/components/blocked_content/android/BUILD.gn
index 1a42a65a8cf..185fc6c880c 100644
--- a/chromium/components/blocked_content/android/BUILD.gn
+++ b/chromium/components/blocked_content/android/BUILD.gn
@@ -12,5 +12,5 @@ android_resources("java_resources") {
"res/drawable-xxhdpi/infobar_blocked_popups.png",
"res/drawable-xxxhdpi/infobar_blocked_popups.png",
]
- custom_package = "org.chromium.components.blocked_content"
+ create_srcjar = false
}
diff --git a/chromium/components/blocked_content/android/popup_blocked_infobar_delegate_unittest.cc b/chromium/components/blocked_content/android/popup_blocked_infobar_delegate_unittest.cc
index e9d3bdf24e3..c2808e8b8b2 100644
--- a/chromium/components/blocked_content/android/popup_blocked_infobar_delegate_unittest.cc
+++ b/chromium/components/blocked_content/android/popup_blocked_infobar_delegate_unittest.cc
@@ -10,8 +10,8 @@
#include "components/blocked_content/popup_blocker_tab_helper.h"
#include "components/blocked_content/safe_browsing_triggered_popup_blocker.h"
#include "components/blocked_content/test/test_popup_navigation_delegate.h"
-#include "components/content_settings/browser/tab_specific_content_settings.h"
-#include "components/content_settings/browser/test_tab_specific_content_settings_delegate.h"
+#include "components/content_settings/browser/page_specific_content_settings.h"
+#include "components/content_settings/browser/test_page_specific_content_settings_delegate.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/infobars/content/content_infobar_manager.h"
#include "components/infobars/core/infobar.h"
@@ -54,10 +54,10 @@ class PopupBlockedInfoBarDelegateTest
HostContentSettingsMap::RegisterProfilePrefs(pref_service_.registry());
settings_map_ = base::MakeRefCounted<HostContentSettingsMap>(
&pref_service_, false, false, false, false);
- content_settings::TabSpecificContentSettings::CreateForWebContents(
+ content_settings::PageSpecificContentSettings::CreateForWebContents(
web_contents(),
std::make_unique<
- content_settings::TestTabSpecificContentSettingsDelegate>(
+ content_settings::TestPageSpecificContentSettingsDelegate>(
/*prefs=*/nullptr, settings_map_.get()));
PopupBlockerTabHelper::CreateForWebContents(web_contents());
diff --git a/chromium/components/blocked_content/popup_blocker_tab_helper.cc b/chromium/components/blocked_content/popup_blocker_tab_helper.cc
index c3537d88c0e..d2a59077d58 100644
--- a/chromium/components/blocked_content/popup_blocker_tab_helper.cc
+++ b/chromium/components/blocked_content/popup_blocker_tab_helper.cc
@@ -13,7 +13,7 @@
#include "components/blocked_content/popup_navigation_delegate.h"
#include "components/blocked_content/popup_tracker.h"
#include "components/blocked_content/safe_browsing_triggered_popup_blocker.h"
-#include "components/content_settings/browser/tab_specific_content_settings.h"
+#include "components/content_settings/browser/page_specific_content_settings.h"
#include "content/public/browser/back_forward_cache.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_handle.h"
@@ -75,10 +75,10 @@ void PopupBlockerTabHelper::DidFinishNavigation(
}
void PopupBlockerTabHelper::HidePopupNotification() {
- auto* tscs = content_settings::TabSpecificContentSettings::FromWebContents(
- web_contents());
- if (tscs)
- tscs->ClearPopupsBlocked();
+ auto* pscs = content_settings::PageSpecificContentSettings::GetForFrame(
+ web_contents()->GetMainFrame());
+ if (pscs)
+ pscs->ClearPopupsBlocked();
}
void PopupBlockerTabHelper::AddBlockedPopup(
@@ -93,9 +93,15 @@ void PopupBlockerTabHelper::AddBlockedPopup(
next_id_++;
blocked_popups_[id] = std::make_unique<BlockedRequest>(
std::move(delegate), window_features, block_type);
- content_settings::TabSpecificContentSettings::FromWebContents(web_contents())
- ->OnContentBlocked(ContentSettingsType::POPUPS);
+
+ auto* content_settings =
+ content_settings::PageSpecificContentSettings::GetForFrame(
+ web_contents()->GetMainFrame());
+ if (content_settings) {
+ content_settings->OnContentBlocked(ContentSettingsType::POPUPS);
+ }
auto* raw_delegate = blocked_popups_[id]->delegate.get();
+
manager_.NotifyObservers(id, raw_delegate->GetURL());
raw_delegate->OnPopupBlocked(web_contents(), GetBlockedPopupsCount());
diff --git a/chromium/components/blocked_content/popup_blocker_tab_helper_unittest.cc b/chromium/components/blocked_content/popup_blocker_tab_helper_unittest.cc
index 1eedfe0421e..f490dc8e677 100644
--- a/chromium/components/blocked_content/popup_blocker_tab_helper_unittest.cc
+++ b/chromium/components/blocked_content/popup_blocker_tab_helper_unittest.cc
@@ -9,8 +9,8 @@
#include "components/blocked_content/safe_browsing_triggered_popup_blocker.h"
#include "components/blocked_content/test/test_popup_navigation_delegate.h"
#include "components/blocked_content/url_list_manager.h"
-#include "components/content_settings/browser/tab_specific_content_settings.h"
-#include "components/content_settings/browser/test_tab_specific_content_settings_delegate.h"
+#include "components/content_settings/browser/page_specific_content_settings.h"
+#include "components/content_settings/browser/test_page_specific_content_settings_delegate.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "content/public/test/test_renderer_host.h"
@@ -58,10 +58,10 @@ class PopupBlockerTabHelperTest : public content::RenderViewHostTestHarness {
HostContentSettingsMap::RegisterProfilePrefs(pref_service_.registry());
settings_map_ = base::MakeRefCounted<HostContentSettingsMap>(
&pref_service_, false, false, false, false);
- content_settings::TabSpecificContentSettings::CreateForWebContents(
+ content_settings::PageSpecificContentSettings::CreateForWebContents(
web_contents(),
std::make_unique<
- content_settings::TestTabSpecificContentSettingsDelegate>(
+ content_settings::TestPageSpecificContentSettingsDelegate>(
/*prefs=*/nullptr, settings_map_.get()));
PopupBlockerTabHelper::CreateForWebContents(web_contents());
@@ -149,8 +149,8 @@ TEST_F(PopupBlockerTabHelperTest, DoesNotShowPopupWithInvalidID) {
TEST_F(PopupBlockerTabHelperTest, SetsContentSettingsPopupState) {
auto* content_settings =
- content_settings::TabSpecificContentSettings::FromWebContents(
- web_contents());
+ content_settings::PageSpecificContentSettings::GetForFrame(
+ web_contents()->GetMainFrame());
EXPECT_FALSE(content_settings->IsContentBlocked(ContentSettingsType::POPUPS));
TestPopupNavigationDelegate::ResultHolder result;
@@ -176,13 +176,13 @@ TEST_F(PopupBlockerTabHelperTest, ClearsContentSettingsPopupStateOnNavigation) {
helper()->AddBlockedPopup(
std::make_unique<TestPopupNavigationDelegate>(GURL(kUrl1), &result),
blink::mojom::WindowFeatures(), PopupBlockType::kNoGesture);
- EXPECT_TRUE(content_settings::TabSpecificContentSettings::FromWebContents(
- web_contents())
+ EXPECT_TRUE(content_settings::PageSpecificContentSettings::GetForFrame(
+ web_contents()->GetMainFrame())
->IsContentBlocked(ContentSettingsType::POPUPS));
NavigateAndCommit(GURL(kUrl2));
- EXPECT_FALSE(content_settings::TabSpecificContentSettings::FromWebContents(
- web_contents())
+ EXPECT_FALSE(content_settings::PageSpecificContentSettings::GetForFrame(
+ web_contents()->GetMainFrame())
->IsContentBlocked(ContentSettingsType::POPUPS));
}
diff --git a/chromium/components/blocked_content/popup_opener_tab_helper.cc b/chromium/components/blocked_content/popup_opener_tab_helper.cc
index b0707531d5b..77a7d075087 100644
--- a/chromium/components/blocked_content/popup_opener_tab_helper.cc
+++ b/chromium/components/blocked_content/popup_opener_tab_helper.cc
@@ -91,7 +91,7 @@ void PopupOpenerTabHelper::OnVisibilityChanged(content::Visibility visibility) {
}
void PopupOpenerTabHelper::DidGetUserInteraction(
- const blink::WebInputEvent::Type type) {
+ const blink::WebInputEvent& event) {
has_opened_popup_since_last_user_gesture_ = false;
}
diff --git a/chromium/components/blocked_content/popup_opener_tab_helper.h b/chromium/components/blocked_content/popup_opener_tab_helper.h
index 363f0fea1e4..9d070f37115 100644
--- a/chromium/components/blocked_content/popup_opener_tab_helper.h
+++ b/chromium/components/blocked_content/popup_opener_tab_helper.h
@@ -66,7 +66,7 @@ class PopupOpenerTabHelper
void OnVisibilityChanged(content::Visibility visibility) override;
void DidStartNavigation(
content::NavigationHandle* navigation_handle) override;
- void DidGetUserInteraction(const blink::WebInputEvent::Type type) override;
+ void DidGetUserInteraction(const blink::WebInputEvent& event) override;
// Logs user popup content settings if the last committed URL is valid and
// we have not recorded the settings for the opener id of the helper's
diff --git a/chromium/components/blocked_content/popup_tracker.cc b/chromium/components/blocked_content/popup_tracker.cc
index 2735f516abe..22cf6b9cb44 100644
--- a/chromium/components/blocked_content/popup_tracker.cc
+++ b/chromium/components/blocked_content/popup_tracker.cc
@@ -131,13 +131,12 @@ void PopupTracker::OnVisibilityChanged(content::Visibility visibility) {
visibility_tracker_.OnShown();
}
-void PopupTracker::DidGetUserInteraction(
- const blink::WebInputEvent::Type type) {
+void PopupTracker::DidGetUserInteraction(const blink::WebInputEvent& event) {
// TODO(csharrison): It would be nice if ctrl-W could be filtered out here,
// but the initial ctrl key press is registered as a kRawKeyDown.
num_interactions_++;
- if (type == blink::WebInputEvent::Type::kGestureScrollBegin) {
+ if (event.GetType() == blink::WebInputEvent::Type::kGestureScrollBegin) {
num_gesture_scroll_begin_events_++;
} else {
num_activation_events_++;
diff --git a/chromium/components/blocked_content/popup_tracker.h b/chromium/components/blocked_content/popup_tracker.h
index 8366782de61..29483926eb6 100644
--- a/chromium/components/blocked_content/popup_tracker.h
+++ b/chromium/components/blocked_content/popup_tracker.h
@@ -59,7 +59,7 @@ class PopupTracker : public content::WebContentsObserver,
void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override;
void OnVisibilityChanged(content::Visibility visibility) override;
- void DidGetUserInteraction(const blink::WebInputEvent::Type type) override;
+ void DidGetUserInteraction(const blink::WebInputEvent& event) override;
// subresource_filter::SubresourceFilterObserver:
void OnSafeBrowsingChecksComplete(
diff --git a/chromium/components/blocked_content/safe_browsing_triggered_popup_blocker_unittest.cc b/chromium/components/blocked_content/safe_browsing_triggered_popup_blocker_unittest.cc
index 827799894c9..d91674a9da0 100644
--- a/chromium/components/blocked_content/safe_browsing_triggered_popup_blocker_unittest.cc
+++ b/chromium/components/blocked_content/safe_browsing_triggered_popup_blocker_unittest.cc
@@ -18,8 +18,8 @@
#include "components/blocked_content/popup_blocker_tab_helper.h"
#include "components/blocked_content/popup_navigation_delegate.h"
#include "components/blocked_content/test/test_popup_navigation_delegate.h"
-#include "components/content_settings/browser/tab_specific_content_settings.h"
-#include "components/content_settings/browser/test_tab_specific_content_settings_delegate.h"
+#include "components/content_settings/browser/page_specific_content_settings.h"
+#include "components/content_settings/browser/test_page_specific_content_settings_delegate.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/subresource_filter/content/browser/fake_safe_browsing_database_manager.h"
#include "components/subresource_filter/content/browser/subresource_filter_client.h"
@@ -83,10 +83,10 @@ class SafeBrowsingTriggeredPopupBlockerTest
subresource_filter::SubresourceFilterObserverManager::CreateForWebContents(
web_contents());
PopupBlockerTabHelper::CreateForWebContents(web_contents());
- content_settings::TabSpecificContentSettings::CreateForWebContents(
+ content_settings::PageSpecificContentSettings::CreateForWebContents(
web_contents(),
std::make_unique<
- content_settings::TestTabSpecificContentSettingsDelegate>(
+ content_settings::TestPageSpecificContentSettingsDelegate>(
/*prefs=*/nullptr, settings_map_.get()));
popup_blocker_ =
SafeBrowsingTriggeredPopupBlocker::FromWebContents(web_contents());