| 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 #include "base/feature_list.h" | 5 #include "base/feature_list.h" |
| 6 #include "components/safe_browsing_db/v4_feature_list.h" | 6 #include "components/safe_browsing_db/v4_feature_list.h" |
| 7 | 7 |
| 8 namespace safe_browsing { | 8 namespace safe_browsing { |
| 9 | 9 |
| 10 namespace V4FeatureList { | 10 namespace V4FeatureList { |
| 11 | 11 |
| 12 namespace { | |
| 13 const base::Feature kLocalDatabaseManagerEnabled{ | 12 const base::Feature kLocalDatabaseManagerEnabled{ |
| 14 "SafeBrowsingV4LocalDatabaseManagerEnabled", | 13 "SafeBrowsingV4LocalDatabaseManagerEnabled", |
| 15 base::FEATURE_DISABLED_BY_DEFAULT}; | 14 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 16 | 15 |
| 17 const base::Feature kV4HybridEnabled{"SafeBrowsingV4HybridEnabled", | 16 const base::Feature kV4HybridEnabled{"SafeBrowsingV4HybridEnabled", |
| 18 base::FEATURE_DISABLED_BY_DEFAULT}; | 17 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 19 | 18 |
| 20 const base::Feature kV4OnlyEnabled{"SafeBrowsingV4OnlyEnabled", | 19 const base::Feature kV4OnlyEnabled{"SafeBrowsingV4OnlyEnabled", |
| 21 base::FEATURE_DISABLED_BY_DEFAULT}; | 20 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 22 | 21 |
| 23 } // namespace | |
| 24 | |
| 25 bool IsLocalDatabaseManagerEnabled() { | 22 bool IsLocalDatabaseManagerEnabled() { |
| 26 return base::FeatureList::IsEnabled(kLocalDatabaseManagerEnabled) || | 23 return base::FeatureList::IsEnabled(kLocalDatabaseManagerEnabled) || |
| 27 IsV4HybridEnabled() || IsV4OnlyEnabled(); | 24 IsV4HybridEnabled() || IsV4OnlyEnabled(); |
| 28 } | 25 } |
| 29 | 26 |
| 30 bool IsV4HybridEnabled() { | 27 bool IsV4HybridEnabled() { |
| 31 return base::FeatureList::IsEnabled(kV4HybridEnabled); | 28 return base::FeatureList::IsEnabled(kV4HybridEnabled); |
| 32 } | 29 } |
| 33 | 30 |
| 34 bool IsV4OnlyEnabled() { | 31 bool IsV4OnlyEnabled() { |
| 35 // TODO(vakh): Enable this only when all the lists can be synced from the | |
| 36 // server. See http://b/33182208 | |
| 37 return base::FeatureList::IsEnabled(kV4OnlyEnabled); | 32 return base::FeatureList::IsEnabled(kV4OnlyEnabled); |
| 38 } | 33 } |
| 39 | 34 |
| 40 } // namespace V4FeatureList | 35 } // namespace V4FeatureList |
| 41 | 36 |
| 42 } // namespace safe_browsing | 37 } // namespace safe_browsing |
| OLD | NEW |