Avi Drissman | 8ba1bad | 2022-09-13 19:22:36 | [diff] [blame] | 1 | // Copyright 2020 The Chromium Authors |
Ehimare Okoyomon | 2eccb607 | 2020-05-12 12:22:27 | [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 | |
Olesia Marukhno | 46ccd43 | 2021-12-03 08:50:27 | [diff] [blame] | 5 | #include "components/page_info/core/features.h" |
Ehimare Okoyomon | 2eccb607 | 2020-05-12 12:22:27 | [diff] [blame] | 6 | |
| 7 | #include "base/feature_list.h" |
| 8 | #include "base/metrics/field_trial_params.h" |
Xiaohan Wang | d9e3b1f0 | 2022-01-14 14:48:35 | [diff] [blame] | 9 | #include "build/build_config.h" |
Christian Dullweber | 329dad3 | 2022-04-20 17:45:38 | [diff] [blame] | 10 | #include "ui/base/l10n/l10n_util.h" |
Ehimare Okoyomon | 2eccb607 | 2020-05-12 12:22:27 | [diff] [blame] | 11 | |
| 12 | namespace page_info { |
| 13 | |
Xiaohan Wang | d9e3b1f0 | 2022-01-14 14:48:35 | [diff] [blame] | 14 | #if BUILDFLAG(IS_ANDROID) |
Daniel Cheng | d287997 | 2022-09-26 09:12:20 | [diff] [blame^] | 15 | BASE_FEATURE(kPageInfoHistory, |
| 16 | "PageInfoHistory", |
| 17 | base::FEATURE_ENABLED_BY_DEFAULT); |
| 18 | BASE_FEATURE(kPageInfoStoreInfo, |
| 19 | "PageInfoStoreInfo", |
| 20 | base::FEATURE_DISABLED_BY_DEFAULT); |
Christian Dullweber | 2b2f02a | 2022-02-08 19:06:08 | [diff] [blame] | 21 | |
Daniel Cheng | d287997 | 2022-09-26 09:12:20 | [diff] [blame^] | 22 | BASE_FEATURE(kPageInfoDiscoverability, |
| 23 | "PageInfoDiscoverability", |
| 24 | base::FEATURE_ENABLED_BY_DEFAULT); |
Christian Dullweber | 3f91c90c8 | 2020-09-09 10:48:26 | [diff] [blame] | 25 | #endif |
Ehimare Okoyomon | 2eccb607 | 2020-05-12 12:22:27 | [diff] [blame] | 26 | |
Christian Dullweber | 329dad3 | 2022-04-20 17:45:38 | [diff] [blame] | 27 | extern bool IsAboutThisSiteFeatureEnabled(const std::string& locale) { |
| 28 | if (l10n_util::GetLanguage(locale) == "en") { |
| 29 | return base::FeatureList::IsEnabled(kPageInfoAboutThisSiteEn); |
| 30 | } else { |
| 31 | return base::FeatureList::IsEnabled(kPageInfoAboutThisSiteNonEn); |
| 32 | } |
| 33 | } |
Olesia Marukhno | 0fc754b | 2021-09-17 15:05:06 | [diff] [blame] | 34 | |
Daniel Cheng | d287997 | 2022-09-26 09:12:20 | [diff] [blame^] | 35 | BASE_FEATURE(kPageInfoAboutThisSiteEn, |
| 36 | "PageInfoAboutThisSiteEn", |
| 37 | base::FEATURE_ENABLED_BY_DEFAULT); |
| 38 | BASE_FEATURE(kPageInfoAboutThisSiteNonEn, |
| 39 | "PageInfoAboutThisSiteNonEn", |
| 40 | base::FEATURE_DISABLED_BY_DEFAULT); |
Christian Dullweber | 329dad3 | 2022-04-20 17:45:38 | [diff] [blame] | 41 | |
| 42 | const base::FeatureParam<bool> kShowSampleContent{&kPageInfoAboutThisSiteEn, |
Christian Dullweber | 8303ced | 2022-01-28 13:53:22 | [diff] [blame] | 43 | "ShowSampleContent", false}; |
Christian Dullweber | d933ad5 | 2021-10-28 09:31:23 | [diff] [blame] | 44 | |
Daniel Cheng | d287997 | 2022-09-26 09:12:20 | [diff] [blame^] | 45 | BASE_FEATURE(kPageInfoAboutThisSiteMoreInfo, |
| 46 | "PageInfoAboutThisSiteMoreInfo", |
| 47 | base::FEATURE_DISABLED_BY_DEFAULT); |
Christian Dullweber | 88c9192f | 2022-04-21 12:33:54 | [diff] [blame] | 48 | |
Daniel Cheng | d287997 | 2022-09-26 09:12:20 | [diff] [blame^] | 49 | BASE_FEATURE(kPageInfoAboutThisSiteDescriptionPlaceholder, |
| 50 | "PageInfoAboutThisSiteDescriptionPlaceholder", |
| 51 | base::FEATURE_DISABLED_BY_DEFAULT); |
Christian Dullweber | 5949adf4 | 2022-08-11 10:00:30 | [diff] [blame] | 52 | |
Xiaohan Wang | d9e3b1f0 | 2022-01-14 14:48:35 | [diff] [blame] | 53 | #if !BUILDFLAG(IS_ANDROID) |
Daniel Cheng | d287997 | 2022-09-26 09:12:20 | [diff] [blame^] | 54 | BASE_FEATURE(kPageInfoHistoryDesktop, |
| 55 | "PageInfoHistoryDesktop", |
| 56 | base::FEATURE_DISABLED_BY_DEFAULT); |
Zofia Salata | 1f9c6ae | 2022-07-21 16:23:31 | [diff] [blame] | 57 | |
Daniel Cheng | d287997 | 2022-09-26 09:12:20 | [diff] [blame^] | 58 | BASE_FEATURE(kPageInfoHideSiteSettings, |
| 59 | "PageInfoHideSiteSettings", |
| 60 | base::FEATURE_DISABLED_BY_DEFAULT); |
Zofia Salata | 2a841f5 | 2022-07-27 10:55:10 | [diff] [blame] | 61 | |
Daniel Cheng | d287997 | 2022-09-26 09:12:20 | [diff] [blame^] | 62 | BASE_FEATURE(kPageInfoCookiesSubpage, |
| 63 | "PageInfoCookiesSubpage", |
| 64 | base::FEATURE_DISABLED_BY_DEFAULT); |
Olesia Marukhno | 4c4e812 | 2022-08-03 14:08:37 | [diff] [blame] | 65 | |
Daniel Cheng | d287997 | 2022-09-26 09:12:20 | [diff] [blame^] | 66 | BASE_FEATURE(kPageSpecificSiteDataDialog, |
| 67 | "PageSpecificSiteDataDialog", |
| 68 | base::FEATURE_DISABLED_BY_DEFAULT); |
Olesia Marukhno | 4c4e812 | 2022-08-03 14:08:37 | [diff] [blame] | 69 | |
Olesia Marukhno | 72f4747 | 2021-12-13 16:53:37 | [diff] [blame] | 70 | #endif |
| 71 | |
Olesia Marukhno | 4d09c907 | 2021-04-08 09:43:23 | [diff] [blame] | 72 | } // namespace page_info |