Avi Drissman | 8ba1bad | 2022-09-13 19:22:36 | [diff] [blame] | 1 | // Copyright 2019 The Chromium Authors |
Kristi Park | 01ca125 | 2019-05-10 22:39:05 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "components/ntp_tiles/features.h" |
| 6 | |
| 7 | #include "base/feature_list.h" |
Benjamin Williams | aa8da814 | 2022-11-14 19:51:03 | [diff] [blame] | 8 | #include "base/metrics/field_trial_params.h" |
Justin DeWitt | 03ae1bd | 2019-09-10 22:39:51 | [diff] [blame] | 9 | #include "build/build_config.h" |
Kristi Park | 01ca125 | 2019-05-10 22:39:05 | [diff] [blame] | 10 | #include "ui/base/ui_base_features.h" |
| 11 | |
| 12 | namespace ntp_tiles { |
| 13 | |
| 14 | const char kPopularSitesFieldTrialName[] = "NTPPopularSites"; |
| 15 | |
Daniel Cheng | 11f342f | 2022-09-27 23:23:35 | [diff] [blame] | 16 | BASE_FEATURE(kPopularSitesBakedInContentFeature, |
| 17 | "NTPPopularSitesBakedInContent", |
| 18 | base::FEATURE_ENABLED_BY_DEFAULT); |
Kristi Park | 01ca125 | 2019-05-10 22:39:05 | [diff] [blame] | 19 | |
Daniel Cheng | 11f342f | 2022-09-27 23:23:35 | [diff] [blame] | 20 | BASE_FEATURE(kNtpMostLikelyFaviconsFromServerFeature, |
| 21 | "NTPMostLikelyFaviconsFromServer", |
| 22 | base::FEATURE_ENABLED_BY_DEFAULT); |
Kristi Park | 01ca125 | 2019-05-10 22:39:05 | [diff] [blame] | 23 | |
Daniel Cheng | 11f342f | 2022-09-27 23:23:35 | [diff] [blame] | 24 | BASE_FEATURE(kUsePopularSitesSuggestions, |
| 25 | "UsePopularSitesSuggestions", |
| 26 | base::FEATURE_ENABLED_BY_DEFAULT); |
Kristi Park | 01ca125 | 2019-05-10 22:39:05 | [diff] [blame] | 27 | |
adamta | 8886def4 | 2023-03-07 19:45:23 | [diff] [blame^] | 28 | BASE_FEATURE(kNewTabPageRetention, |
| 29 | "IOSNewTabPageRetention", |
Benjamin Williams | aa8da814 | 2022-11-14 19:51:03 | [diff] [blame] | 30 | base::FEATURE_DISABLED_BY_DEFAULT); |
| 31 | |
adamta | 8886def4 | 2023-03-07 19:45:23 | [diff] [blame^] | 32 | const char kNewTabPageRetentionName[] = "IOSNewTabPageRetention"; |
| 33 | |
| 34 | const char kNewTabPageRetentionParam[] = "NewTabPageRetentionParam"; |
| 35 | |
| 36 | NewTabPageRetentionExperimentBehavior GetNewTabPageRetentionExperimentType() { |
| 37 | if (base::FeatureList::IsEnabled(kNewTabPageRetention)) { |
| 38 | return (NewTabPageRetentionExperimentBehavior) |
| 39 | base::GetFieldTrialParamByFeatureAsInt(kNewTabPageRetention, |
| 40 | kNewTabPageRetentionParam, |
| 41 | /*default_value=*/0); |
Benjamin Williams | aa8da814 | 2022-11-14 19:51:03 | [diff] [blame] | 42 | } |
| 43 | |
adamta | 8886def4 | 2023-03-07 19:45:23 | [diff] [blame^] | 44 | return NewTabPageRetentionExperimentBehavior::kDefault; |
Benjamin Williams | aa8da814 | 2022-11-14 19:51:03 | [diff] [blame] | 45 | } |
| 46 | |
Kristi Park | 01ca125 | 2019-05-10 22:39:05 | [diff] [blame] | 47 | } // namespace ntp_tiles |