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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2822773002: [subresource_filter] Force the popup blocker on sites with activation (Closed)
Patch Set: Integrate with popup blocker 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
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 c5abcfb88c15e0718e9cfd1db5480cde21320dea..9ffe985a9da01c388bbb6791d2fbd5b22f14251f 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -2550,7 +2550,13 @@ bool ChromeContentBrowserClient::CanCreateWindow(
target_url, referrer, frame_name, disposition, features, user_gesture,
opener_suppressed, opener_render_process_id, opener_render_frame_id);
- if (!user_gesture &&
+ auto* driver_factory = subresource_filter::
+ ContentSubresourceFilterDriverFactory::FromWebContents(web_contents);
+ bool popup_block_candidate =
engedy 2017/04/24 10:03:27 nit: const bool
Charlie Harrison 2017/04/24 15:41:54 Done.
+ !user_gesture ||
+ (driver_factory &&
+ driver_factory->throttle_manager()->ShouldDisallowNewWindow());
+ if (popup_block_candidate &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisablePopupBlocking)) {
if (content_settings->GetContentSetting(

Powered by Google App Engine
This is Rietveld 408576698