Chromium Code Reviews| 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 kActivationListSocialEngAdsIntestitial[]; | |
|
engedy
2016/08/25 21:32:54
typo: "Interstitial" (missing 'r'). In more place
melandory
2016/08/26 15:06:10
Done.
| |
| 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 | |
| 47 // ActivationList::SOCIAL_ENG_ADS_INTERSTITAL. | |
| 48 ActivationList GetCurrentActivationList(); | |
|
engedy
2016/08/25 21:32:54
I'd suggest being even more conservative here. An
melandory
2016/08/26 15:06:10
Done.
| |
| 49 | |
| 39 } // namespace subresource_filter | 50 } // namespace subresource_filter |
| 40 | 51 |
| 41 #endif // COMPONENTS_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_FEATURES_H_ | 52 #endif // COMPONENTS_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_FEATURES_H_ |
| OLD | NEW |