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

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

Issue 2584503002: Clean up ContentSubresourceFilterDriverFactory. (Closed)
Patch Set: Created 4 years 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_driver_factory.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_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 b04c52ab815bfcf9918f5a55ac6b4a029cd9416f..2580e2cab58415f14e56056b6dfa25b1fc1f946e 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
@@ -117,11 +117,14 @@ void ContentSubresourceFilterDriverFactory::AddHostOfURLToWhitelistSet(
bool ContentSubresourceFilterDriverFactory::ShouldActivateForMainFrameURL(
const GURL& url) const {
- if (GetCurrentActivationScope() == ActivationScope::ALL_SITES)
- return !IsWhitelisted(url);
- else if (GetCurrentActivationScope() == ActivationScope::ACTIVATION_LIST)
- return DidURLMatchCurrentActivationList(url) && !IsWhitelisted(url);
- return false;
+ switch (GetCurrentActivationScope()) {
+ case ActivationScope::ALL_SITES:
+ return !IsWhitelisted(url);
+ case ActivationScope::ACTIVATION_LIST:
+ return DidURLMatchCurrentActivationList(url) && !IsWhitelisted(url);
+ default:
+ return false;
+ }
}
void ContentSubresourceFilterDriverFactory::ActivateForFrameHostIfNeeded(
« no previous file with comments | « components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698