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

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

Issue 2874663002: [subresource_filter] s/ShouldSuppressActivation/OnPageActivationComputed (Closed)
Patch Set: engedy review Created 3 years, 7 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 482778287962f8073fb32fb233b77774dac35273..0c068ffc6ceffb387ea16cbbb3fb6ad28952adda 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
@@ -120,9 +120,6 @@ ContentSubresourceFilterDriverFactory::
if (!url.SchemeIsHTTPOrHTTPS())
return ActivationDecision::UNSUPPORTED_SCHEME;
- if (client_->ShouldSuppressActivation(navigation_handle))
- return ActivationDecision::URL_WHITELISTED;
-
switch (configurations->the_one_and_only().activation_scope) {
case ActivationScope::ALL_SITES:
return ActivationDecision::ACTIVATED;
@@ -189,6 +186,13 @@ void ContentSubresourceFilterDriverFactory::WillProcessResponse(
activation_decision_ =
ComputeActivationDecisionForMainFrameNavigation(navigation_handle);
+
+ // Check for the whitelisted status last, so that the client gets an accurate
+ // indication of whether there would be activation otherwise.
+ bool whitelisted = client_->OnPageActivationComputed(
+ navigation_handle, activation_decision_ == ActivationDecision::ACTIVATED);
+ if (whitelisted)
+ activation_decision_ = ActivationDecision::URL_WHITELISTED;
DCHECK(activation_decision_ != ActivationDecision::UNKNOWN);
if (activation_decision_ != ActivationDecision::ACTIVATED) {
ResetActivationState();

Powered by Google App Engine
This is Rietveld 408576698