sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1 | // Copyright 2012 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 | |
| 5 | // Implementation of about_flags for iOS that sets flags based on experimental |
| 6 | // settings. |
| 7 | |
Nazerke | 9c25905 | 2019-06-26 15:30:10 | [diff] [blame] | 8 | #include "ios/chrome/browser/flags/about_flags.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 9 | |
Nazerke | 9c25905 | 2019-06-26 15:30:10 | [diff] [blame] | 10 | #import <UIKit/UIKit.h> |
avi | 57194367 | 2015-12-22 02:12:49 | [diff] [blame] | 11 | #include <stddef.h> |
| 12 | #include <stdint.h> |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 13 | |
Gregory Chatzinoff | f652372 | 2017-11-21 01:33:53 | [diff] [blame] | 14 | #include "base/base_switches.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 15 | #include "base/bind.h" |
danakj | db9ae794 | 2020-11-11 16:01:35 | [diff] [blame] | 16 | #include "base/callback_helpers.h" |
Hans Wennborg | 3a2fb61f | 2020-05-11 15:51:16 | [diff] [blame] | 17 | #include "base/check_op.h" |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 18 | #import "base/mac/foundation_util.h" |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 19 | #include "base/no_destructor.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 20 | #include "base/strings/stringprintf.h" |
| 21 | #include "base/strings/sys_string_conversions.h" |
Sebastien Marchand | 75a7cdf | 2018-11-13 23:47:03 | [diff] [blame] | 22 | #include "base/system/sys_info.h" |
Mohamad Ahmadi | c4df81f | 2017-12-20 04:41:59 | [diff] [blame] | 23 | #include "components/autofill/core/common/autofill_features.h" |
Jared Saul | d998539f | 2019-03-19 15:11:17 | [diff] [blame] | 24 | #include "components/autofill/core/common/autofill_payments_features.h" |
Moe Ahmadi | d6d5d17 | 2018-06-20 17:20:23 | [diff] [blame] | 25 | #include "components/autofill/core/common/autofill_switches.h" |
Olivier Robin | 3d6041162 | 2018-02-23 10:03:22 | [diff] [blame] | 26 | #include "components/autofill/ios/browser/autofill_switches.h" |
Jesse McKenna | 85c1a59f | 2021-05-05 19:08:30 | [diff] [blame] | 27 | #include "components/breadcrumbs/core/features.h" |
Matt Jones | 125dfb4 | 2022-02-11 17:23:42 | [diff] [blame] | 28 | #include "components/commerce/core/commerce_feature_list.h" |
| 29 | #include "components/commerce/core/flag_descriptions.h" |
Robbie Gibson | 5e343663 | 2020-04-27 15:48:04 | [diff] [blame] | 30 | #include "components/content_settings/core/common/features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 31 | #include "components/dom_distiller/core/dom_distiller_switches.h" |
Guillaume Jenkins | 4e6ac1e | 2020-11-11 16:57:40 | [diff] [blame] | 32 | #include "components/enterprise/browser/enterprise_switches.h" |
Tommy Nyquist | c1d6dea1 | 2017-07-26 20:37:23 | [diff] [blame] | 33 | #include "components/feature_engagement/public/feature_constants.h" |
| 34 | #include "components/feature_engagement/public/feature_list.h" |
edchin | d847c096 | 2021-03-03 18:17:05 | [diff] [blame] | 35 | #include "components/feed/feed_feature_list.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 36 | #include "components/flags_ui/feature_entry.h" |
| 37 | #include "components/flags_ui/feature_entry_macros.h" |
| 38 | #include "components/flags_ui/flags_storage.h" |
| 39 | #include "components/flags_ui/flags_ui_switches.h" |
Tanja Gornak | b0985dd | 2018-10-11 17:24:40 | [diff] [blame] | 40 | #include "components/invalidation/impl/invalidation_switches.h" |
noyau | 4cfb133 | 2016-10-25 17:05:42 | [diff] [blame] | 41 | #include "components/ntp_tiles/switches.h" |
Justin Donnelly | 33d712e | 2017-08-23 21:32:51 | [diff] [blame] | 42 | #include "components/omnibox/browser/omnibox_field_trial.h" |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 43 | #include "components/omnibox/common/omnibox_features.h" |
Raj T | 3898f03 | 2021-08-19 23:51:27 | [diff] [blame] | 44 | #include "components/optimization_guide/core/optimization_guide_features.h" |
Ioana Pandele | d14ce9e | 2017-11-28 14:41:46 | [diff] [blame] | 45 | #include "components/password_manager/core/common/password_manager_features.h" |
mathp | 9b4c11d | 2017-07-06 20:24:13 | [diff] [blame] | 46 | #include "components/payments/core/features.h" |
Guillaume Jenkins | eeb7007c | 2020-06-25 22:55:40 | [diff] [blame] | 47 | #import "components/policy/core/common/policy_loader_ios_constants.h" |
| 48 | #include "components/policy/policy_constants.h" |
Joemer Ramos | 3417573 | 2022-02-14 18:59:16 | [diff] [blame] | 49 | #include "components/safe_browsing/core/common/features.h" |
Victor Hugo Vianna Silva | 0399402f | 2021-09-07 21:41:25 | [diff] [blame] | 50 | #import "components/send_tab_to_self/features.h" |
Tommy Martino | 0caf336 | 2021-01-13 20:29:58 | [diff] [blame] | 51 | #include "components/shared_highlighting/core/common/shared_highlighting_features.h" |
Valeriya Sinevich | a79dc61 | 2018-09-25 14:49:09 | [diff] [blame] | 52 | #include "components/signin/core/browser/account_reconcilor.h" |
Jérôme Lebel | c374fdd | 2019-09-27 10:36:48 | [diff] [blame] | 53 | #include "components/signin/ios/browser/features.h" |
Colin Blundell | 3517170e | 2019-07-11 08:16:34 | [diff] [blame] | 54 | #include "components/signin/public/base/signin_switches.h" |
sdefresne | 3657978 | 2016-02-05 11:08:25 | [diff] [blame] | 55 | #include "components/strings/grit/components_strings.h" |
Victor Hugo Vianna Silva | a48aa01c | 2022-02-09 20:38:23 | [diff] [blame] | 56 | #include "components/sync/base/command_line_switches.h" |
| 57 | #include "components/sync/base/features.h" |
Ewann | 570a630 | 2021-08-17 07:22:42 | [diff] [blame] | 58 | #include "components/sync/base/pref_names.h" |
Moe Ahmadi | e4cce1f | 2018-12-18 23:48:01 | [diff] [blame] | 59 | #include "components/translate/core/browser/translate_prefs.h" |
Olivier Robin | ffe767c | 2022-04-21 13:13:23 | [diff] [blame] | 60 | #include "components/translate/core/common/translate_util.h" |
Sylvain Defresne | ae6987e | 2018-03-01 13:21:40 | [diff] [blame] | 61 | #include "ios/chrome/browser/browsing_data/browsing_data_features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 62 | #include "ios/chrome/browser/chrome_switches.h" |
Eugene But | 2823dc7e | 2020-07-21 18:10:37 | [diff] [blame] | 63 | #include "ios/chrome/browser/crash_report/features.h" |
Nazerke | 21bdc45a | 2019-07-11 09:02:05 | [diff] [blame] | 64 | #include "ios/chrome/browser/flags/ios_chrome_flag_descriptions.h" |
Ed Chin | 100660bf | 2022-04-26 16:59:13 | [diff] [blame^] | 65 | #import "ios/chrome/browser/ntp/features.h" |
Vincent Boisselle | d042d55 | 2022-04-09 01:22:59 | [diff] [blame] | 66 | #include "ios/chrome/browser/policy/cloud/user_policy_switch.h" |
edchin | 6869684 | 2020-04-09 17:19:31 | [diff] [blame] | 67 | #include "ios/chrome/browser/policy/policy_features.h" |
Vincent Boisselle | 19200bc | 2021-09-01 17:58:25 | [diff] [blame] | 68 | #include "ios/chrome/browser/policy/policy_util.h" |
Sylvain Defresne | 9c10708 | 2020-10-27 16:39:13 | [diff] [blame] | 69 | #include "ios/chrome/browser/screen_time/screen_time_buildflags.h" |
Olivier Robin | 3a957df | 2021-12-21 18:04:34 | [diff] [blame] | 70 | #import "ios/chrome/browser/sessions/session_features.h" |
Gauthier Ambard | 33e0330 | 2019-02-21 13:28:58 | [diff] [blame] | 71 | #include "ios/chrome/browser/system_flags.h" |
Louis Romero | ac04f786a | 2022-04-19 09:39:30 | [diff] [blame] | 72 | #include "ios/chrome/browser/ui/bubble/bubble_features.h" |
adamta | 22a4d50 | 2020-05-21 03:12:21 | [diff] [blame] | 73 | #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h" |
Javier Ernesto Flores Robles | 209b282 | 2021-03-25 19:16:50 | [diff] [blame] | 74 | #import "ios/chrome/browser/ui/default_promo/default_browser_utils.h" |
Ewann | 1a9d33d | 2021-06-14 11:12:24 | [diff] [blame] | 75 | #import "ios/chrome/browser/ui/download/features.h" |
Aliona DANGLA | ebfd7d02 | 2021-10-08 14:15:45 | [diff] [blame] | 76 | #include "ios/chrome/browser/ui/first_run/fre_field_trial.h" |
Kurt Horimoto | 4da682b02 | 2018-04-12 07:43:35 | [diff] [blame] | 77 | #import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h" |
adamta | 27356847 | 2020-12-04 23:53:57 | [diff] [blame] | 78 | #import "ios/chrome/browser/ui/ntp/new_tab_page_feature.h" |
Tina Wang | 17514e2f | 2021-09-24 23:57:18 | [diff] [blame] | 79 | #import "ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_features.h" |
Robbie Gibson | 686c5673 | 2021-10-04 17:11:45 | [diff] [blame] | 80 | #import "ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.h" |
gogerald | 0ff29e5 | 2021-02-03 18:56:19 | [diff] [blame] | 81 | #import "ios/chrome/browser/ui/start_surface/start_surface_features.h" |
Nazerke | 0bf10c4 | 2020-11-12 11:17:32 | [diff] [blame] | 82 | #import "ios/chrome/browser/ui/tab_switcher/tab_grid/features.h" |
Kurt Horimoto | 79d590b | 2018-09-12 19:09:28 | [diff] [blame] | 83 | #import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h" |
Justin Cohen | 2d81c58 | 2018-01-22 14:46:44 | [diff] [blame] | 84 | #include "ios/chrome/browser/ui/ui_feature_flags.h" |
Louis Romero | fbfbd93 | 2022-04-15 18:04:50 | [diff] [blame] | 85 | #include "ios/chrome/browser/ui/util/features.h" |
Yi Su | 392b303 | 2018-06-05 07:26:47 | [diff] [blame] | 86 | #include "ios/chrome/browser/web/features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 87 | #include "ios/chrome/grit/ios_strings.h" |
Sylvain Defresne | 559ce5f | 2022-01-13 17:14:58 | [diff] [blame] | 88 | #include "ios/public/provider/chrome/browser/app_utils/app_utils_api.h" |
Eugene But | 61818bc | 2019-04-15 21:04:07 | [diff] [blame] | 89 | #include "ios/web/common/features.h" |
Eugene But | e79f274 | 2019-07-26 17:07:22 | [diff] [blame] | 90 | #include "ios/web/common/user_agent.h" |
Eugene But | b141623 | 2019-07-22 17:31:58 | [diff] [blame] | 91 | #include "ios/web/common/web_view_creation_util.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 92 | |
Sylvain Defresne | 9c10708 | 2020-10-27 16:39:13 | [diff] [blame] | 93 | #if BUILDFLAG(IOS_SCREEN_TIME_ENABLED) |
| 94 | #include "ios/chrome/browser/screen_time/features.h" |
| 95 | #endif |
| 96 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 97 | #if !defined(OFFICIAL_BUILD) |
| 98 | #include "components/variations/variations_switches.h" |
vitaliii | 489217aa | 2017-01-30 14:50:22 | [diff] [blame] | 99 | #endif |
stkhapugin | c1be179 | 2016-12-13 14:30:53 | [diff] [blame] | 100 | |
| 101 | #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 102 | #error "This file requires ARC support." |
| 103 | #endif |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 104 | |
elawrence | 816f6790e | 2017-06-16 18:19:28 | [diff] [blame] | 105 | using flags_ui::FeatureEntry; |
| 106 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 107 | namespace { |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 108 | |
Olivier Robin | 3d6041162 | 2018-02-23 10:03:22 | [diff] [blame] | 109 | const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = { |
| 110 | {flags_ui::kGenericExperimentChoiceDefault, "", ""}, |
| 111 | {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"}, |
| 112 | {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"}, |
| 113 | {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"}, |
| 114 | {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"}, |
| 115 | {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"}, |
| 116 | {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"}, |
| 117 | {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"}, |
| 118 | {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"}, |
| 119 | }; |
| 120 | |
Nohemi Fernandez | 222d6d4 | 2020-09-30 20:35:57 | [diff] [blame] | 121 | const FeatureEntry::Choice kDelayThresholdMinutesToUpdateGaiaCookieChoices[] = { |
| 122 | {flags_ui::kGenericExperimentChoiceDefault, "", ""}, |
| 123 | {"0", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "0"}, |
| 124 | {"10", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "10"}, |
| 125 | {"60", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "60"}, |
| 126 | }; |
| 127 | |
Nohemi Fernandez | c00842a | 2021-07-26 11:47:34 | [diff] [blame] | 128 | const FeatureEntry::Choice |
| 129 | kWaitThresholdMillisecondsForCapabilitiesApiChoices[] = { |
| 130 | {flags_ui::kGenericExperimentChoiceDefault, "", ""}, |
| 131 | {"200", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "200"}, |
| 132 | {"500", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "500"}, |
| 133 | {"5000", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "5000"}, |
| 134 | }; |
| 135 | |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 136 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = { |
| 137 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}}; |
| 138 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = { |
| 139 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}}; |
| 140 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = { |
| 141 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}}; |
| 142 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = { |
| 143 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}}; |
| 144 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = { |
| 145 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}}; |
| 146 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = { |
| 147 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}}; |
| 148 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = { |
| 149 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}}; |
| 150 | |
| 151 | const FeatureEntry::FeatureVariation |
| 152 | kOmniboxUIMaxAutocompleteMatchesVariations[] = { |
| 153 | {"3 matches", kOmniboxUIMaxAutocompleteMatches3, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 154 | std::size(kOmniboxUIMaxAutocompleteMatches3), nullptr}, |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 155 | {"4 matches", kOmniboxUIMaxAutocompleteMatches4, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 156 | std::size(kOmniboxUIMaxAutocompleteMatches4), nullptr}, |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 157 | {"5 matches", kOmniboxUIMaxAutocompleteMatches5, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 158 | std::size(kOmniboxUIMaxAutocompleteMatches5), nullptr}, |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 159 | {"6 matches", kOmniboxUIMaxAutocompleteMatches6, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 160 | std::size(kOmniboxUIMaxAutocompleteMatches6), nullptr}, |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 161 | {"8 matches", kOmniboxUIMaxAutocompleteMatches8, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 162 | std::size(kOmniboxUIMaxAutocompleteMatches8), nullptr}, |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 163 | {"10 matches", kOmniboxUIMaxAutocompleteMatches10, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 164 | std::size(kOmniboxUIMaxAutocompleteMatches10), nullptr}, |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 165 | {"12 matches", kOmniboxUIMaxAutocompleteMatches12, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 166 | std::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}}; |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 167 | |
Caitlin Fischer | 37e0123 | 2019-05-24 13:05:45 | [diff] [blame] | 168 | const FeatureEntry::FeatureParam |
| 169 | kAutofillUseMobileLabelDisambiguationShowAll[] = { |
| 170 | {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName, |
| 171 | autofill::features:: |
| 172 | kAutofillUseMobileLabelDisambiguationParameterShowAll}}; |
| 173 | const FeatureEntry::FeatureParam |
| 174 | kAutofillUseMobileLabelDisambiguationShowOne[] = { |
| 175 | {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName, |
| 176 | autofill::features:: |
| 177 | kAutofillUseMobileLabelDisambiguationParameterShowOne}}; |
| 178 | |
| 179 | const FeatureEntry::FeatureVariation |
| 180 | kAutofillUseMobileLabelDisambiguationVariations[] = { |
| 181 | {"(show all)", kAutofillUseMobileLabelDisambiguationShowAll, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 182 | std::size(kAutofillUseMobileLabelDisambiguationShowAll), nullptr}, |
Caitlin Fischer | 37e0123 | 2019-05-24 13:05:45 | [diff] [blame] | 183 | {"(show one)", kAutofillUseMobileLabelDisambiguationShowOne, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 184 | std::size(kAutofillUseMobileLabelDisambiguationShowOne), nullptr}}; |
Caitlin Fischer | 37e0123 | 2019-05-24 13:05:45 | [diff] [blame] | 185 | |
Javier Ernesto Flores Robles | e85f4a1 | 2021-02-23 18:10:10 | [diff] [blame] | 186 | const FeatureEntry::FeatureParam |
Javier Ernesto Flores Robles | 15941423 | 2021-06-16 14:29:59 | [diff] [blame] | 187 | kDefaultBrowserFullscreenPromoExperimentRemindMeLater[] = { |
| 188 | {kDefaultBrowserFullscreenPromoExperimentRemindMeGroupParam, "true"}}; |
| 189 | const FeatureEntry::FeatureVariation |
| 190 | kDefaultBrowserFullscreenPromoExperimentVariations[] = { |
| 191 | {"Remind me later", |
| 192 | kDefaultBrowserFullscreenPromoExperimentRemindMeLater, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 193 | std::size(kDefaultBrowserFullscreenPromoExperimentRemindMeLater), |
Javier Ernesto Flores Robles | 15941423 | 2021-06-16 14:29:59 | [diff] [blame] | 194 | nullptr}}; |
| 195 | |
gogerald | db0d8ae | 2020-11-13 03:56:58 | [diff] [blame] | 196 | const FeatureEntry::FeatureParam kDiscoverFeedInNtpEnableNativeUI[] = { |
| 197 | {kDiscoverFeedIsNativeUIEnabled, "true"}}; |
| 198 | const FeatureEntry::FeatureVariation kDiscoverFeedInNtpVariations[] = { |
| 199 | {"Native UI", kDiscoverFeedInNtpEnableNativeUI, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 200 | std::size(kDiscoverFeedInNtpEnableNativeUI), nullptr}}; |
gogerald | db0d8ae | 2020-11-13 03:56:58 | [diff] [blame] | 201 | |
Sergio Collazos | 9fcc6ed | 2021-10-06 00:58:03 | [diff] [blame] | 202 | const FeatureEntry::FeatureParam kDiscoverFeedSRSReconstructedTemplates[] = { |
| 203 | {kDiscoverFeedSRSReconstructedTemplatesEnabled, "true"}}; |
| 204 | const FeatureEntry::FeatureParam kDiscoverFeedSRSPreloadTemplates[] = { |
| 205 | {kDiscoverFeedSRSPreloadTemplatesEnabled, "true"}}; |
| 206 | const FeatureEntry::FeatureVariation |
| 207 | kEnableDiscoverFeedStaticResourceServingVariations[] = { |
| 208 | {"Reconstruct Templates", kDiscoverFeedSRSReconstructedTemplates, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 209 | std::size(kDiscoverFeedSRSReconstructedTemplates), nullptr}, |
Sergio Collazos | 9fcc6ed | 2021-10-06 00:58:03 | [diff] [blame] | 210 | {"Preload Templates", kDiscoverFeedSRSPreloadTemplates, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 211 | std::size(kDiscoverFeedSRSPreloadTemplates), nullptr}, |
Sergio Collazos | 9fcc6ed | 2021-10-06 00:58:03 | [diff] [blame] | 212 | }; |
| 213 | |
Robbie Gibson | 4635103 | 2022-03-31 19:46:23 | [diff] [blame] | 214 | const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion1[] = { |
| 215 | {kIOSOmniboxUpdatedPopupUIVariationName, |
| 216 | kIOSOmniboxUpdatedPopupUIVariation1}}; |
| 217 | const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion2[] = { |
| 218 | {kIOSOmniboxUpdatedPopupUIVariationName, |
| 219 | kIOSOmniboxUpdatedPopupUIVariation2}}; |
| 220 | const FeatureEntry::FeatureVariation kiOSOmniboxUpdatedPopupUIVariations[] = { |
| 221 | {"Version 1", kiOSOmniboxUpdatedPopupUIVersion1, |
| 222 | std::size(kiOSOmniboxUpdatedPopupUIVersion1), nullptr}, |
| 223 | {"Version 2", kiOSOmniboxUpdatedPopupUIVersion2, |
| 224 | std::size(kiOSOmniboxUpdatedPopupUIVersion2), nullptr}}; |
| 225 | |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 226 | const FeatureEntry::FeatureParam kStartSurfaceTenSecondsShrinkLogo[] = { |
Chris Lu | 5470417c | 2021-03-03 18:43:08 | [diff] [blame] | 227 | {kStartSurfaceShrinkLogoParam, "true"}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 228 | {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}}; |
| 229 | const FeatureEntry::FeatureParam kStartSurfaceTenSecondsHideShortcuts[] = { |
Chris Lu | 5470417c | 2021-03-03 18:43:08 | [diff] [blame] | 230 | {kStartSurfaceHideShortcutsParam, "true"}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 231 | {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}}; |
| 232 | const FeatureEntry::FeatureParam kStartSurfaceTenSecondsReturnToRecentTab[] = { |
Chris Lu | 5470417c | 2021-03-03 18:43:08 | [diff] [blame] | 233 | {kStartSurfaceReturnToRecentTabParam, "true"}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 234 | {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}}; |
| 235 | const FeatureEntry::FeatureParam |
| 236 | kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab[] = { |
| 237 | {kStartSurfaceShrinkLogoParam, "true"}, |
| 238 | {kStartSurfaceReturnToRecentTabParam, "true"}, |
| 239 | {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}}; |
| 240 | const FeatureEntry::FeatureParam |
| 241 | kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab[] = { |
| 242 | {kStartSurfaceHideShortcutsParam, "true"}, |
| 243 | {kStartSurfaceReturnToRecentTabParam, "true"}, |
| 244 | {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}}; |
| 245 | const FeatureEntry::FeatureParam kStartSurfaceOneHourShrinkLogo[] = { |
Chris Lu | 5470417c | 2021-03-03 18:43:08 | [diff] [blame] | 246 | {kStartSurfaceShrinkLogoParam, "true"}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 247 | {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}}; |
| 248 | const FeatureEntry::FeatureParam kStartSurfaceOneHourHideShortcuts[] = { |
| 249 | {kStartSurfaceHideShortcutsParam, "true"}, |
| 250 | {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}}; |
| 251 | const FeatureEntry::FeatureParam kStartSurfaceOneHourReturnToRecentTab[] = { |
Chris Lu | 5470417c | 2021-03-03 18:43:08 | [diff] [blame] | 252 | {kStartSurfaceReturnToRecentTabParam, "true"}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 253 | {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}}; |
| 254 | const FeatureEntry::FeatureParam |
| 255 | kStartSurfaceOneHourShrinkLogoReturnToRecentTab[] = { |
| 256 | {kStartSurfaceShrinkLogoParam, "true"}, |
| 257 | {kStartSurfaceReturnToRecentTabParam, "true"}, |
| 258 | {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}}; |
| 259 | const FeatureEntry::FeatureParam |
| 260 | kStartSurfaceOneHourHideShortcutsReturnToRecentTab[] = { |
| 261 | {kStartSurfaceHideShortcutsParam, "true"}, |
| 262 | {kStartSurfaceReturnToRecentTabParam, "true"}, |
| 263 | {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}}; |
Chris Lu | 5470417c | 2021-03-03 18:43:08 | [diff] [blame] | 264 | |
gogerald | 0e39e3aa | 2021-02-10 18:41:23 | [diff] [blame] | 265 | const FeatureEntry::FeatureVariation kStartSurfaceVariations[] = { |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 266 | {"10s:Show Return to Recent Tab tile", |
| 267 | kStartSurfaceTenSecondsReturnToRecentTab, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 268 | std::size(kStartSurfaceTenSecondsReturnToRecentTab), nullptr}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 269 | {"10s:Shrink Logo", kStartSurfaceTenSecondsShrinkLogo, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 270 | std::size(kStartSurfaceTenSecondsShrinkLogo), nullptr}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 271 | {"10s:Hide Shortcuts", kStartSurfaceTenSecondsHideShortcuts, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 272 | std::size(kStartSurfaceTenSecondsHideShortcuts), nullptr}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 273 | {"10s:Shrink Logo and show Return to Recent Tab tile", |
| 274 | kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 275 | std::size(kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab), nullptr}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 276 | {"10s:Hide Shortcuts and show Return to Recent Tab tile", |
| 277 | kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 278 | std::size(kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab), nullptr}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 279 | {"1h:Show Return to Recent Tab tile", kStartSurfaceOneHourReturnToRecentTab, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 280 | std::size(kStartSurfaceOneHourReturnToRecentTab), nullptr}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 281 | {"1h:Shrink Logo", kStartSurfaceOneHourShrinkLogo, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 282 | std::size(kStartSurfaceOneHourShrinkLogo), nullptr}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 283 | {"1h:Hide Shortcuts", kStartSurfaceOneHourHideShortcuts, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 284 | std::size(kStartSurfaceOneHourHideShortcuts), nullptr}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 285 | {"1h:Shrink Logo and show Return to Recent Tab tile", |
| 286 | kStartSurfaceOneHourShrinkLogoReturnToRecentTab, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 287 | std::size(kStartSurfaceOneHourShrinkLogoReturnToRecentTab), nullptr}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 288 | {"1h:Hide Shortcuts and show Return to Recent Tab tile", |
| 289 | kStartSurfaceOneHourHideShortcutsReturnToRecentTab, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 290 | std::size(kStartSurfaceOneHourHideShortcutsReturnToRecentTab), nullptr}, |
Chris Lu | 5470417c | 2021-03-03 18:43:08 | [diff] [blame] | 291 | }; |
gogerald | 0e39e3aa | 2021-02-10 18:41:23 | [diff] [blame] | 292 | |
Aliona DANGLA | 8fae66f0 | 2021-10-06 15:47:11 | [diff] [blame] | 293 | const FeatureEntry::FeatureParam kFREDefaultPromoTestingDefaultDelay[] = { |
| 294 | {kFREDefaultPromoTestingDefaultDelayParam, "true"}}; |
Aliona DANGLA | ebfd7d02 | 2021-10-08 14:15:45 | [diff] [blame] | 295 | const FeatureEntry::FeatureParam kFREDefaultPromoTestingOnly[] = { |
| 296 | {kFREDefaultPromoTestingOnlyParam, "true"}}; |
Aliona DANGLA | 8fae66f0 | 2021-10-06 15:47:11 | [diff] [blame] | 297 | const FeatureEntry::FeatureParam kFREDefaultPromoTestingShortDelay[] = { |
| 298 | {kFREDefaultPromoTestingShortDelayParam, "true"}}; |
| 299 | const FeatureEntry::FeatureVariation kFREDefaultPromoTestingVariations[] = { |
| 300 | {"Wait 14 days after FRE default browser promo", |
| 301 | kFREDefaultPromoTestingDefaultDelay, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 302 | std::size(kFREDefaultPromoTestingDefaultDelay), nullptr}, |
Aliona DANGLA | ebfd7d02 | 2021-10-08 14:15:45 | [diff] [blame] | 303 | {"FRE default browser promo only", kFREDefaultPromoTestingOnly, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 304 | std::size(kFREDefaultPromoTestingOnly), nullptr}, |
Aliona DANGLA | 8fae66f0 | 2021-10-06 15:47:11 | [diff] [blame] | 305 | {"Wait 3 days after FRE default browser promo", |
| 306 | kFREDefaultPromoTestingShortDelay, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 307 | std::size(kFREDefaultPromoTestingShortDelay), nullptr}, |
Aliona DANGLA | 8fae66f0 | 2021-10-06 15:47:11 | [diff] [blame] | 308 | }; |
| 309 | |
Veronique Nguyen | 6593c76 | 2021-11-30 17:28:56 | [diff] [blame] | 310 | const FeatureEntry::FeatureVariation kEnableFREUIModuleIOSVariations[] = { |
| 311 | {"TOP | OLD", |
| 312 | (FeatureEntry::FeatureParam[]){ |
| 313 | {kFREUIIdentitySwitcherPositionParam, "top"}, |
| 314 | {kFREUIStringsSetParam, "old"}}, |
| 315 | 2, nullptr}, |
| 316 | {"BOTTOM | OLD", |
| 317 | (FeatureEntry::FeatureParam[]){ |
| 318 | {kFREUIIdentitySwitcherPositionParam, "bottom"}, |
| 319 | {kFREUIStringsSetParam, "old"}}, |
| 320 | 2, nullptr}, |
| 321 | {"TOP | NEW", |
| 322 | (FeatureEntry::FeatureParam[]){ |
| 323 | {kFREUIIdentitySwitcherPositionParam, "top"}, |
| 324 | {kFREUIStringsSetParam, "new"}}, |
| 325 | 2, nullptr}, |
| 326 | {"BOTTOM | NEW", |
| 327 | (FeatureEntry::FeatureParam[]){ |
| 328 | {kFREUIIdentitySwitcherPositionParam, "bottom"}, |
| 329 | {kFREUIStringsSetParam, "new"}}, |
| 330 | 2, nullptr}}; |
| 331 | |
jlebel | 041fc1c | 2022-03-04 12:53:30 | [diff] [blame] | 332 | const FeatureEntry::FeatureParam kNewMICEFREWithUMADialog[] = { |
| 333 | {kNewMobileIdentityConsistencyFREParam, |
| 334 | kNewMobileIdentityConsistencyFREParamUMADialog}}; |
| 335 | const FeatureEntry::FeatureParam kNewMICEFREWithThreeSteps[] = { |
| 336 | {kNewMobileIdentityConsistencyFREParam, |
| 337 | kNewMobileIdentityConsistencyFREParamThreeSteps}}; |
| 338 | const FeatureEntry::FeatureParam kNewMICEFREWithTwoSteps[] = { |
| 339 | {kNewMobileIdentityConsistencyFREParam, |
| 340 | kNewMobileIdentityConsistencyFREParamTwoSteps}}; |
| 341 | const FeatureEntry::FeatureVariation |
| 342 | kNewMobileIdentityConsistencyFREVariations[] = { |
| 343 | {"New FRE with UMA dialog", kNewMICEFREWithUMADialog, |
| 344 | std::size(kNewMICEFREWithUMADialog), nullptr}, |
| 345 | {"new FRE with 3 steps", kNewMICEFREWithThreeSteps, |
| 346 | std::size(kNewMICEFREWithThreeSteps), nullptr}, |
| 347 | {"new FRE with 2 steps", kNewMICEFREWithTwoSteps, |
| 348 | std::size(kNewMICEFREWithTwoSteps), nullptr}}; |
| 349 | |
Louis Romero | 023cc505 | 2022-04-08 23:29:39 | [diff] [blame] | 350 | const FeatureEntry::FeatureParam kBubbleRichIPHTargetHighlight[] = { |
| 351 | {kBubbleRichIPHParameterName, kBubbleRichIPHParameterTargetHighlight}}; |
Christian Xu | bd60c4b7 | 2022-03-22 15:25:01 | [diff] [blame] | 352 | const FeatureEntry::FeatureParam kBubbleRichIPHExplicitDismissal[] = { |
| 353 | {kBubbleRichIPHParameterName, kBubbleRichIPHParameterExplicitDismissal}}; |
| 354 | const FeatureEntry::FeatureParam kBubbleRichIPHRich[] = { |
| 355 | {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRich}}; |
| 356 | const FeatureEntry::FeatureParam kBubbleRichIPHRichWithSnooze[] = { |
| 357 | {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRichWithSnooze}}; |
| 358 | const FeatureEntry::FeatureVariation kBubbleRichIPHVariations[] = { |
Louis Romero | 023cc505 | 2022-04-08 23:29:39 | [diff] [blame] | 359 | {"Target Highlight", kBubbleRichIPHTargetHighlight, |
| 360 | std::size(kBubbleRichIPHTargetHighlight), nullptr}, |
Christian Xu | bd60c4b7 | 2022-03-22 15:25:01 | [diff] [blame] | 361 | {"Explicit dismissal", kBubbleRichIPHExplicitDismissal, |
| 362 | std::size(kBubbleRichIPHExplicitDismissal), nullptr}, |
| 363 | {"Dismissal and rich content", kBubbleRichIPHRich, |
| 364 | std::size(kBubbleRichIPHRich), nullptr}, |
Louis Romero | 023cc505 | 2022-04-08 23:29:39 | [diff] [blame] | 365 | {"Dismissal, rich content, and snooze", kBubbleRichIPHRichWithSnooze, |
Christian Xu | bd60c4b7 | 2022-03-22 15:25:01 | [diff] [blame] | 366 | std::size(kBubbleRichIPHRichWithSnooze), nullptr}, |
| 367 | }; |
| 368 | |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 369 | // To add a new entry, add to the end of kFeatureEntries. There are four |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 370 | // distinct types of entries: |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 371 | // . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the |
| 372 | // default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 373 | // macro for this type supplying the command line to the macro. |
| 374 | // . MULTI_VALUE: a list of choices, the first of which should correspond to a |
| 375 | // deactivated state for this lab (i.e. no command line option). To specify |
| 376 | // this type of entry use the macro MULTI_VALUE_TYPE supplying it the |
| 377 | // array of choices. |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 378 | // . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is |
| 379 | // either enabled, disabled, or uses the default value of the associated |
| 380 | // base::Feature instance. To specify this type of entry use the macro |
| 381 | // FEATURE_VALUE_TYPE supplying it the base::Feature instance. |
| 382 | // . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a |
| 383 | // base::Feature instance. Choices corresponding to the default state, a |
| 384 | // universally enabled state, and a universally disabled state are |
| 385 | // automatically included. To specify this type of entry use the macro |
| 386 | // FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and |
| 387 | // the array of choices. |
| 388 | // |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 389 | // See the documentation of FeatureEntry for details on the fields. |
| 390 | // |
| 391 | // When adding a new choice, add it to the end of the list. |
| 392 | const flags_ui::FeatureEntry kFeatureEntries[] = { |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 393 | {"in-product-help-demo-mode-choice", |
| 394 | flag_descriptions::kInProductHelpDemoModeName, |
| 395 | flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos, |
| 396 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
Tommy Nyquist | c1d6dea1 | 2017-07-26 20:37:23 | [diff] [blame] | 397 | feature_engagement::kIPHDemoMode, |
| 398 | feature_engagement::kIPHDemoModeChoiceVariations, |
Marc Treib | 2752e8b | 2017-08-04 14:12:09 | [diff] [blame] | 399 | "IPH_DemoMode")}, |
Moe Ahmadi | c3fd7cd | 2018-05-11 21:40:22 | [diff] [blame] | 400 | {"enable-autofill-credit-card-upload", |
| 401 | flag_descriptions::kAutofillCreditCardUploadName, |
| 402 | flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos, |
Anne Lim | 579b573 | 2018-08-30 18:24:24 | [diff] [blame] | 403 | FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)}, |
Tina Wang | 41d431c | 2021-06-21 21:04:13 | [diff] [blame] | 404 | {"enable-discover-feed-preview", |
| 405 | flag_descriptions::kEnableDiscoverFeedPreviewName, |
| 406 | flag_descriptions::kEnableDiscoverFeedPreviewDescription, flags_ui::kOsIos, |
| 407 | FEATURE_VALUE_TYPE(kEnableDiscoverFeedPreview)}, |
Moe Ahmadi | d6d5d17 | 2018-06-20 17:20:23 | [diff] [blame] | 408 | {"use-sync-sandbox", flag_descriptions::kSyncSandboxName, |
| 409 | flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos, |
| 410 | SINGLE_VALUE_TYPE_AND_VALUE( |
Victor Hugo Vianna Silva | 3cd7ae9 | 2022-02-09 20:49:51 | [diff] [blame] | 411 | syncer::kSyncServiceURL, |
Moe Ahmadi | d6d5d17 | 2018-06-20 17:20:23 | [diff] [blame] | 412 | "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")}, |
| 413 | {"wallet-service-use-sandbox", |
| 414 | flag_descriptions::kWalletServiceUseSandboxName, |
| 415 | flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos, |
| 416 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE( |
| 417 | autofill::switches::kWalletServiceUseSandbox, |
| 418 | "1", |
| 419 | autofill::switches::kWalletServiceUseSandbox, |
| 420 | "0")}, |
Mohamad Ahmadi | c4df81f | 2017-12-20 04:41:59 | [diff] [blame] | 421 | {"show-autofill-type-predictions", |
| 422 | flag_descriptions::kShowAutofillTypePredictionsName, |
| 423 | flag_descriptions::kShowAutofillTypePredictionsDescription, |
| 424 | flags_ui::kOsIos, |
Gauthier Ambard | cfd8518 | 2018-01-05 10:37:46 | [diff] [blame] | 425 | FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)}, |
Olivier Robin | 3d6041162 | 2018-02-23 10:03:22 | [diff] [blame] | 426 | {"autofill-ios-delay-between-fields", |
| 427 | flag_descriptions::kAutofillIOSDelayBetweenFieldsName, |
| 428 | flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription, |
| 429 | flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)}, |
Kurt Horimoto | dc33af3 | 2018-05-01 01:39:14 | [diff] [blame] | 430 | {"fullscreen-viewport-adjustment-experiment", |
Chris Lu | 481a932 | 2019-09-25 22:16:53 | [diff] [blame] | 431 | flag_descriptions::kFullscreenSmoothScrollingName, |
| 432 | flag_descriptions::kFullscreenSmoothScrollingDescription, flags_ui::kOsIos, |
| 433 | FEATURE_VALUE_TYPE(fullscreen::features::kSmoothScrollingDefault)}, |
Robbie Gibson | 1f37a5e | 2020-08-06 17:03:06 | [diff] [blame] | 434 | {"webpage-default-zoom-from-dynamic-type", |
| 435 | flag_descriptions::kWebPageDefaultZoomFromDynamicTypeName, |
| 436 | flag_descriptions::kWebPageDefaultZoomFromDynamicTypeDescription, |
| 437 | flags_ui::kOsIos, |
| 438 | FEATURE_VALUE_TYPE(web::kWebPageDefaultZoomFromDynamicType)}, |
Robbie Gibson | 88f2396 | 2020-09-28 14:35:56 | [diff] [blame] | 439 | {"webpage-alternative-text-zoom", |
| 440 | flag_descriptions::kWebPageAlternativeTextZoomName, |
| 441 | flag_descriptions::kWebPageAlternativeTextZoomDescription, |
| 442 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(web::kWebPageAlternativeTextZoom)}, |
Kurt Horimoto | 79d590b | 2018-09-12 19:09:28 | [diff] [blame] | 443 | {"toolbar-container", flag_descriptions::kToolbarContainerName, |
| 444 | flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos, |
| 445 | FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)}, |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 446 | {"omnibox-ui-max-autocomplete-matches", |
| 447 | flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName, |
| 448 | flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription, |
| 449 | flags_ui::kOsIos, |
| 450 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 451 | omnibox::kUIExperimentMaxAutocompleteMatches, |
| 452 | kOmniboxUIMaxAutocompleteMatchesVariations, |
| 453 | "OmniboxUIMaxAutocompleteVariations")}, |
Robbie Gibson | 84f1ddc | 2020-12-10 21:41:28 | [diff] [blame] | 454 | {"omnibox-local-history-zero-suggest", |
| 455 | flag_descriptions::kOmniboxLocalHistoryZeroSuggestName, |
| 456 | flag_descriptions::kOmniboxLocalHistoryZeroSuggestDescription, |
| 457 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(omnibox::kLocalHistoryZeroSuggest)}, |
Justin Cohen | 20b6f07 | 2019-01-16 01:38:50 | [diff] [blame] | 458 | #if defined(DCHECK_IS_CONFIGURABLE) |
| 459 | {"dcheck-is-fatal", flag_descriptions::kDcheckIsFatalName, |
| 460 | flag_descriptions::kDcheckIsFatalDescription, flags_ui::kOsIos, |
| 461 | FEATURE_VALUE_TYPE(base::kDCheckIsFatalFeature)}, |
| 462 | #endif // defined(DCHECK_IS_CONFIGURABLE) |
Caitlin Fischer | 43edd90a | 2019-05-01 13:24:30 | [diff] [blame] | 463 | {"autofill-use-mobile-label-disambiguation", |
| 464 | flag_descriptions::kAutofillUseMobileLabelDisambiguationName, |
| 465 | flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription, |
| 466 | flags_ui::kOsIos, |
Caitlin Fischer | 37e0123 | 2019-05-24 13:05:45 | [diff] [blame] | 467 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 468 | autofill::features::kAutofillUseMobileLabelDisambiguation, |
| 469 | kAutofillUseMobileLabelDisambiguationVariations, |
| 470 | "AutofillUseMobileLabelDisambiguation")}, |
Olivier Robin | 43814bb | 2021-06-22 15:25:45 | [diff] [blame] | 471 | {"metrickit-crash-reports", flag_descriptions::kMetrickitCrashReportName, |
| 472 | flag_descriptions::kMetrickitCrashReportDescription, flags_ui::kOsIos, |
| 473 | FEATURE_VALUE_TYPE(kMetrickitCrashReport)}, |
Mike Dougherty | b6c770d | 2019-09-13 22:56:46 | [diff] [blame] | 474 | {"ios-breadcrumbs", flag_descriptions::kLogBreadcrumbsName, |
| 475 | flag_descriptions::kLogBreadcrumbsDescription, flags_ui::kOsIos, |
Jesse McKenna | 85c1a59f | 2021-05-05 19:08:30 | [diff] [blame] | 476 | FEATURE_VALUE_TYPE(breadcrumbs::kLogBreadcrumbs)}, |
Eugene But | 2823dc7e | 2020-07-21 18:10:37 | [diff] [blame] | 477 | {"ios-synthetic-crash-reports", |
| 478 | flag_descriptions::kSyntheticCrashReportsForUteName, |
| 479 | flag_descriptions::kSyntheticCrashReportsForUteDescription, |
| 480 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSyntheticCrashReportsForUte)}, |
Jérôme Lebel | c374fdd | 2019-09-27 10:36:48 | [diff] [blame] | 481 | {"force-startup-signin-promo", |
| 482 | flag_descriptions::kForceStartupSigninPromoName, |
| 483 | flag_descriptions::kForceStartupSigninPromoDescription, flags_ui::kOsIos, |
Alice Wang | 345e0944 | 2021-07-05 09:03:29 | [diff] [blame] | 484 | FEATURE_VALUE_TYPE(switches::kForceStartupSigninPromo)}, |
Yoichi Osato | 7ae1175 | 2021-03-16 03:27:22 | [diff] [blame] | 485 | {"restore-session-from-cache", |
| 486 | flag_descriptions::kRestoreSessionFromCacheName, |
| 487 | flag_descriptions::kRestoreSessionFromCacheDescription, flags_ui::kOsIos, |
Justin Cohen | 3ec2522c | 2021-04-23 18:23:49 | [diff] [blame] | 488 | FEATURE_VALUE_TYPE(web::kRestoreSessionFromCache)}, |
sczs | 4622e6e | 2019-11-06 01:17:59 | [diff] [blame] | 489 | {"autofill-save-card-dismiss-on-navigation", |
| 490 | flag_descriptions::kAutofillSaveCardDismissOnNavigationName, |
| 491 | flag_descriptions::kAutofillSaveCardDismissOnNavigationDescription, |
| 492 | flags_ui::kOsIos, |
| 493 | FEATURE_VALUE_TYPE( |
| 494 | autofill::features::kAutofillSaveCardDismissOnNavigation)}, |
sczs | 37d9c13 | 2020-07-18 06:06:33 | [diff] [blame] | 495 | {"new-content-suggestions-feed", flag_descriptions::kDiscoverFeedInNtpName, |
adamta | 22a4d50 | 2020-05-21 03:12:21 | [diff] [blame] | 496 | flag_descriptions::kDiscoverFeedInNtpDescription, flags_ui::kOsIos, |
gogerald | db0d8ae | 2020-11-13 03:56:58 | [diff] [blame] | 497 | FEATURE_WITH_PARAMS_VALUE_TYPE(kDiscoverFeedInNtp, |
| 498 | kDiscoverFeedInNtpVariations, |
| 499 | "IOSDiscoverFeed")}, |
Roberto Moura | b87b972 | 2020-06-17 17:12:09 | [diff] [blame] | 500 | {"expanded-tab-strip", flag_descriptions::kExpandedTabStripName, |
| 501 | flag_descriptions::kExpandedTabStripDescription, flags_ui::kOsIos, |
| 502 | FEATURE_VALUE_TYPE(kExpandedTabStrip)}, |
Tommy Martino | 6b4eb7e | 2020-06-25 18:25:41 | [diff] [blame] | 503 | {"shared-highlighting-ios", flag_descriptions::kSharedHighlightingIOSName, |
| 504 | flag_descriptions::kSharedHighlightingIOSDescription, flags_ui::kOsIos, |
| 505 | FEATURE_VALUE_TYPE(kSharedHighlightingIOS)}, |
Veronique Nguyen | 6593c76 | 2021-11-30 17:28:56 | [diff] [blame] | 506 | {"enable-fre-ui-module-ios-with-options", |
| 507 | flag_descriptions::kEnableFREUIModuleIOSName, |
Tina Wang | a252ca4 | 2021-04-01 17:14:23 | [diff] [blame] | 508 | flag_descriptions::kEnableFREUIModuleIOSDescription, flags_ui::kOsIos, |
Veronique Nguyen | 6593c76 | 2021-11-30 17:28:56 | [diff] [blame] | 509 | FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFREUIModuleIOS, |
| 510 | kEnableFREUIModuleIOSVariations, |
| 511 | "EnableFREUIModuleIOS")}, |
jlebel | 041fc1c | 2022-03-04 12:53:30 | [diff] [blame] | 512 | {"new-mobile-identity-consistency-fre", |
| 513 | flag_descriptions::kNewMobileIdentityConsistencyFREName, |
| 514 | flag_descriptions::kNewMobileIdentityConsistencyFREDescription, |
| 515 | flags_ui::kOsIos, |
| 516 | FEATURE_WITH_PARAMS_VALUE_TYPE(signin::kNewMobileIdentityConsistencyFRE, |
| 517 | kNewMobileIdentityConsistencyFREVariations, |
| 518 | "NewMobileIdentityConsistencyFRE")}, |
Tina Wang | 17514e2f | 2021-09-24 23:57:18 | [diff] [blame] | 519 | {"enable-long-message-duration", |
| 520 | flag_descriptions::kEnableLongMessageDurationName, |
| 521 | flag_descriptions::kEnableLongMessageDurationDescription, flags_ui::kOsIos, |
| 522 | FEATURE_VALUE_TYPE(kEnableLongMessageDuration)}, |
Sylvain Defresne | 9c10708 | 2020-10-27 16:39:13 | [diff] [blame] | 523 | #if BUILDFLAG(IOS_SCREEN_TIME_ENABLED) |
edchin | 81467b8 | 2020-09-03 19:31:45 | [diff] [blame] | 524 | {"screen-time-integration-ios", |
| 525 | flag_descriptions::kScreenTimeIntegrationName, |
| 526 | flag_descriptions::kScreenTimeIntegrationDescription, flags_ui::kOsIos, |
| 527 | FEATURE_VALUE_TYPE(kScreenTimeIntegration)}, |
Sylvain Defresne | 9c10708 | 2020-10-27 16:39:13 | [diff] [blame] | 528 | #endif |
Nazerke | 3e993f7 | 2020-09-21 13:00:06 | [diff] [blame] | 529 | {"modern-tab-strip", flag_descriptions::kModernTabStripName, |
| 530 | flag_descriptions::kModernTabStripDescription, flags_ui::kOsIos, |
| 531 | FEATURE_VALUE_TYPE(kModernTabStrip)}, |
Nohemi Fernandez | 222d6d4 | 2020-09-30 20:35:57 | [diff] [blame] | 532 | {"minutes-delay-to-restore-gaia-cookies-if-deleted", |
| 533 | flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieName, |
| 534 | flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieDescription, |
| 535 | flags_ui::kOsIos, |
| 536 | MULTI_VALUE_TYPE(kDelayThresholdMinutesToUpdateGaiaCookieChoices)}, |
Vidhan Jain | b4de5c5 | 2021-08-30 17:08:02 | [diff] [blame] | 537 | {"add-passwords-in-settings", |
| 538 | flag_descriptions::kAddPasswordsInSettingsName, |
| 539 | flag_descriptions::kAddPasswordsInSettingsDescription, flags_ui::kOsIos, |
| 540 | FEATURE_VALUE_TYPE( |
| 541 | password_manager::features::kSupportForAddPasswordsInSettings)}, |
Eugene But | f869bff | 2020-12-10 01:16:55 | [diff] [blame] | 542 | {"record-snapshot-size", flag_descriptions::kRecordSnapshotSizeName, |
| 543 | flag_descriptions::kRecordSnapshotSizeDescription, flags_ui::kOsIos, |
| 544 | FEATURE_VALUE_TYPE(web::features::kRecordSnapshotSize)}, |
Chris Lu | b17195f | 2020-12-10 20:49:14 | [diff] [blame] | 545 | {"default-browser-fullscreen-promo-experiment", |
| 546 | flag_descriptions::kDefaultBrowserFullscreenPromoExperimentName, |
| 547 | flag_descriptions::kDefaultBrowserFullscreenPromoExperimentDescription, |
| 548 | flags_ui::kOsIos, |
Javier Ernesto Flores Robles | 15941423 | 2021-06-16 14:29:59 | [diff] [blame] | 549 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 550 | kDefaultBrowserFullscreenPromoExperiment, |
| 551 | kDefaultBrowserFullscreenPromoExperimentVariations, |
| 552 | "IOSDefaultBrowserFullscreenPromoExperiment")}, |
Cheick Cisse | 76ade3d | 2020-12-16 00:15:11 | [diff] [blame] | 553 | {"ios-shared-highlighting-color-change", |
| 554 | flag_descriptions::kIOSSharedHighlightingColorChangeName, |
| 555 | flag_descriptions::kIOSSharedHighlightingColorChangeDescription, |
Cheick Cisse | d0b5bfe | 2021-02-11 14:23:07 | [diff] [blame] | 556 | flags_ui::kOsIos, |
| 557 | FEATURE_VALUE_TYPE(web::features::kIOSSharedHighlightingColorChange)}, |
Cheick Cisse | fe99486 | 2021-12-15 16:01:34 | [diff] [blame] | 558 | {"ios-shared-highlighting-v2", |
| 559 | flag_descriptions::kIOSSharedHighlightingV2Name, |
| 560 | flag_descriptions::kIOSSharedHighlightingV2Description, flags_ui::kOsIos, |
| 561 | FEATURE_VALUE_TYPE(shared_highlighting::kIOSSharedHighlightingV2)}, |
Stepan Khapugin | 0434120 | 2021-01-07 12:22:45 | [diff] [blame] | 562 | {"omnibox-new-textfield-implementation", |
| 563 | flag_descriptions::kOmniboxNewImplementationName, |
| 564 | flag_descriptions::kOmniboxNewImplementationDescription, flags_ui::kOsIos, |
| 565 | FEATURE_VALUE_TYPE(kIOSNewOmniboxImplementation)}, |
Stepan Khapugin | 422f08d | 2022-02-18 16:19:44 | [diff] [blame] | 566 | {"omnibox-new-popup-ui", flag_descriptions::kIOSOmniboxUpdatedPopupUIName, |
| 567 | flag_descriptions::kIOSOmniboxUpdatedPopupUIDescription, flags_ui::kOsIos, |
Robbie Gibson | 4635103 | 2022-03-31 19:46:23 | [diff] [blame] | 568 | FEATURE_WITH_PARAMS_VALUE_TYPE(kIOSOmniboxUpdatedPopupUI, |
| 569 | kiOSOmniboxUpdatedPopupUIVariations, |
| 570 | "kIOSOmniboxUpdatedPopupUI")}, |
gogerald | 0ff29e5 | 2021-02-03 18:56:19 | [diff] [blame] | 571 | {"start-surface", flag_descriptions::kStartSurfaceName, |
| 572 | flag_descriptions::kStartSurfaceDescription, flags_ui::kOsIos, |
gogerald | 0e39e3aa | 2021-02-10 18:41:23 | [diff] [blame] | 573 | FEATURE_WITH_PARAMS_VALUE_TYPE(kStartSurface, |
| 574 | kStartSurfaceVariations, |
| 575 | "StartSurface")}, |
Justin Cohen | 13ac7a20 | 2021-02-04 18:27:28 | [diff] [blame] | 576 | {"ios-crashpad", flag_descriptions::kCrashpadIOSName, |
| 577 | flag_descriptions::kCrashpadIOSDescription, flags_ui::kOsIos, |
| 578 | FEATURE_VALUE_TYPE(kCrashpadIOS)}, |
Maria Kazinova | b69b75d | 2021-02-16 00:09:37 | [diff] [blame] | 579 | {"detect-form-submission-on-form-clear", |
| 580 | flag_descriptions::kDetectFormSubmissionOnFormClearIOSName, |
| 581 | flag_descriptions::kDetectFormSubmissionOnFormClearIOSDescription, |
| 582 | flags_ui::kOsIos, |
| 583 | FEATURE_VALUE_TYPE( |
| 584 | password_manager::features::kDetectFormSubmissionOnFormClear)}, |
Vidhan Jain | 451b475 | 2021-07-15 10:16:42 | [diff] [blame] | 585 | {"autofill-address-verification-in-save-prompt", |
| 586 | flag_descriptions::kEnableAutofillAddressSavePromptAddressVerificationName, |
| 587 | flag_descriptions:: |
| 588 | kEnableAutofillAddressSavePromptAddressVerificationDescription, |
| 589 | flags_ui::kOsIos, |
| 590 | FEATURE_VALUE_TYPE( |
| 591 | autofill::features:: |
| 592 | kAutofillAddressProfileSavePromptAddressVerificationSupport)}, |
Vidhan Jain | a6574155 | 2021-03-09 17:18:27 | [diff] [blame] | 593 | {"autofill-address-save-prompt", |
| 594 | flag_descriptions::kEnableAutofillAddressSavePromptName, |
| 595 | flag_descriptions::kEnableAutofillAddressSavePromptDescription, |
| 596 | flags_ui::kOsIos, |
| 597 | FEATURE_VALUE_TYPE(autofill::features::kAutofillAddressProfileSavePrompt)}, |
Viktor Semeniuk | 68e794a | 2021-03-24 10:23:25 | [diff] [blame] | 598 | {"filling-across-affiliated-websites", |
| 599 | flag_descriptions::kFillingAcrossAffiliatedWebsitesName, |
| 600 | flag_descriptions::kFillingAcrossAffiliatedWebsitesDescription, |
| 601 | flags_ui::kOsIos, |
| 602 | FEATURE_VALUE_TYPE( |
| 603 | password_manager::features::kFillingAcrossAffiliatedWebsites)}, |
Jared Saul | d47c2b7 | 2021-03-25 22:47:31 | [diff] [blame] | 604 | {"autofill-parse-merchant-promo-code-fields", |
| 605 | flag_descriptions::kAutofillParseMerchantPromoCodeFieldsName, |
| 606 | flag_descriptions::kAutofillParseMerchantPromoCodeFieldsDescription, |
| 607 | flags_ui::kOsIos, |
| 608 | FEATURE_VALUE_TYPE( |
| 609 | autofill::features::kAutofillParseMerchantPromoCodeFields)}, |
edchin | 257cea2f | 2021-04-07 13:07:13 | [diff] [blame] | 610 | {"interest-feed-v2-clicks-and-views-cond-upload", |
| 611 | flag_descriptions::kInterestFeedV2ClickAndViewActionsConditionalUploadName, |
| 612 | flag_descriptions:: |
| 613 | kInterestFeedV2ClickAndViewActionsConditionalUploadDescription, |
| 614 | flags_ui::kOsIos, |
| 615 | FEATURE_VALUE_TYPE(feed::kInterestFeedV2ClicksAndViewsConditionalUpload)}, |
Mohammad Refaat | 76b14f54 | 2021-10-27 14:46:55 | [diff] [blame] | 616 | {"tabs-search-ios", flag_descriptions::kTabsSearchName, |
| 617 | flag_descriptions::kTabsSearchDescription, flags_ui::kOsIos, |
| 618 | FEATURE_VALUE_TYPE(kTabsSearch)}, |
Mohammad Refaat | 9541008 | 2022-02-23 02:01:02 | [diff] [blame] | 619 | {"tabs-search-regular-results-suggested-actions-ios", |
| 620 | flag_descriptions::kTabsSearchRegularResultsSuggestedActionsName, |
| 621 | flag_descriptions::kTabsSearchRegularResultsSuggestedActionsDescription, |
| 622 | flags_ui::kOsIos, |
| 623 | FEATURE_VALUE_TYPE(kTabsSearchRegularResultsSuggestedActions)}, |
Side Yilmaz | 0e6c15a | 2021-04-26 12:55:09 | [diff] [blame] | 624 | {"incognito-brand-consistency-for-ios", |
| 625 | flag_descriptions::kIncognitoBrandConsistencyForIOSName, |
| 626 | flag_descriptions::kIncognitoBrandConsistencyForIOSDescription, |
| 627 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kIncognitoBrandConsistencyForIOS)}, |
Side Yilmaz | 6c53f710 | 2021-09-07 13:26:19 | [diff] [blame] | 628 | {"incognito-ntp-revamp", flag_descriptions::kIncognitoNtpRevampName, |
| 629 | flag_descriptions::kIncognitoNtpRevampDescription, flags_ui::kOsIos, |
| 630 | FEATURE_VALUE_TYPE(kIncognitoNtpRevamp)}, |
Side YILMAZ | 4b40a308 | 2022-04-11 10:13:33 | [diff] [blame] | 631 | {"update-history-entry-points-in-incognito", |
| 632 | flag_descriptions::kUpdateHistoryEntryPointsInIncognitoName, |
| 633 | flag_descriptions::kUpdateHistoryEntryPointsInIncognitoDescription, |
| 634 | flags_ui::kOsIos, |
| 635 | FEATURE_VALUE_TYPE(kUpdateHistoryEntryPointsInIncognito)}, |
jlebel | d95434d65 | 2021-06-22 10:32:48 | [diff] [blame] | 636 | {"sync-trusted-vault-passphrase-ios-rpc", |
| 637 | flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCName, |
| 638 | flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCDescription, |
| 639 | flags_ui::kOsIos, |
Victor Hugo Vianna Silva | 3cd7ae9 | 2022-02-09 20:49:51 | [diff] [blame] | 640 | FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseiOSRPC)}, |
Mikel Astiz | 850b0fe | 2021-06-16 09:47:27 | [diff] [blame] | 641 | {"sync-trusted-vault-passphrase-promo", |
| 642 | flag_descriptions::kSyncTrustedVaultPassphrasePromoName, |
| 643 | flag_descriptions::kSyncTrustedVaultPassphrasePromoDescription, |
| 644 | flags_ui::kOsIos, |
Victor Hugo Vianna Silva | 3cd7ae9 | 2022-02-09 20:49:51 | [diff] [blame] | 645 | FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphrasePromo)}, |
Mikel Astiz | 850b0fe | 2021-06-16 09:47:27 | [diff] [blame] | 646 | {"sync-trusted-vault-passphrase-recovery", |
| 647 | flag_descriptions::kSyncTrustedVaultPassphraseRecoveryName, |
| 648 | flag_descriptions::kSyncTrustedVaultPassphraseRecoveryDescription, |
| 649 | flags_ui::kOsIos, |
Victor Hugo Vianna Silva | 3cd7ae9 | 2022-02-09 20:49:51 | [diff] [blame] | 650 | FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseRecovery)}, |
Nohemi Fernandez | c00842a | 2021-07-26 11:47:34 | [diff] [blame] | 651 | {"wait-threshold-seconds-for-capabilities-api", |
| 652 | flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiName, |
| 653 | flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiDescription, |
| 654 | flags_ui::kOsIos, |
| 655 | MULTI_VALUE_TYPE(kWaitThresholdMillisecondsForCapabilitiesApiChoices)}, |
Jared Saul | 2188f76 | 2021-08-02 21:22:23 | [diff] [blame] | 656 | {"autofill-fill-merchant-promo-code-fields", |
| 657 | flag_descriptions::kAutofillFillMerchantPromoCodeFieldsName, |
| 658 | flag_descriptions::kAutofillFillMerchantPromoCodeFieldsDescription, |
| 659 | flags_ui::kOsIos, |
| 660 | FEATURE_VALUE_TYPE( |
| 661 | autofill::features::kAutofillFillMerchantPromoCodeFields)}, |
Gauthier Ambard | 14d3a26 | 2021-08-09 18:09:23 | [diff] [blame] | 662 | {"context-menu-phase2", |
| 663 | flag_descriptions::kWebViewNativeContextMenuPhase2Name, |
| 664 | flag_descriptions::kWebViewNativeContextMenuPhase2Description, |
| 665 | flags_ui::kOsIos, |
| 666 | FEATURE_VALUE_TYPE(web::features::kWebViewNativeContextMenuPhase2)}, |
Gauthier Ambard | 14d3a26 | 2021-08-09 18:09:23 | [diff] [blame] | 667 | {"default-wkwebview-context-menu", |
| 668 | flag_descriptions::kDefaultWebViewContextMenuName, |
| 669 | flag_descriptions::kDefaultWebViewContextMenuDescription, flags_ui::kOsIos, |
| 670 | FEATURE_VALUE_TYPE(web::features::kDefaultWebViewContextMenu)}, |
Sylvain Defresne | dff67e4 | 2021-09-24 09:43:03 | [diff] [blame] | 671 | {"new-overflow-menu", flag_descriptions::kNewOverflowMenuName, |
| 672 | flag_descriptions::kNewOverflowMenuDescription, flags_ui::kOsIos, |
| 673 | FEATURE_VALUE_TYPE(kNewOverflowMenu)}, |
| 674 | {"enable-new-download-api", flag_descriptions::kEnableNewDownloadAPIName, |
| 675 | flag_descriptions::kEnableNewDownloadAPIDescription, flags_ui::kOsIos, |
| 676 | FEATURE_VALUE_TYPE(web::features::kEnableNewDownloadAPI)}, |
Evan Bernstein | 0a85f33 | 2021-09-29 19:07:24 | [diff] [blame] | 677 | {"use-lens-to-search-for-image", |
| 678 | flag_descriptions::kUseLensToSearchForImageName, |
| 679 | flag_descriptions::kUseLensToSearchForImageDescription, flags_ui::kOsIos, |
Ali Juma | 02a9b7b | 2021-10-01 13:44:44 | [diff] [blame] | 680 | FEATURE_VALUE_TYPE(kUseLensToSearchForImage)}, |
Benjamin Williams | bee6ab6 | 2022-02-28 18:09:40 | [diff] [blame] | 681 | {"use-load-simulated-request-for-error-page-navigation", |
| 682 | flag_descriptions::kUseLoadSimulatedRequestForErrorPageNavigationName, |
| 683 | flag_descriptions:: |
| 684 | kUseLoadSimulatedRequestForErrorPageNavigationDescription, |
| 685 | flags_ui::kOsIos, |
| 686 | FEATURE_VALUE_TYPE( |
| 687 | web::features::kUseLoadSimulatedRequestForErrorPageNavigation)}, |
Sergio Collazos | 9fcc6ed | 2021-10-06 00:58:03 | [diff] [blame] | 688 | {"enable-discover-feed-static-resource-serving", |
| 689 | flag_descriptions::kEnableDiscoverFeedStaticResourceServingName, |
| 690 | flag_descriptions::kEnableDiscoverFeedStaticResourceServingDescription, |
| 691 | flags_ui::kOsIos, |
| 692 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 693 | kEnableDiscoverFeedStaticResourceServing, |
| 694 | kEnableDiscoverFeedStaticResourceServingVariations, |
| 695 | "IOSDiscoverFeedStaticResourceServing")}, |
| 696 | {"enable-disco-feed-endpoint", |
| 697 | flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointName, |
| 698 | flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointDescription, |
| 699 | flags_ui::kOsIos, |
Aliona DANGLA | 8fae66f0 | 2021-10-06 15:47:11 | [diff] [blame] | 700 | FEATURE_VALUE_TYPE(kEnableDiscoverFeedDiscoFeedEndpoint)}, |
| 701 | {"enable-fre-default-browser-screen-testing", |
| 702 | flag_descriptions::kEnableFREDefaultBrowserScreenTestingName, |
| 703 | flag_descriptions::kEnableFREDefaultBrowserScreenTestingDescription, |
| 704 | flags_ui::kOsIos, |
| 705 | FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFREDefaultBrowserScreenTesting, |
| 706 | kFREDefaultPromoTestingVariations, |
ginny huang | 5ba43b8 | 2021-10-06 18:28:18 | [diff] [blame] | 707 | "EnableFREDefaultBrowserScreenTesting")}, |
edchin | 1313f2b | 2021-10-11 08:08:47 | [diff] [blame] | 708 | {"enable-discover-feed-shorter-cache", |
| 709 | flag_descriptions::kEnableDiscoverFeedShorterCacheName, |
| 710 | flag_descriptions::kEnableDiscoverFeedShorterCacheDescription, |
| 711 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableDiscoverFeedShorterCache)}, |
Tommy Martino | 7393d76 | 2021-10-12 17:59:28 | [diff] [blame] | 712 | {"shared-highlighting-amp", |
| 713 | flag_descriptions::kIOSSharedHighlightingAmpName, |
| 714 | flag_descriptions::kIOSSharedHighlightingAmpDescription, flags_ui::kOsIos, |
| 715 | FEATURE_VALUE_TYPE(shared_highlighting::kSharedHighlightingAmp)}, |
David Maunder | f4a5e1e | 2021-10-18 17:24:28 | [diff] [blame] | 716 | {"enable-commerce-price-tracking", |
Matt Jones | 125dfb4 | 2022-02-11 17:23:42 | [diff] [blame] | 717 | commerce::flag_descriptions::kCommercePriceTrackingName, |
| 718 | commerce::flag_descriptions::kCommercePriceTrackingDescription, |
| 719 | flags_ui::kOsIos, |
| 720 | FEATURE_WITH_PARAMS_VALUE_TYPE(commerce::kCommercePriceTracking, |
| 721 | commerce::kCommercePriceTrackingVariations, |
adamta | 67b6c581 | 2021-10-19 17:02:15 | [diff] [blame] | 722 | "CommercePriceTracking")}, |
Tina Wang | 8058d5f | 2021-11-04 20:06:06 | [diff] [blame] | 723 | {"web-feed-ios", flag_descriptions::kEnableWebChannelsName, |
| 724 | flag_descriptions::kEnableWebChannelsDescription, flags_ui::kOsIos, |
| 725 | FEATURE_VALUE_TYPE(kEnableWebChannels)}, |
adamta | 3933159 | 2021-11-01 20:18:54 | [diff] [blame] | 726 | {"ntp-view-hierarchy-repair", |
| 727 | flag_descriptions::kNTPViewHierarchyRepairName, |
| 728 | flag_descriptions::kNTPViewHierarchyRepairDescription, flags_ui::kOsIos, |
| 729 | FEATURE_VALUE_TYPE(kNTPViewHierarchyRepair)}, |
Chris Lu | 37588a9 | 2021-11-02 21:19:45 | [diff] [blame] | 730 | {"single-ntp", flag_descriptions::kSingleNtpName, |
| 731 | flag_descriptions::kSingleNtpDescription, flags_ui::kOsIos, |
| 732 | FEATURE_VALUE_TYPE(kSingleNtp)}, |
Justin Cohen | 69cec68 | 2021-11-04 20:10:26 | [diff] [blame] | 733 | {"synthesized-restore-session", |
| 734 | flag_descriptions::kSynthesizedRestoreSessionName, |
| 735 | flag_descriptions::kSynthesizedRestoreSessionDescription, flags_ui::kOsIos, |
| 736 | FEATURE_VALUE_TYPE(web::features::kSynthesizedRestoreSession)}, |
Chris Lu | 4723b82 | 2021-11-05 21:47:44 | [diff] [blame] | 737 | {"remove-extra-ntps", flag_descriptions::kRemoveExcessNTPsExperimentName, |
| 738 | flag_descriptions::kRemoveExcessNTPsExperimentDescription, |
Sylvain Defresne | 1619dd00 | 2021-11-06 10:09:48 | [diff] [blame] | 739 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kRemoveExcessNTPs)}, |
| 740 | {"lazily-create-web-state-on-restoration", |
| 741 | flag_descriptions::kLazilyCreateWebStateOnRestorationName, |
| 742 | flag_descriptions::kLazilyCreateWebStateOnRestorationDescription, |
| 743 | flags_ui::kOsIos, |
| 744 | FEATURE_VALUE_TYPE(web::features::kEnableUnrealizedWebStates)}, |
ginny huang | 1f1755c | 2021-11-11 23:38:23 | [diff] [blame] | 745 | {"enable-shortened-password-auto-fill-instruction", |
| 746 | flag_descriptions::kEnableShortenedPasswordAutoFillInstructionName, |
| 747 | flag_descriptions::kEnableShortenedPasswordAutoFillInstructionDescription, |
| 748 | flags_ui::kOsIos, |
| 749 | FEATURE_VALUE_TYPE(kEnableShortenedPasswordAutoFillInstruction)}, |
Benjamin Williams | 0e7e2fb | 2021-11-17 03:03:41 | [diff] [blame] | 750 | {"enable-password-manager-branding-update", |
| 751 | flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateName, |
| 752 | flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateDescription, |
| 753 | flags_ui::kOsIos, |
Aliona DANGLA | e5b0b6e5 | 2021-11-30 11:58:19 | [diff] [blame] | 754 | FEATURE_VALUE_TYPE( |
| 755 | password_manager::features::kIOSEnablePasswordManagerBrandingUpdate)}, |
Gauthier Ambard | 1d326e2 | 2021-12-16 10:57:53 | [diff] [blame] | 756 | {"default-mode-ua", flag_descriptions::kAddSettingForDefaultPageModeName, |
| 757 | flag_descriptions::kAddSettingForDefaultPageModeDescription, |
| 758 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kAddSettingForDefaultPageMode)}, |
ginnnnnnny | 1532d87 | 2021-12-20 15:57:37 | [diff] [blame] | 759 | {"ios-media-permissions-control", |
| 760 | flag_descriptions::kMediaPermissionsControlName, |
| 761 | flag_descriptions::kMediaPermissionsControlDescription, flags_ui::kOsIos, |
| 762 | FEATURE_VALUE_TYPE(web::features::kMediaPermissionsControl)}, |
Olivier Robin | 3a957df | 2021-12-21 18:04:34 | [diff] [blame] | 763 | {"enable-save-session-tabs-in-separate-files", |
| 764 | flag_descriptions::kSaveSessionTabsToSeparateFilesName, |
| 765 | flag_descriptions::kSaveSessionTabsToSeparateFilesDescription, |
| 766 | flags_ui::kOsIos, |
| 767 | FEATURE_VALUE_TYPE(sessions::kSaveSessionTabsToSeparateFiles)}, |
Gauthier Ambard | 42ad0bb | 2021-12-22 16:50:48 | [diff] [blame] | 768 | {"use-sf-symbols-samples", flag_descriptions::kUseSFSymbolsSamplesName, |
| 769 | flag_descriptions::kUseSFSymbolsSamplesDescription, flags_ui::kOsIos, |
| 770 | FEATURE_VALUE_TYPE(kUseSFSymbolsSamples)}, |
Gauthier Ambard | fa18254 | 2022-01-07 08:27:50 | [diff] [blame] | 771 | {"use-new-popup-menu", flag_descriptions::kUseUIKitPopupMenuName, |
| 772 | flag_descriptions::kUseUIKitPopupMenuDescription, flags_ui::kOsIos, |
| 773 | FEATURE_VALUE_TYPE(kUseUIKitPopupMenu)}, |
Nohemi Fernandez | 76f5480 | 2022-01-10 18:23:32 | [diff] [blame] | 774 | {"enable-unicorn-account-support", |
| 775 | flag_descriptions::kEnableUnicornAccountSupportName, |
| 776 | flag_descriptions::kEnableUnicornAccountSupportDescription, |
| 777 | flags_ui::kOsIos, |
| 778 | FEATURE_VALUE_TYPE(signin::kEnableUnicornAccountSupport)}, |
Chris Lu | 411bea8 | 2022-01-12 18:19:22 | [diff] [blame] | 779 | {"single-cell-content-suggestions", |
| 780 | flag_descriptions::kSingleCellContentSuggestionsName, |
| 781 | flag_descriptions::kSingleCellContentSuggestionsDescription, |
| 782 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSingleCellContentSuggestions)}, |
Chris Lu | e521105 | 2022-02-02 20:44:04 | [diff] [blame] | 783 | {"content-suggestions-header-migration", |
| 784 | flag_descriptions::kContentSuggestionsHeaderMigrationName, |
| 785 | flag_descriptions::kContentSuggestionsHeaderMigrationDescription, |
| 786 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kContentSuggestionsHeaderMigration)}, |
rgod | 90cca8b | 2022-02-04 12:38:27 | [diff] [blame] | 787 | {"leak-detection-unauthenticated", |
| 788 | flag_descriptions::kLeakDetectionUnauthenticatedName, |
| 789 | flag_descriptions::kLeakDetectionUnauthenticatedDescription, |
| 790 | flags_ui::kOsIos, |
| 791 | FEATURE_VALUE_TYPE( |
| 792 | password_manager::features::kLeakDetectionUnauthenticated)}, |
Veronique Nguyen | fc9824b | 2022-02-10 17:12:53 | [diff] [blame] | 793 | {"mute-compromised-passwords", |
| 794 | flag_descriptions::kMuteCompromisedPasswordsName, |
| 795 | flag_descriptions::kMuteCompromisedPasswordsDescription, flags_ui::kOsIos, |
| 796 | FEATURE_VALUE_TYPE(password_manager::features::kMuteCompromisedPasswords)}, |
Veronique Nguyen | 00ba26ea | 2022-02-25 14:57:17 | [diff] [blame] | 797 | {"enable-favicon-passwords", |
| 798 | flag_descriptions::kEnableFaviconForPasswordsName, |
| 799 | flag_descriptions::kEnableFaviconForPasswordsDescription, flags_ui::kOsIos, |
| 800 | FEATURE_VALUE_TYPE( |
| 801 | password_manager::features::kEnableFaviconForPasswords)}, |
Shivani Chauhan | bf97b0d | 2022-02-08 22:21:28 | [diff] [blame] | 802 | {"autofill-enable-sending-bcn-in-get-upload-details", |
| 803 | flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsName, |
| 804 | flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsDescription, |
| 805 | flags_ui::kOsIos, |
| 806 | FEATURE_VALUE_TYPE( |
| 807 | autofill::features::kAutofillEnableSendingBcnInGetUploadDetails)}, |
Ali Juma | 1429cf8a | 2022-02-09 15:31:01 | [diff] [blame] | 808 | {"enable-fullscreen-api", flag_descriptions::kEnableFullscreenAPIName, |
| 809 | flag_descriptions::kEnableFullscreenAPIDescription, flags_ui::kOsIos, |
| 810 | FEATURE_VALUE_TYPE(web::features::kEnableFullscreenAPI)}, |
Joemer Ramos | 3417573 | 2022-02-14 18:59:16 | [diff] [blame] | 811 | {"enable-enhanced-safe-browsing", |
| 812 | flag_descriptions::kEnhancedProtectionName, |
| 813 | flag_descriptions::kEnhancedProtectionDescription, flags_ui::kOsIos, |
| 814 | FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtection)}, |
Christian Xu | 612e285 | 2022-02-10 17:27:42 | [diff] [blame] | 815 | {"context-menu-phase2-screenshot", |
| 816 | flag_descriptions::kWebViewNativeContextMenuPhase2ScreenshotName, |
| 817 | flag_descriptions::kWebViewNativeContextMenuPhase2ScreenshotDescription, |
| 818 | flags_ui::kOsIos, |
| 819 | FEATURE_VALUE_TYPE( |
| 820 | web::features::kWebViewNativeContextMenuPhase2Screenshot)}, |
Shivani Chauhan | af1eb74d | 2022-02-11 21:13:19 | [diff] [blame] | 821 | {"autofill-enable-unmask-card-request-set-instrument-id", |
| 822 | flag_descriptions::kAutofillEnableUnmaskCardRequestSetInstrumentIdName, |
| 823 | flag_descriptions:: |
| 824 | kAutofillEnableUnmaskCardRequestSetInstrumentIdDescription, |
| 825 | flags_ui::kOsIos, |
| 826 | FEATURE_VALUE_TYPE( |
| 827 | autofill::features::kAutofillEnableUnmaskCardRequestSetInstrumentId)}, |
Victor Hugo Vianna Silva | f0a4400 | 2022-02-16 10:38:00 | [diff] [blame] | 828 | {"send-tab-to-self-signin-promo", |
| 829 | flag_descriptions::kSendTabToSelfSigninPromoName, |
| 830 | flag_descriptions::kSendTabToSelfSigninPromoDescription, flags_ui::kOsIos, |
| 831 | FEATURE_VALUE_TYPE(send_tab_to_self::kSendTabToSelfSigninPromo)}, |
Chris Lu | 7f560f7 | 2022-03-01 18:19:01 | [diff] [blame] | 832 | {"content-suggestions-uiviewcontroller-migration", |
| 833 | flag_descriptions::kContentSuggestionsUIViewControllerMigrationName, |
| 834 | flag_descriptions::kContentSuggestionsUIViewControllerMigrationDescription, |
| 835 | flags_ui::kOsIos, |
| 836 | FEATURE_VALUE_TYPE(kContentSuggestionsUIViewControllerMigration)}, |
Christian Xu | bd60c4b7 | 2022-03-22 15:25:01 | [diff] [blame] | 837 | {"bubble-rich-iph", flag_descriptions::kBubbleRichIPHName, |
| 838 | flag_descriptions::kBubbleRichIPHDescription, flags_ui::kOsIos, |
| 839 | FEATURE_WITH_PARAMS_VALUE_TYPE(kBubbleRichIPH, |
| 840 | kBubbleRichIPHVariations, |
| 841 | "BubbleRichIPH")}, |
Siyu An | ff02e74 | 2022-04-07 19:08:22 | [diff] [blame] | 842 | {"autofill-enforce-delays-in-strike-database", |
| 843 | flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseName, |
| 844 | flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseDescription, |
| 845 | flags_ui::kOsIos, |
| 846 | FEATURE_VALUE_TYPE( |
| 847 | autofill::features::kAutofillEnforceDelaysInStrikeDatabase)}, |
Ewann | 4f26056 | 2022-04-11 13:37:19 | [diff] [blame] | 848 | {"download-calendar", flag_descriptions::kDownloadCalendarName, |
| 849 | flag_descriptions::kDownloadCalendarDescription, flags_ui::kOsIos, |
| 850 | FEATURE_VALUE_TYPE(kDownloadCalendar)}, |
Louis Romero | fbfbd93 | 2022-04-15 18:04:50 | [diff] [blame] | 851 | {"uiview-window-observing", flag_descriptions::kUIViewWindowObservingName, |
| 852 | flag_descriptions::kUIViewWindowObservingDescription, flags_ui::kOsIos, |
| 853 | FEATURE_VALUE_TYPE(kUIViewWindowObserving)}, |
Jared Saul | b0473bd | 2022-04-20 00:03:41 | [diff] [blame] | 854 | {"autofill-upstream-allow-additional-email-domains", |
| 855 | flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsName, |
| 856 | flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsDescription, |
| 857 | flags_ui::kOsIos, |
| 858 | FEATURE_VALUE_TYPE( |
| 859 | autofill::features::kAutofillUpstreamAllowAdditionalEmailDomains)}, |
| 860 | {"autofill-upstream-allow-all-email-domains", |
| 861 | flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsName, |
| 862 | flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsDescription, |
| 863 | flags_ui::kOsIos, |
| 864 | FEATURE_VALUE_TYPE( |
| 865 | autofill::features::kAutofillUpstreamAllowAllEmailDomains)}, |
Olivier Robin | ffe767c | 2022-04-21 13:13:23 | [diff] [blame] | 866 | {"enable-tflite-language-detection", |
| 867 | flag_descriptions::kTFLiteLanguageDetectionName, |
| 868 | flag_descriptions::kTFLiteLanguageDetectionDescription, flags_ui::kOsIos, |
| 869 | FEATURE_VALUE_TYPE(translate::kTFLiteLanguageDetectionEnabled)}, |
| 870 | {"optimization-guide-model-downloading", |
| 871 | flag_descriptions::kOptimizationGuideModelDownloadingName, |
| 872 | flag_descriptions::kOptimizationGuideModelDownloadingDescription, |
| 873 | flags_ui::kOsIos, |
| 874 | FEATURE_VALUE_TYPE( |
| 875 | optimization_guide::features::kOptimizationGuideModelDownloading)}, |
| 876 | {"optimization-target-prediction", |
| 877 | flag_descriptions::kOptimizationTargetPredictionName, |
| 878 | flag_descriptions::kOptimizationTargetPredictionDescription, |
| 879 | flags_ui::kOsIos, |
| 880 | FEATURE_VALUE_TYPE( |
| 881 | optimization_guide::features::kOptimizationTargetPrediction)}, |
Sylvain Defresne | 1619dd00 | 2021-11-06 10:09:48 | [diff] [blame] | 882 | }; |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 883 | |
Rohit Rao | bed794c | 2020-04-27 15:27:45 | [diff] [blame] | 884 | bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) { |
| 885 | return false; |
| 886 | } |
| 887 | |
| 888 | flags_ui::FlagsState& GetGlobalFlagsState() { |
| 889 | static base::NoDestructor<flags_ui::FlagsState> flags_state(kFeatureEntries, |
| 890 | nullptr); |
| 891 | return *flags_state; |
| 892 | } |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 893 | // Creates the experimental test policies map, used by AsyncPolicyLoader and |
| 894 | // PolicyLoaderIOS to locally enable policies. |
Vincent Boisselle | ed0e6f1a | 2021-11-09 06:47:34 | [diff] [blame] | 895 | NSMutableDictionary* CreateExperimentalTestingPolicies() { |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 896 | NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
| 897 | |
Guillaume Jenkins | 25e9bd7 | 2020-08-27 17:39:06 | [diff] [blame] | 898 | // Shared variables for all enterprise experimental flags. |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 899 | NSMutableDictionary* testing_policies = [[NSMutableDictionary alloc] init]; |
Guillaume Jenkins | 25e9bd7 | 2020-08-27 17:39:06 | [diff] [blame] | 900 | NSMutableArray* allowed_experimental_policies = [[NSMutableArray alloc] init]; |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 901 | |
Guillaume Jenkins | 25e9bd7 | 2020-08-27 17:39:06 | [diff] [blame] | 902 | // Set some sample policy values for testing if EnableSamplePolicies is set to |
| 903 | // true. |
Guillaume Jenkins | eeb7007c | 2020-06-25 22:55:40 | [diff] [blame] | 904 | if ([defaults boolForKey:@"EnableSamplePolicies"]) { |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 905 | [testing_policies addEntriesFromDictionary:@{ |
Tina Wang | 59d0b7e | 2020-08-11 04:41:01 | [diff] [blame] | 906 | base::SysUTF8ToNSString(policy::key::kAutofillAddressEnabled) : @NO, |
| 907 | |
Guillaume Jenkins | eeb7007c | 2020-06-25 22:55:40 | [diff] [blame] | 908 | base::SysUTF8ToNSString(policy::key::kAutofillCreditCardEnabled) : @NO, |
| 909 | |
| 910 | // 2 = Disable all variations |
| 911 | base::SysUTF8ToNSString(policy::key::kChromeVariations) : @2, |
| 912 | |
| 913 | // 2 = Do not allow any site to show popups |
| 914 | base::SysUTF8ToNSString(policy::key::kDefaultPopupsSetting) : @2, |
| 915 | |
Tina Wang | 5abee80 | 2020-07-29 23:09:52 | [diff] [blame] | 916 | // Set default search engine. |
| 917 | base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderEnabled) : |
| 918 | @YES, |
| 919 | base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderSearchURL) : |
| 920 | @"http://www.google.com/search?q={searchTerms}", |
| 921 | base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderName) : |
Tina Wang | 7cd0a06 | 2020-09-15 21:31:02 | [diff] [blame] | 922 | @"TestEngine", |
Tina Wang | 5abee80 | 2020-07-29 23:09:52 | [diff] [blame] | 923 | |
Tina Wang | 89068c8 | 2020-10-29 15:51:50 | [diff] [blame] | 924 | base::SysUTF8ToNSString(policy::key::kEditBookmarksEnabled) : @NO, |
| 925 | |
Gauthier Ambard | 21b2370 | 2021-04-16 16:11:27 | [diff] [blame] | 926 | base::SysUTF8ToNSString(policy::key::kNTPContentSuggestionsEnabled) : @NO, |
| 927 | |
Guillaume Jenkins | eeb7007c | 2020-06-25 22:55:40 | [diff] [blame] | 928 | base::SysUTF8ToNSString(policy::key::kPasswordManagerEnabled) : @NO, |
Tina Wang | 59d0b7e | 2020-08-11 04:41:01 | [diff] [blame] | 929 | |
| 930 | base::SysUTF8ToNSString(policy::key::kTranslateEnabled) : @NO, |
Tina Wang | 54dddfc2 | 2020-08-20 22:34:53 | [diff] [blame] | 931 | |
| 932 | // 2 = Enhanced safe browsing protection |
| 933 | base::SysUTF8ToNSString(policy::key::kSafeBrowsingProtectionLevel) : @2, |
| 934 | |
| 935 | base::SysUTF8ToNSString(policy::key::kSearchSuggestEnabled) : @YES, |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 936 | }]; |
| 937 | } |
| 938 | |
Ewann | 227a3c0 | 2021-04-19 12:04:54 | [diff] [blame] | 939 | if ([defaults boolForKey:@"EnableSyncDisabledPolicy"]) { |
Guillaume Jenkins | fe46d3a | 2021-04-26 19:51:04 | [diff] [blame] | 940 | NSString* sync_policy_key = |
| 941 | base::SysUTF8ToNSString(policy::key::kSyncDisabled); |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 942 | [testing_policies addEntriesFromDictionary:@{sync_policy_key : @YES}]; |
Ewann | 227a3c0 | 2021-04-19 12:04:54 | [diff] [blame] | 943 | } |
Ewann | 227a3c0 | 2021-04-19 12:04:54 | [diff] [blame] | 944 | |
Ewann | 570a630 | 2021-08-17 07:22:42 | [diff] [blame] | 945 | // SyncTypesListDisabled policy. |
| 946 | NSString* Sync_types_list_disabled_key = |
| 947 | base::SysUTF8ToNSString(policy::key::kSyncTypesListDisabled); |
| 948 | NSMutableArray* Sync_types_list_disabled_values = |
| 949 | [[NSMutableArray alloc] init]; |
| 950 | if ([defaults boolForKey:@"SyncTypesListBookmarks"]) { |
| 951 | [Sync_types_list_disabled_values addObject:@"bookmarks"]; |
| 952 | } |
| 953 | if ([defaults boolForKey:@"SyncTypesListReadingList"]) { |
| 954 | [Sync_types_list_disabled_values addObject:@"readingList"]; |
| 955 | } |
| 956 | if ([defaults boolForKey:@"SyncTypesListPreferences"]) { |
| 957 | [Sync_types_list_disabled_values addObject:@"preferences"]; |
| 958 | } |
| 959 | if ([defaults boolForKey:@"SyncTypesListPasswords"]) { |
| 960 | [Sync_types_list_disabled_values addObject:@"passwords"]; |
| 961 | } |
| 962 | if ([defaults boolForKey:@"SyncTypesListAutofill"]) { |
| 963 | [Sync_types_list_disabled_values addObject:@"autofill"]; |
| 964 | } |
| 965 | if ([defaults boolForKey:@"SyncTypesListTypedUrls"]) { |
| 966 | [Sync_types_list_disabled_values addObject:@"typedUrls"]; |
| 967 | } |
| 968 | if ([defaults boolForKey:@"SyncTypesListTabs"]) { |
| 969 | [Sync_types_list_disabled_values addObject:@"tabs"]; |
| 970 | } |
| 971 | if ([Sync_types_list_disabled_values count]) { |
| 972 | [testing_policies addEntriesFromDictionary:@{ |
| 973 | Sync_types_list_disabled_key : Sync_types_list_disabled_values |
| 974 | }]; |
Ewann | 570a630 | 2021-08-17 07:22:42 | [diff] [blame] | 975 | } |
| 976 | |
Gauthier Ambard | 073eaa9 | 2021-11-22 15:24:13 | [diff] [blame] | 977 | // If an incognito mode availability is set, set the value. |
Tina Wang | c6bcf57 | 2021-01-27 18:15:52 | [diff] [blame] | 978 | NSString* incognito_policy_key = |
| 979 | base::SysUTF8ToNSString(policy::key::kIncognitoModeAvailability); |
| 980 | NSInteger incognito_mode_availability = |
| 981 | [defaults integerForKey:incognito_policy_key]; |
| 982 | if (incognito_mode_availability) { |
Tina Wang | c6bcf57 | 2021-01-27 18:15:52 | [diff] [blame] | 983 | [testing_policies addEntriesFromDictionary:@{ |
| 984 | incognito_policy_key : @(incognito_mode_availability), |
| 985 | }]; |
| 986 | } |
| 987 | |
Ewann | 40a8f8a | 2021-07-29 10:01:20 | [diff] [blame] | 988 | NSString* restriction_pattern = |
| 989 | [defaults stringForKey:@"RestrictAccountsToPatterns"]; |
| 990 | if ([restriction_pattern length] > 0) { |
Ewann | b3bee38 | 2021-08-16 09:12:29 | [diff] [blame] | 991 | NSString* restrict_key = |
| 992 | base::SysUTF8ToNSString(policy::key::kRestrictAccountsToPatterns); |
Ewann | 40a8f8a | 2021-07-29 10:01:20 | [diff] [blame] | 993 | [testing_policies addEntriesFromDictionary:@{ |
Ewann | b3bee38 | 2021-08-16 09:12:29 | [diff] [blame] | 994 | restrict_key : @[ restriction_pattern ] |
Ewann | 40a8f8a | 2021-07-29 10:01:20 | [diff] [blame] | 995 | }]; |
| 996 | } |
| 997 | |
Vincent Boisselle | 19200bc | 2021-09-01 17:58:25 | [diff] [blame] | 998 | // If the sign-in policy is set (not "None"), add the policy key to the list |
| 999 | // of enabled experimental policies, and set the value. |
| 1000 | NSString* const kSigninPolicyKey = @"BrowserSignin"; |
| 1001 | NSInteger signin_policy_mode = [defaults integerForKey:kSigninPolicyKey]; |
| 1002 | if (signin_policy_mode) { |
| 1003 | // Remove the mode offset that was used to represent the unset policy. |
| 1004 | --signin_policy_mode; |
| 1005 | DCHECK(signin_policy_mode >= 0); |
| 1006 | |
Vincent Boisselle | 19200bc | 2021-09-01 17:58:25 | [diff] [blame] | 1007 | [testing_policies addEntriesFromDictionary:@{ |
| 1008 | kSigninPolicyKey : @(signin_policy_mode), |
| 1009 | }]; |
| 1010 | } |
| 1011 | |
Veronique Nguyen | 9b1044f | 2022-01-11 14:41:13 | [diff] [blame] | 1012 | // If the New Tab Page URL is set (not empty) add the value to the list of |
| 1013 | // test policies. |
| 1014 | NSString* ntp_location = [defaults stringForKey:@"NTPLocation"]; |
| 1015 | if ([ntp_location length] > 0) { |
| 1016 | NSString* ntp_location_key = |
| 1017 | base::SysUTF8ToNSString(policy::key::kNewTabPageLocation); |
| 1018 | [testing_policies |
| 1019 | addEntriesFromDictionary:@{ntp_location_key : ntp_location}]; |
Veronique Nguyen | 302d870 | 2022-01-12 21:18:57 | [diff] [blame] | 1020 | [allowed_experimental_policies addObject:ntp_location_key]; |
Veronique Nguyen | 9b1044f | 2022-01-11 14:41:13 | [diff] [blame] | 1021 | } |
| 1022 | |
Ali Juma | 9ec36d2 | 2022-03-28 14:53:12 | [diff] [blame] | 1023 | if ([defaults boolForKey:@"DisallowChromeDataInBackups"]) { |
| 1024 | NSString* allow_backups_key = |
| 1025 | base::SysUTF8ToNSString(policy::key::kAllowChromeDataInBackups); |
| 1026 | [testing_policies addEntriesFromDictionary:@{allow_backups_key : @NO}]; |
| 1027 | [allowed_experimental_policies addObject:allow_backups_key]; |
| 1028 | } |
| 1029 | |
Guillaume Jenkins | 25e9bd7 | 2020-08-27 17:39:06 | [diff] [blame] | 1030 | // If any experimental policy was allowed, set the EnableExperimentalPolicies |
| 1031 | // policy. |
| 1032 | if ([allowed_experimental_policies count] > 0) { |
| 1033 | [testing_policies setValue:allowed_experimental_policies |
| 1034 | forKey:base::SysUTF8ToNSString( |
| 1035 | policy::key::kEnableExperimentalPolicies)]; |
| 1036 | } |
| 1037 | |
David Jean | 6f85d44f | 2021-08-19 08:08:45 | [diff] [blame] | 1038 | // Warning: Add new flags to TestingPoliciesHash() below. |
| 1039 | |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 1040 | return testing_policies; |
| 1041 | } |
David Jean | 6f85d44f | 2021-08-19 08:08:45 | [diff] [blame] | 1042 | |
| 1043 | // Generates a unique NSString based on currently monitored policies from |
| 1044 | // NSUserDefaults standardUserDefaults. |
| 1045 | NSString* TestingPoliciesHash() { |
| 1046 | NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
| 1047 | return [NSString |
Ali Juma | 9ec36d2 | 2022-03-28 14:53:12 | [diff] [blame] | 1048 | stringWithFormat:@"%d|%d|%d|%d|%@|%d|%d|%d|%d|%d|%d|%d", |
| 1049 | [defaults boolForKey:@"DisallowChromeDataInBackups"], |
David Jean | 6f85d44f | 2021-08-19 08:08:45 | [diff] [blame] | 1050 | [defaults boolForKey:@"EnableSyncDisabledPolicy"], |
| 1051 | [defaults boolForKey:@"EnableSamplePolicies"], |
| 1052 | (int)[defaults |
| 1053 | integerForKey:@"IncognitoModeAvailability"], |
| 1054 | [defaults stringForKey:@"RestrictAccountsToPatterns"], |
| 1055 | [defaults boolForKey:@"SyncTypesListBookmarks"], |
| 1056 | [defaults boolForKey:@"SyncTypesListReadingList"], |
| 1057 | [defaults boolForKey:@"SyncTypesListPreferences"], |
| 1058 | [defaults boolForKey:@"SyncTypesListPasswords"], |
| 1059 | [defaults boolForKey:@"SyncTypesListAutofill"], |
| 1060 | [defaults boolForKey:@"SyncTypesListTypedUrls"], |
| 1061 | [defaults boolForKey:@"SyncTypesListTabs"]]; |
| 1062 | } |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 1063 | } // namespace |
| 1064 | |
| 1065 | // Add all switches from experimental flags to |command_line|. |
| 1066 | void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) { |
| 1067 | NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
| 1068 | |
| 1069 | // Set the UA flag if UseMobileSafariUA is enabled. |
| 1070 | if ([defaults boolForKey:@"UseMobileSafariUA"]) { |
| 1071 | // Safari uses "Vesion/", followed by the OS version excluding bugfix, where |
| 1072 | // Chrome puts its product token. |
| 1073 | int32_t major = 0; |
| 1074 | int32_t minor = 0; |
| 1075 | int32_t bugfix = 0; |
| 1076 | base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); |
| 1077 | std::string product = base::StringPrintf("Version/%d.%d", major, minor); |
| 1078 | |
| 1079 | command_line->AppendSwitchASCII(switches::kUserAgent, |
| 1080 | web::BuildMobileUserAgent(product)); |
| 1081 | } |
| 1082 | |
| 1083 | // Shared variables for all enterprise experimental flags. |
Vincent Boisselle | ed0e6f1a | 2021-11-09 06:47:34 | [diff] [blame] | 1084 | NSMutableDictionary* testing_policies = CreateExperimentalTestingPolicies(); |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 1085 | |
| 1086 | // If a CBCM enrollment token is provided, force Chrome Browser Cloud |
| 1087 | // Management to enabled and add the token to the list of policies. |
| 1088 | NSString* token_key = |
| 1089 | base::SysUTF8ToNSString(policy::key::kCloudManagementEnrollmentToken); |
| 1090 | NSString* token = [defaults stringForKey:token_key]; |
| 1091 | |
| 1092 | if ([token length] > 0) { |
| 1093 | command_line->AppendSwitch(switches::kEnableChromeBrowserCloudManagement); |
| 1094 | [testing_policies setValue:token forKey:token_key]; |
| 1095 | } |
| 1096 | |
Vincent Boisselle | d042d55 | 2022-04-09 01:22:59 | [diff] [blame] | 1097 | if ([defaults boolForKey:@"EnableUserPolicy"]) { |
| 1098 | policy::EnableUserPolicy(); |
| 1099 | } |
| 1100 | |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 1101 | // If some policies were set, commit them to the app's registration defaults. |
| 1102 | if ([testing_policies count] > 0) { |
Guillaume Jenkins | eeb7007c | 2020-06-25 22:55:40 | [diff] [blame] | 1103 | NSDictionary* registration_defaults = |
| 1104 | @{kPolicyLoaderIOSConfigurationKey : testing_policies}; |
| 1105 | [defaults registerDefaults:registration_defaults]; |
| 1106 | } |
| 1107 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1108 | // Freeform commandline flags. These are added last, so that any flags added |
| 1109 | // earlier in this function take precedence. |
| 1110 | if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) { |
| 1111 | base::CommandLine::StringVector flags; |
| 1112 | // Append an empty "program" argument. |
| 1113 | flags.push_back(""); |
| 1114 | |
| 1115 | // The number of flags corresponds to the number of text fields in |
| 1116 | // Experimental.plist. |
| 1117 | const int kNumFreeformFlags = 5; |
| 1118 | for (int i = 1; i <= kNumFreeformFlags; ++i) { |
| 1119 | NSString* key = |
| 1120 | [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i]; |
| 1121 | NSString* flag = [defaults stringForKey:key]; |
| 1122 | if ([flag length]) { |
Robbie Gibson | c91ce62 | 2019-05-20 14:44:33 | [diff] [blame] | 1123 | // iOS keyboard replaces -- with —, so undo that. |
| 1124 | flag = [flag stringByReplacingOccurrencesOfString:@"—" |
| 1125 | withString:@"--" |
| 1126 | options:0 |
| 1127 | range:NSMakeRange(0, 1)]; |
| 1128 | // To make things easier, allow flags with no dashes by prepending them |
| 1129 | // here. This also allows for flags that just have one dash if they |
| 1130 | // exist. |
| 1131 | if (![flag hasPrefix:@"-"]) { |
| 1132 | flag = [@"--" stringByAppendingString:flag]; |
| 1133 | } |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1134 | flags.push_back(base::SysNSStringToUTF8(flag)); |
| 1135 | } |
| 1136 | } |
| 1137 | |
| 1138 | base::CommandLine temp_command_line(flags); |
| 1139 | command_line->AppendArguments(temp_command_line, false); |
| 1140 | } |
msarda | fc76f66 | 2017-02-24 12:46:28 | [diff] [blame] | 1141 | |
justincohen | dacc85d | 2017-06-28 23:34:10 | [diff] [blame] | 1142 | // Populate command line flag for 3rd party keyboard omnibox workaround. |
| 1143 | NSString* enableThirdPartyKeyboardWorkaround = |
| 1144 | [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"]; |
| 1145 | if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) { |
| 1146 | command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround); |
| 1147 | } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) { |
| 1148 | command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround); |
| 1149 | } |
| 1150 | |
Sylvain Defresne | d3cd8d9 | 2022-01-18 13:35:08 | [diff] [blame] | 1151 | ios::provider::AppendSwitchesFromExperimentalSettings(defaults, command_line); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1152 | } |
| 1153 | |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 1154 | void MonitorExperimentalSettingsChanges() { |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 1155 | // Startup values for settings to be observed. |
David Jean | 6f85d44f | 2021-08-19 08:08:45 | [diff] [blame] | 1156 | __block NSString* hash = TestingPoliciesHash(); |
David Jean | e83ed65 | 2021-08-25 14:52:48 | [diff] [blame] | 1157 | static std::atomic_bool pending_check(false); |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 1158 | |
| 1159 | auto monitor = ^(NSNotification* notification) { |
David Jean | e83ed65 | 2021-08-25 14:52:48 | [diff] [blame] | 1160 | bool has_pending_check = pending_check.exchange(true); |
| 1161 | if (has_pending_check) |
| 1162 | return; |
| 1163 | |
David Jean | bc0fae3 | 2021-08-25 10:31:39 | [diff] [blame] | 1164 | // Can be called from any thread from where the notification was sent, |
| 1165 | // but since it may change standardUserDefaults, and that has to be on main |
| 1166 | // thread, dispatch to main thread. |
| 1167 | dispatch_async(dispatch_get_main_queue(), ^{ |
| 1168 | // Check if observed settings have changed. Since source and destination |
| 1169 | // are both user defaults, this is required to avoid cycling back here. |
| 1170 | NSString* newHash = TestingPoliciesHash(); |
| 1171 | if (![newHash isEqualToString:hash]) { |
| 1172 | hash = newHash; |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 1173 | |
David Jean | bc0fae3 | 2021-08-25 10:31:39 | [diff] [blame] | 1174 | // Publish update. |
| 1175 | NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
| 1176 | NSMutableDictionary* testing_policies = |
Vincent Boisselle | ed0e6f1a | 2021-11-09 06:47:34 | [diff] [blame] | 1177 | CreateExperimentalTestingPolicies(); |
David Jean | bc0fae3 | 2021-08-25 10:31:39 | [diff] [blame] | 1178 | NSDictionary* registration_defaults = |
| 1179 | @{kPolicyLoaderIOSConfigurationKey : testing_policies}; |
| 1180 | [defaults registerDefaults:registration_defaults]; |
| 1181 | } |
David Jean | e83ed65 | 2021-08-25 14:52:48 | [diff] [blame] | 1182 | |
| 1183 | pending_check.store(false); |
David Jean | bc0fae3 | 2021-08-25 10:31:39 | [diff] [blame] | 1184 | }); |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 1185 | }; |
| 1186 | |
| 1187 | NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; |
| 1188 | [center addObserverForName:NSUserDefaultsDidChangeNotification |
| 1189 | object:nil |
David Jean | bc0fae3 | 2021-08-25 10:31:39 | [diff] [blame] | 1190 | queue:nil |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 1191 | usingBlock:monitor]; |
| 1192 | } |
| 1193 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1194 | void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage, |
| 1195 | base::CommandLine* command_line) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 1196 | GetGlobalFlagsState().ConvertFlagsToSwitches( |
sdefresne | c976390 | 2015-12-02 10:30:11 | [diff] [blame] | 1197 | flags_storage, command_line, flags_ui::kAddSentinels, |
Gregory Chatzinoff | f652372 | 2017-11-21 01:33:53 | [diff] [blame] | 1198 | switches::kEnableFeatures, switches::kDisableFeatures); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1199 | } |
| 1200 | |
jkrcal | bf07337 | 2016-07-29 07:21:31 | [diff] [blame] | 1201 | std::vector<std::string> RegisterAllFeatureVariationParameters( |
| 1202 | flags_ui::FlagsStorage* flags_storage, |
| 1203 | base::FeatureList* feature_list) { |
Justin Cohen | 2e2adb5 | 2019-10-25 17:00:02 | [diff] [blame] | 1204 | // Occasionally DCHECK crashes on canary can be very distuptive. An |
| 1205 | // experimental flag was added to aid in temporarily disabling this for |
| 1206 | // canary testers. |
| 1207 | #if defined(DCHECK_IS_CONFIGURABLE) |
| 1208 | if (experimental_flags::AreDCHECKCrashesDisabled()) { |
| 1209 | std::vector<base::FeatureList::FeatureOverrideInfo> overrides; |
| 1210 | overrides.push_back( |
| 1211 | {std::cref(base::kDCheckIsFatalFeature), |
| 1212 | base::FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE}); |
| 1213 | feature_list->RegisterExtraFeatureOverrides(std::move(overrides)); |
| 1214 | } |
| 1215 | #endif // defined(DCHECK_IS_CONFIGURABLE) |
| 1216 | |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 1217 | return GetGlobalFlagsState().RegisterAllFeatureVariationParameters( |
| 1218 | flags_storage, feature_list); |
jkrcal | bf07337 | 2016-07-29 07:21:31 | [diff] [blame] | 1219 | } |
| 1220 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1221 | void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage, |
| 1222 | flags_ui::FlagAccess access, |
Morten Stenshorne | 7afa580 | 2021-07-15 10:04:43 | [diff] [blame] | 1223 | base::Value::ListStorage& supported_entries, |
| 1224 | base::Value::ListStorage& unsupported_entries) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 1225 | GetGlobalFlagsState().GetFlagFeatureEntries( |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1226 | flags_storage, access, supported_entries, unsupported_entries, |
Renjie Tang | 208c819 | 2020-11-03 00:46:51 | [diff] [blame] | 1227 | base::BindRepeating(&SkipConditionalFeatureEntry)); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1228 | } |
| 1229 | |
| 1230 | void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage, |
| 1231 | const std::string& internal_name, |
| 1232 | bool enable) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 1233 | GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name, |
| 1234 | enable); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1235 | } |
| 1236 | |
| 1237 | void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 1238 | GetGlobalFlagsState().ResetAllFlags(flags_storage); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1239 | } |
| 1240 | |
| 1241 | namespace testing { |
| 1242 | |
Elly Fong-Jones | 323ab109 | 2021-08-23 22:36:31 | [diff] [blame] | 1243 | base::span<const flags_ui::FeatureEntry> GetFeatureEntries() { |
| 1244 | return base::span<const flags_ui::FeatureEntry>(kFeatureEntries, |
Daniel Cheng | 1f047a8 | 2022-02-26 10:04:53 | [diff] [blame] | 1245 | std::size(kFeatureEntries)); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1246 | } |
| 1247 | |
| 1248 | } // namespace testing |