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

Unified Diff: components/subresource_filter/core/browser/subresource_filter_features.cc

Issue 2186233003: Introduce activation scope logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adressed-comments 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/core/browser/subresource_filter_features.cc
diff --git a/components/subresource_filter/core/browser/subresource_filter_features.cc b/components/subresource_filter/core/browser/subresource_filter_features.cc
index 3e16a9f98d7aed7b2f8538c298fca6744e0ea7fa..a0dea3959a6db787c5a27ba211922ebcacfe608a 100644
--- a/components/subresource_filter/core/browser/subresource_filter_features.cc
+++ b/components/subresource_filter/core/browser/subresource_filter_features.cc
@@ -19,6 +19,11 @@ const char kActivationStateDryRun[] = "dryrun";
const char kActivationStateEnabled[] = "enabled";
const char kActivationStateDisabled[] = "disabled";
+const char kActivationScopeParameterName[] = "activation_scope";
+const char kActivationScopeAllSites[] = "all_sites";
+const char kActivationScopeActivationList[] = "activation_list";
+const char kActivationScopeNoSites[] = "no_sites";
+
ActivationState GetMaximumActivationState() {
std::string activation_state = variations::GetVariationParamValueByFeature(
kSafeBrowsingSubresourceFilter, kActivationStateParameterName);
@@ -29,4 +34,15 @@ ActivationState GetMaximumActivationState() {
return ActivationState::DISABLED;
}
+ActivationScope GetCurrentActivationScope() {
+ std::string activation_scope = variations::GetVariationParamValueByFeature(
+ kSafeBrowsingSubresourceFilter, kActivationScopeParameterName);
+ if (base::LowerCaseEqualsASCII(activation_scope, kActivationScopeAllSites))
+ return ActivationScope::ALL_SITES;
+ else if (base::LowerCaseEqualsASCII(activation_scope,
+ kActivationScopeActivationList))
+ return ActivationScope::ACTIVATION_LIST;
+ return ActivationScope::NO_SITES;
+}
+
} // namespace subresource_filter

Powered by Google App Engine
This is Rietveld 408576698