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

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

Issue 2022783002: Skeleton of the Safe Browsing Subresource Filter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement RenderFrameObserver::OnDestruct introduced by rebase. Created 4 years, 6 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
new file mode 100644
index 0000000000000000000000000000000000000000..b272ef62e3cc3b062575704e838fa74a1a45e48c
--- /dev/null
+++ b/components/subresource_filter/core/browser/subresource_filter_features.cc
@@ -0,0 +1,31 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/subresource_filter/core/browser/subresource_filter_features.h"
+
+#include <string>
+
+#include "base/strings/string_util.h"
+#include "components/variations/variations_associated_data.h"
+
+namespace subresource_filter {
+
+const base::Feature kSafeBrowsingSubresourceFilter{
+ "SubresourceFilter", base::FEATURE_DISABLED_BY_DEFAULT};
+
+const char kActivationStateParameterName[] = "activation_state";
+const char kActivationStateDryRun[] = "dryrun";
+const char kActivationStateEnabled[] = "enabled";
+
+ActivationState GetMaximumActivationState() {
+ std::string activation_state = variations::GetVariationParamValueByFeature(
+ kSafeBrowsingSubresourceFilter, kActivationStateParameterName);
+ if (base::LowerCaseEqualsASCII(activation_state, kActivationStateEnabled))
+ return ActivationState::ENABLED;
+ else if (base::LowerCaseEqualsASCII(activation_state, kActivationStateDryRun))
+ return ActivationState::DRYRUN;
+ return ActivationState::DISABLED;
+}
+
+} // namespace subresource_filter

Powered by Google App Engine
This is Rietveld 408576698