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

Unified Diff: components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc

Issue 2186233003: Introduce activation scope logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one feature Created 4 years, 4 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: components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc
diff --git a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc
index 9bee08f0e3b5cb386e70b77e3832731d4f6f02a6..1d987237cd1a694cd6fd69c92eacdaed3ae737ca 100644
--- a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc
+++ b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc
@@ -82,7 +82,8 @@ void ContentSubresourceFilterDriverFactory::AddOriginOfURLToActivationSet(
void ContentSubresourceFilterDriverFactory::ActivateForFrameHostIfNeeded(
content::RenderFrameHost* render_frame_host,
const GURL& url) {
- if (!ShouldActivateForURL(url))
+ if (GetCurrentActivationScope() != ActivationScope::ACTIVATION_LIST ||
+ !ShouldActivateForURL(url))
return;
ContentSubresourceFilterDriver* driver =
DriverFromFrameHost(render_frame_host);
@@ -121,9 +122,10 @@ void ContentSubresourceFilterDriverFactory::DidStartProvisionalLoadForFrame(
const GURL& validated_url,
bool is_error_page,
bool is_iframe_srcdoc) {
- // TODO(melandory): Replace placeholder with actual activation logic.
- DriverFromFrameHost(render_frame_host)
- ->ActivateForProvisionalLoad(GetMaximumActivationState());
+ if (GetCurrentActivationScope() == ActivationScope::ALL_SITES) {
+ DriverFromFrameHost(render_frame_host)
+ ->ActivateForProvisionalLoad(GetMaximumActivationState());
+ }
}
} // namespace subresource_filter

Powered by Google App Engine
This is Rietveld 408576698