Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2822773002: [subresource_filter] Force the popup blocker on sites with activation (Closed)
Patch Set: engedy review Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/subresource_filter/subresource_filter_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index bff38f9611425162fafc5835612906d973cb3080..53ed1cef63402f08b1da9ccdaf11af04290863fc 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -2528,7 +2528,13 @@ bool ChromeContentBrowserClient::CanCreateWindow(
}
#endif
- if (!user_gesture &&
+ auto* driver_factory = subresource_filter::
+ ContentSubresourceFilterDriverFactory::FromWebContents(web_contents);
+ const bool popup_block_candidate =
+ !user_gesture ||
+ (driver_factory &&
+ driver_factory->throttle_manager()->ShouldDisallowNewWindow());
+ if (popup_block_candidate &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisablePopupBlocking)) {
if (content_settings->GetContentSetting(
« no previous file with comments | « no previous file | chrome/browser/subresource_filter/subresource_filter_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698