OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_FEATURES_H_ | 5 #ifndef COMPONENTS_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_FEATURES_H_ |
6 #define COMPONENTS_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_FEATURES_H_ | 6 #define COMPONENTS_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_FEATURES_H_ |
7 | 7 |
8 #include "base/feature_list.h" | 8 #include "base/feature_list.h" |
| 9 #include "components/subresource_filter/core/common/activation_list.h" |
9 #include "components/subresource_filter/core/common/activation_scope.h" | 10 #include "components/subresource_filter/core/common/activation_scope.h" |
10 #include "components/subresource_filter/core/common/activation_state.h" | 11 #include "components/subresource_filter/core/common/activation_state.h" |
11 | 12 |
12 namespace subresource_filter { | 13 namespace subresource_filter { |
13 | 14 |
14 // The master toggle to enable/disable the Safe Browsing Subresource Filter. | 15 // The master toggle to enable/disable the Safe Browsing Subresource Filter. |
15 extern const base::Feature kSafeBrowsingSubresourceFilter; | 16 extern const base::Feature kSafeBrowsingSubresourceFilter; |
16 | 17 |
17 // Name/values of the variation parameter controlling maximum activation state. | 18 // Name/values of the variation parameter controlling maximum activation state. |
18 extern const char kActivationStateParameterName[]; | 19 extern const char kActivationStateParameterName[]; |
19 extern const char kActivationStateDryRun[]; | 20 extern const char kActivationStateDryRun[]; |
20 extern const char kActivationStateEnabled[]; | 21 extern const char kActivationStateEnabled[]; |
21 extern const char kActivationStateDisabled[]; | 22 extern const char kActivationStateDisabled[]; |
22 | 23 |
23 extern const char kActivationScopeParameterName[]; | 24 extern const char kActivationScopeParameterName[]; |
24 extern const char kActivationScopeAllSites[]; | 25 extern const char kActivationScopeAllSites[]; |
25 extern const char kActivationScopeActivationList[]; | 26 extern const char kActivationScopeActivationList[]; |
26 extern const char kActivationScopeNoSites[]; | 27 extern const char kActivationScopeNoSites[]; |
27 | 28 |
| 29 extern const char kActivationListsParameterName[]; |
| 30 extern const char kActivationListSocialEngineeringAdsInterstitial[]; |
| 31 extern const char kActivationListPhishingInterstitial[]; |
| 32 |
28 // Returns the maximum degree to which subresource filtering should be activated | 33 // Returns the maximum degree to which subresource filtering should be activated |
29 // on any RenderFrame. This will be ActivationState::DISABLED unless the feature | 34 // on any RenderFrame. This will be ActivationState::DISABLED unless the feature |
30 // is enabled and variation parameters prescribe a higher activation state. | 35 // is enabled and variation parameters prescribe a higher activation state. |
31 ActivationState GetMaximumActivationState(); | 36 ActivationState GetMaximumActivationState(); |
32 | 37 |
33 // Returns the current activation scope, that is, the subset of page loads where | 38 // Returns the current activation scope, that is, the subset of page loads where |
34 // subresource filtering should be activated. The function returns | 39 // subresource filtering should be activated. The function returns |
35 // ActivationScope::NO_SITES unless the feature is enabled and variation | 40 // ActivationScope::NO_SITES unless the feature is enabled and variation |
36 // parameters prescribe a wider activation scope. | 41 // parameters prescribe a wider activation scope. |
37 ActivationScope GetCurrentActivationScope(); | 42 ActivationScope GetCurrentActivationScope(); |
38 | 43 |
| 44 // Returns current activation list, based on the values from variation params in |
| 45 // the feature |kSafeBrowsingSubresourceFilter|. When the corresponding |
| 46 // variation param is empty, returns most conservative ActivationList::NONE. |
| 47 ActivationList GetCurrentActivationList(); |
| 48 |
39 } // namespace subresource_filter | 49 } // namespace subresource_filter |
40 | 50 |
41 #endif // COMPONENTS_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_FEATURES_H_ | 51 #endif // COMPONENTS_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_FEATURES_H_ |
OLD | NEW |