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

Unified Diff: components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.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 | « components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc
diff --git a/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc b/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc
index 3bdccc6017d338e3cadc9a7f5acf981461f04c18..97976e2d473be8ce938df349447b007b5be2df22 100644
--- a/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc
+++ b/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc
@@ -195,6 +195,18 @@ void ContentSubresourceFilterThrottleManager::MaybeAppendNavigationThrottles(
}
}
+bool ContentSubresourceFilterThrottleManager::ShouldDisallowNewWindow() {
+ auto it = activated_frame_hosts_.find(web_contents()->GetMainFrame());
+ if (it == activated_frame_hosts_.end())
+ return false;
+ const ActivationState state = it->second->activation_state();
+ // This should trigger the standard popup blocking UI, so don't force the
+ // subresource filter specific UI here.
+ return state.activation_level == ActivationLevel::ENABLED &&
+ !state.filtering_disabled_for_document &&
+ !state.generic_blocking_rules_disabled;
+}
+
std::unique_ptr<SubframeNavigationFilteringThrottle>
ContentSubresourceFilterThrottleManager::
MaybeCreateSubframeNavigationFilteringThrottle(
« no previous file with comments | « components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698