Ehimare Okoyomon | 2eccb607 | 2020-05-12 12:22:27 | [diff] [blame] | 1 | // Copyright 2020 The Chromium Authors. All rights reserved. |
| 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) |
Jordan Oroshiba | 244e9ff | 2021-02-04 22:20:39 | [diff] [blame] | 15 | const base::Feature kPageInfoHistory{"PageInfoHistory", |
Ehimare Okoyomon | 8bfbe777 | 2021-11-15 15:40:57 | [diff] [blame] | 16 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Zhiyuan Cai | abef340 | 2021-09-23 19:15:32 | [diff] [blame] | 17 | const base::Feature kPageInfoStoreInfo{"PageInfoStoreInfo", |
| 18 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Christian Dullweber | 2b2f02a | 2022-02-08 19:06:08 | [diff] [blame] | 19 | |
| 20 | const base::Feature kPageInfoDiscoverability{"PageInfoDiscoverability", |
| 21 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Christian Dullweber | 3f91c90c8 | 2020-09-09 10:48:26 | [diff] [blame] | 22 | #endif |
Ehimare Okoyomon | 2eccb607 | 2020-05-12 12:22:27 | [diff] [blame] | 23 | |
Christian Dullweber | 329dad3 | 2022-04-20 17:45:38 | [diff] [blame] | 24 | extern bool IsAboutThisSiteFeatureEnabled(const std::string& locale) { |
| 25 | if (l10n_util::GetLanguage(locale) == "en") { |
| 26 | return base::FeatureList::IsEnabled(kPageInfoAboutThisSiteEn); |
| 27 | } else { |
| 28 | return base::FeatureList::IsEnabled(kPageInfoAboutThisSiteNonEn); |
| 29 | } |
| 30 | } |
Olesia Marukhno | 0fc754b | 2021-09-17 15:05:06 | [diff] [blame] | 31 | |
Christian Dullweber | 329dad3 | 2022-04-20 17:45:38 | [diff] [blame] | 32 | const base::Feature kPageInfoAboutThisSiteEn{"PageInfoAboutThisSiteEn", |
| 33 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 34 | const base::Feature kPageInfoAboutThisSiteNonEn{ |
| 35 | "PageInfoAboutThisSiteNonEn", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 36 | |
| 37 | const base::FeatureParam<bool> kShowSampleContent{&kPageInfoAboutThisSiteEn, |
Christian Dullweber | 8303ced | 2022-01-28 13:53:22 | [diff] [blame] | 38 | "ShowSampleContent", false}; |
Christian Dullweber | d933ad5 | 2021-10-28 09:31:23 | [diff] [blame] | 39 | |
Christian Dullweber | 88c9192f | 2022-04-21 12:33:54 | [diff] [blame^] | 40 | const base::Feature kPageInfoAboutThisSiteUrlGranularity{ |
| 41 | "PageInfoAboutThisSiteUrlGranularity", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 42 | |
| 43 | const base::Feature kPageInfoAboutThisSiteMoreInfo{ |
| 44 | "PageInfoAboutThisSiteMoreInfo", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 45 | |
Christian Dullweber | 0897f51 | 2022-03-22 11:59:43 | [diff] [blame] | 46 | const base::Feature kAboutThisSiteBanner{"AboutThisSiteBanner", |
| 47 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 48 | |
Xiaohan Wang | d9e3b1f0 | 2022-01-14 14:48:35 | [diff] [blame] | 49 | #if !BUILDFLAG(IS_ANDROID) |
Olesia Marukhno | 72f4747 | 2021-12-13 16:53:37 | [diff] [blame] | 50 | const base::Feature kPageInfoHistoryDesktop{"PageInfoHistoryDesktop", |
| 51 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 52 | #endif |
| 53 | |
Olesia Marukhno | 4d09c907 | 2021-04-08 09:43:23 | [diff] [blame] | 54 | } // namespace page_info |