| 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 "components/ntp_tiles/constants.h" | 5 #include "components/ntp_tiles/constants.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/feature_list.h" | 8 #include "base/feature_list.h" |
| 9 #include "components/ntp_tiles/switches.h" | 9 #include "components/ntp_tiles/switches.h" |
| 10 | 10 |
| 11 namespace ntp_tiles { | 11 namespace ntp_tiles { |
| 12 | 12 |
| 13 const char kPopularSitesFieldTrialName[] = "NTPPopularSites"; | 13 const char kPopularSitesFieldTrialName[] = "NTPPopularSites"; |
| 14 | 14 |
| 15 extern const base::Feature kPopularSitesBakedInContentFeature{ | 15 extern const base::Feature kPopularSitesBakedInContentFeature{ |
| 16 "NTPPopularSitesBakedInContent", base::FEATURE_ENABLED_BY_DEFAULT}; | 16 "NTPPopularSitesBakedInContent", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 17 | 17 |
| 18 extern const base::Feature kNtpMostLikelyFaviconsFromServerFeature{ | 18 extern const base::Feature kNtpMostLikelyFaviconsFromServerFeature{ |
| 19 "NTPMostLikelyFaviconsFromServer", base::FEATURE_DISABLED_BY_DEFAULT}; | 19 "NTPMostLikelyFaviconsFromServer", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 20 | 20 |
| 21 extern const base::Feature kPinHomePageAsTileFeature{ | |
| 22 "PinHomePageAsTile", base::FEATURE_DISABLED_BY_DEFAULT}; | |
| 23 | |
| 24 bool AreNtpMostLikelyFaviconsFromServerEnabled() { | 21 bool AreNtpMostLikelyFaviconsFromServerEnabled() { |
| 25 // Check if the experimental flag is forced on or off. | 22 // Check if the experimental flag is forced on or off. |
| 26 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 23 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 27 if (command_line->HasSwitch( | 24 if (command_line->HasSwitch( |
| 28 switches::kEnableNtpMostLikelyFaviconsFromServer)) { | 25 switches::kEnableNtpMostLikelyFaviconsFromServer)) { |
| 29 return true; | 26 return true; |
| 30 } else if (command_line->HasSwitch( | 27 } else if (command_line->HasSwitch( |
| 31 switches::kDisableNtpMostLikelyFaviconsFromServer)) { | 28 switches::kDisableNtpMostLikelyFaviconsFromServer)) { |
| 32 return false; | 29 return false; |
| 33 } | 30 } |
| 34 | 31 |
| 35 // Check if the finch experiment is turned on. | 32 // Check if the finch experiment is turned on. |
| 36 return base::FeatureList::IsEnabled(kNtpMostLikelyFaviconsFromServerFeature); | 33 return base::FeatureList::IsEnabled(kNtpMostLikelyFaviconsFromServerFeature); |
| 37 } | 34 } |
| 38 | 35 |
| 39 } // namespace ntp_tiles | 36 } // namespace ntp_tiles |
| OLD | NEW |