| 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 { | 12 namespace { |
| 13 const base::Feature kLocalDatabaseManagerEnabled{ | 13 const base::Feature kLocalDatabaseManagerEnabled{ |
| 14 "SafeBrowsingV4LocalDatabaseManagerEnabled", | 14 "SafeBrowsingV4LocalDatabaseManagerEnabled", |
| 15 base::FEATURE_DISABLED_BY_DEFAULT}; | 15 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 16 | 16 |
| 17 const base::Feature kV4HybridEnabled{"SafeBrowsingV4HybridEnabled", | 17 const base::Feature kV4HybridEnabled{"SafeBrowsingV4HybridEnabled", |
| 18 base::FEATURE_DISABLED_BY_DEFAULT}; | 18 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 19 | 19 |
| 20 const base::Feature kV4OnlyEnabled{"SafeBrowsingV4OnlyEnabled", |
| 21 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 22 |
| 20 } // namespace | 23 } // namespace |
| 21 | 24 |
| 22 bool IsLocalDatabaseManagerEnabled() { | 25 bool IsLocalDatabaseManagerEnabled() { |
| 23 return base::FeatureList::IsEnabled(kLocalDatabaseManagerEnabled) || | 26 return base::FeatureList::IsEnabled(kLocalDatabaseManagerEnabled) || |
| 24 IsV4HybridEnabled(); | 27 IsV4HybridEnabled() || IsV4OnlyEnabled(); |
| 25 } | 28 } |
| 26 | 29 |
| 27 bool IsV4HybridEnabled() { | 30 bool IsV4HybridEnabled() { |
| 28 return base::FeatureList::IsEnabled(kV4HybridEnabled); | 31 return base::FeatureList::IsEnabled(kV4HybridEnabled); |
| 29 } | 32 } |
| 30 | 33 |
| 34 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); |
| 38 } |
| 39 |
| 31 } // namespace V4FeatureList | 40 } // namespace V4FeatureList |
| 32 | 41 |
| 33 } // namespace safe_browsing | 42 } // namespace safe_browsing |
| OLD | NEW |