blob: 321d52799e75322224d440dbe2894a2b9d5c5ce9 [file] [log] [blame]
Avi Drissmanea1be232022-09-14 23:29:061// Copyright 2012 The Chromium Authors
sdefresne14900ee2015-11-27 14:43:212// 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
Gauthier Ambard999088c2022-09-13 08:36:578#import "ios/chrome/browser/flags/about_flags.h"
sdefresne14900ee2015-11-27 14:43:219
Nazerke9c259052019-06-26 15:30:1010#import <UIKit/UIKit.h>
Gauthier Ambard999088c2022-09-13 08:36:5711#import <stddef.h>
12#import <stdint.h>
sdefresne14900ee2015-11-27 14:43:2113
Gauthier Ambard999088c2022-09-13 08:36:5714#import "base/base_switches.h"
15#import "base/bind.h"
16#import "base/callback_helpers.h"
17#import "base/check_op.h"
Peter Boström3f798572022-07-26 23:44:3618#import "base/debug/debugging_buildflags.h"
David Jean5ca263c2021-08-18 09:19:3019#import "base/mac/foundation_util.h"
Gauthier Ambard999088c2022-09-13 08:36:5720#import "base/no_destructor.h"
21#import "base/strings/stringprintf.h"
22#import "base/strings/sys_string_conversions.h"
23#import "base/system/sys_info.h"
24#import "components/autofill/core/common/autofill_features.h"
25#import "components/autofill/core/common/autofill_payments_features.h"
26#import "components/autofill/core/common/autofill_switches.h"
27#import "components/autofill/ios/browser/autofill_switches.h"
28#import "components/breadcrumbs/core/features.h"
29#import "components/commerce/core/commerce_feature_list.h"
30#import "components/commerce/core/flag_descriptions.h"
31#import "components/content_settings/core/common/features.h"
32#import "components/dom_distiller/core/dom_distiller_switches.h"
33#import "components/enterprise/browser/enterprise_switches.h"
34#import "components/feature_engagement/public/feature_constants.h"
35#import "components/feature_engagement/public/feature_list.h"
36#import "components/feed/feed_feature_list.h"
37#import "components/flags_ui/feature_entry.h"
38#import "components/flags_ui/feature_entry_macros.h"
39#import "components/flags_ui/flags_storage.h"
40#import "components/flags_ui/flags_ui_switches.h"
41#import "components/invalidation/impl/invalidation_switches.h"
42#import "components/ntp_tiles/switches.h"
43#import "components/omnibox/browser/omnibox_field_trial.h"
44#import "components/omnibox/common/omnibox_features.h"
45#import "components/optimization_guide/core/optimization_guide_features.h"
Raj Ta921ffc2022-08-25 19:00:2046#import "components/optimization_guide/core/optimization_guide_switches.h"
Gauthier Ambard999088c2022-09-13 08:36:5747#import "components/password_manager/core/common/password_manager_features.h"
48#import "components/payments/core/features.h"
49#import "components/policy/core/common/features.h"
Guillaume Jenkinseeb7007c2020-06-25 22:55:4050#import "components/policy/core/common/policy_loader_ios_constants.h"
Gauthier Ambard999088c2022-09-13 08:36:5751#import "components/policy/policy_constants.h"
52#import "components/safe_browsing/core/common/features.h"
Victor Hugo Vianna Silva0399402f2021-09-07 21:41:2553#import "components/send_tab_to_self/features.h"
Gauthier Ambard999088c2022-09-13 08:36:5754#import "components/shared_highlighting/core/common/shared_highlighting_features.h"
55#import "components/signin/core/browser/account_reconcilor.h"
56#import "components/signin/ios/browser/features.h"
57#import "components/signin/public/base/signin_switches.h"
58#import "components/strings/grit/components_strings.h"
59#import "components/sync/base/command_line_switches.h"
60#import "components/sync/base/features.h"
61#import "components/sync/base/pref_names.h"
62#import "components/translate/core/browser/translate_prefs.h"
63#import "components/translate/core/common/translate_util.h"
Ed Chin91e44992022-07-27 13:42:3464#import "ios/chrome/app/background_mode_buildflags.h"
Gauthier Ambard999088c2022-09-13 08:36:5765#import "ios/chrome/browser/browsing_data/browsing_data_features.h"
66#import "ios/chrome/browser/crash_report/features.h"
Gauthier Ambard92605132022-08-26 13:25:1767#import "ios/chrome/browser/flags/chrome_switches.h"
Gauthier Ambard999088c2022-09-13 08:36:5768#import "ios/chrome/browser/flags/ios_chrome_flag_descriptions.h"
Gauthier Ambard92605132022-08-26 13:25:1769#import "ios/chrome/browser/flags/system_flags.h"
Ed Chin100660bf2022-04-26 16:59:1370#import "ios/chrome/browser/ntp/features.h"
Vincent Boissellead6cbe22022-07-04 19:32:3971#import "ios/chrome/browser/policy/cloud/user_policy_switch.h"
Gauthier Ambard999088c2022-09-13 08:36:5772#import "ios/chrome/browser/policy/policy_util.h"
Benjamin Williams14233d72022-07-26 18:32:2073#import "ios/chrome/browser/promos_manager/features.h"
Gauthier Ambard999088c2022-09-13 08:36:5774#import "ios/chrome/browser/screen_time/screen_time_buildflags.h"
Olivier Robin3a957df2021-12-21 18:04:3475#import "ios/chrome/browser/sessions/session_features.h"
Zhixiang Teoh40027a22022-07-28 03:24:3476#import "ios/chrome/browser/text_selection/text_selection_util.h"
Hira Mahmoodb0e5f412022-09-01 19:41:0577#import "ios/chrome/browser/ui/app_store_rating/features.h"
Gauthier Ambard999088c2022-09-13 08:36:5778#import "ios/chrome/browser/ui/autofill/features.h"
79#import "ios/chrome/browser/ui/bubble/bubble_features.h"
adamta22a4d502020-05-21 03:12:2180#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h"
Javier Ernesto Flores Robles209b2822021-03-25 19:16:5081#import "ios/chrome/browser/ui/default_promo/default_browser_utils.h"
Ewann1a9d33d2021-06-14 11:12:2482#import "ios/chrome/browser/ui/download/features.h"
Rohit Rao5aa791a2022-08-19 17:34:5383#import "ios/chrome/browser/ui/first_run/field_trial_constants.h"
Chris Lu438e1c052022-08-17 02:57:0084#import "ios/chrome/browser/ui/first_run/trending_queries_field_trial.h"
Kurt Horimoto4da682b022018-04-12 07:43:3585#import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h"
adamta273568472020-12-04 23:53:5786#import "ios/chrome/browser/ui/ntp/new_tab_page_feature.h"
Christian Xub8c06cd2022-04-29 20:55:0187#import "ios/chrome/browser/ui/omnibox/omnibox_ui_features.h"
Aliona DANGLAa5257ccc2022-08-29 14:01:4988#import "ios/chrome/browser/ui/open_in/features.h"
Robbie Gibson686c56732021-10-04 17:11:4589#import "ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.h"
Gauthier Ambard30ad9ca2022-06-09 14:15:2690#import "ios/chrome/browser/ui/popup_menu/public/features.h"
Benjamin Williams3d3a2ec2022-09-13 20:01:2691#import "ios/chrome/browser/ui/post_restore_signin/features.h"
gogerald0ff29e52021-02-03 18:56:1992#import "ios/chrome/browser/ui/start_surface/start_surface_features.h"
Kurt Horimoto79d590b2018-09-12 19:09:2893#import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h"
Gauthier Ambard999088c2022-09-13 08:36:5794#import "ios/chrome/browser/ui/ui_feature_flags.h"
Cheick Cisse87a51cb2022-09-08 21:29:1795#import "ios/chrome/browser/ui/whats_new/feature_flags.h"
Gauthier Ambard999088c2022-09-13 08:36:5796#import "ios/chrome/browser/web/features.h"
97#import "ios/chrome/grit/ios_strings.h"
98#import "ios/components/security_interstitials/https_only_mode/feature.h"
99#import "ios/public/provider/chrome/browser/app_utils/app_utils_api.h"
100#import "ios/web/common/features.h"
101#import "ios/web/common/user_agent.h"
102#import "ios/web/common/web_view_creation_util.h"
sdefresne14900ee2015-11-27 14:43:21103
Sylvain Defresne9c107082020-10-27 16:39:13104#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
Gauthier Ambard999088c2022-09-13 08:36:57105#import "ios/chrome/browser/screen_time/features.h"
Sylvain Defresne9c107082020-10-27 16:39:13106#endif
107
sdefresne14900ee2015-11-27 14:43:21108#if !defined(OFFICIAL_BUILD)
Gauthier Ambard999088c2022-09-13 08:36:57109#import "components/variations/variations_switches.h"
vitaliii489217aa2017-01-30 14:50:22110#endif
stkhapuginc1be1792016-12-13 14:30:53111
112#if !defined(__has_feature) || !__has_feature(objc_arc)
113#error "This file requires ARC support."
114#endif
sdefresne14900ee2015-11-27 14:43:21115
elawrence816f6790e2017-06-16 18:19:28116using flags_ui::FeatureEntry;
117
sdefresne14900ee2015-11-27 14:43:21118namespace {
Emily Starkbafa9062017-12-27 15:22:46119
Olivier Robin3d60411622018-02-23 10:03:22120const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = {
121 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
122 {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"},
123 {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"},
124 {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"},
125 {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"},
126 {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"},
127 {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"},
128 {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"},
129 {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"},
130};
131
Nohemi Fernandez222d6d42020-09-30 20:35:57132const FeatureEntry::Choice kDelayThresholdMinutesToUpdateGaiaCookieChoices[] = {
133 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
134 {"0", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "0"},
135 {"10", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "10"},
136 {"60", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "60"},
137};
138
Nohemi Fernandezc00842a2021-07-26 11:47:34139const FeatureEntry::Choice
140 kWaitThresholdMillisecondsForCapabilitiesApiChoices[] = {
141 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
142 {"200", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "200"},
143 {"500", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "500"},
144 {"5000", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "5000"},
145};
146
Stepan Khapugincc4e9842019-01-23 13:38:13147const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = {
148 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}};
149const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = {
150 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}};
151const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = {
152 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}};
153const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = {
154 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}};
155const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = {
156 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}};
157const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = {
158 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}};
159const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = {
160 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}};
161
162const FeatureEntry::FeatureVariation
163 kOmniboxUIMaxAutocompleteMatchesVariations[] = {
164 {"3 matches", kOmniboxUIMaxAutocompleteMatches3,
Daniel Cheng1f047a82022-02-26 10:04:53165 std::size(kOmniboxUIMaxAutocompleteMatches3), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13166 {"4 matches", kOmniboxUIMaxAutocompleteMatches4,
Daniel Cheng1f047a82022-02-26 10:04:53167 std::size(kOmniboxUIMaxAutocompleteMatches4), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13168 {"5 matches", kOmniboxUIMaxAutocompleteMatches5,
Daniel Cheng1f047a82022-02-26 10:04:53169 std::size(kOmniboxUIMaxAutocompleteMatches5), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13170 {"6 matches", kOmniboxUIMaxAutocompleteMatches6,
Daniel Cheng1f047a82022-02-26 10:04:53171 std::size(kOmniboxUIMaxAutocompleteMatches6), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13172 {"8 matches", kOmniboxUIMaxAutocompleteMatches8,
Daniel Cheng1f047a82022-02-26 10:04:53173 std::size(kOmniboxUIMaxAutocompleteMatches8), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13174 {"10 matches", kOmniboxUIMaxAutocompleteMatches10,
Daniel Cheng1f047a82022-02-26 10:04:53175 std::size(kOmniboxUIMaxAutocompleteMatches10), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13176 {"12 matches", kOmniboxUIMaxAutocompleteMatches12,
Daniel Cheng1f047a82022-02-26 10:04:53177 std::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}};
Stepan Khapugincc4e9842019-01-23 13:38:13178
Stepan Khapuginbac467e2022-05-06 21:11:54179const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches6[] = {
180 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "6"}};
181const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches15[] = {
182 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "15"}};
183const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches20[] = {
184 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "20"}};
185
186const FeatureEntry::FeatureVariation kOmniboxMaxZPSMatchesVariations[] = {
187 {"6 matches", kOmniboxMaxZPSMatches6, std::size(kOmniboxMaxZPSMatches6),
188 nullptr},
189 {"15 matches", kOmniboxMaxZPSMatches15, std::size(kOmniboxMaxZPSMatches15),
190 nullptr},
191 {"20 matches", kOmniboxMaxZPSMatches20, std::size(kOmniboxMaxZPSMatches20),
192 nullptr},
193};
194
Christian Xucf26d562022-07-06 09:28:36195const FeatureEntry::FeatureParam kOmniboxMaxURLMatches5[] = {
196 {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "5"}};
197const FeatureEntry::FeatureParam kOmniboxMaxURLMatches6[] = {
198 {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "6"}};
199const FeatureEntry::FeatureParam kOmniboxMaxURLMatches7[] = {
200 {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "7"}};
201
202const FeatureEntry::FeatureVariation kOmniboxMaxURLMatchesVariations[] = {
203 {"5 matches", kOmniboxMaxURLMatches5, std::size(kOmniboxMaxURLMatches5),
204 nullptr},
205 {"6 matches", kOmniboxMaxURLMatches6, std::size(kOmniboxMaxURLMatches6),
206 nullptr},
207 {"7 matches", kOmniboxMaxURLMatches7, std::size(kOmniboxMaxURLMatches7),
208 nullptr},
209};
210
Caitlin Fischer37e01232019-05-24 13:05:45211const FeatureEntry::FeatureParam
212 kAutofillUseMobileLabelDisambiguationShowAll[] = {
213 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
214 autofill::features::
215 kAutofillUseMobileLabelDisambiguationParameterShowAll}};
216const FeatureEntry::FeatureParam
217 kAutofillUseMobileLabelDisambiguationShowOne[] = {
218 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
219 autofill::features::
220 kAutofillUseMobileLabelDisambiguationParameterShowOne}};
221
222const FeatureEntry::FeatureVariation
223 kAutofillUseMobileLabelDisambiguationVariations[] = {
224 {"(show all)", kAutofillUseMobileLabelDisambiguationShowAll,
Daniel Cheng1f047a82022-02-26 10:04:53225 std::size(kAutofillUseMobileLabelDisambiguationShowAll), nullptr},
Caitlin Fischer37e01232019-05-24 13:05:45226 {"(show one)", kAutofillUseMobileLabelDisambiguationShowOne,
Daniel Cheng1f047a82022-02-26 10:04:53227 std::size(kAutofillUseMobileLabelDisambiguationShowOne), nullptr}};
Caitlin Fischer37e01232019-05-24 13:05:45228
Javier Ernesto Flores Roblese85f4a12021-02-23 18:10:10229const FeatureEntry::FeatureParam
Javier Ernesto Flores Robles159414232021-06-16 14:29:59230 kDefaultBrowserFullscreenPromoExperimentRemindMeLater[] = {
231 {kDefaultBrowserFullscreenPromoExperimentRemindMeGroupParam, "true"}};
232const FeatureEntry::FeatureVariation
233 kDefaultBrowserFullscreenPromoExperimentVariations[] = {
234 {"Remind me later",
235 kDefaultBrowserFullscreenPromoExperimentRemindMeLater,
Daniel Cheng1f047a82022-02-26 10:04:53236 std::size(kDefaultBrowserFullscreenPromoExperimentRemindMeLater),
Javier Ernesto Flores Robles159414232021-06-16 14:29:59237 nullptr}};
238
gogeralddb0d8ae2020-11-13 03:56:58239const FeatureEntry::FeatureParam kDiscoverFeedInNtpEnableNativeUI[] = {
240 {kDiscoverFeedIsNativeUIEnabled, "true"}};
241const FeatureEntry::FeatureVariation kDiscoverFeedInNtpVariations[] = {
242 {"Native UI", kDiscoverFeedInNtpEnableNativeUI,
Daniel Cheng1f047a82022-02-26 10:04:53243 std::size(kDiscoverFeedInNtpEnableNativeUI), nullptr}};
gogeralddb0d8ae2020-11-13 03:56:58244
Sergio Collazos9fcc6ed2021-10-06 00:58:03245const FeatureEntry::FeatureParam kDiscoverFeedSRSReconstructedTemplates[] = {
246 {kDiscoverFeedSRSReconstructedTemplatesEnabled, "true"}};
247const FeatureEntry::FeatureParam kDiscoverFeedSRSPreloadTemplates[] = {
248 {kDiscoverFeedSRSPreloadTemplatesEnabled, "true"}};
249const FeatureEntry::FeatureVariation
250 kEnableDiscoverFeedStaticResourceServingVariations[] = {
251 {"Reconstruct Templates", kDiscoverFeedSRSReconstructedTemplates,
Daniel Cheng1f047a82022-02-26 10:04:53252 std::size(kDiscoverFeedSRSReconstructedTemplates), nullptr},
Sergio Collazos9fcc6ed2021-10-06 00:58:03253 {"Preload Templates", kDiscoverFeedSRSPreloadTemplates,
Daniel Cheng1f047a82022-02-26 10:04:53254 std::size(kDiscoverFeedSRSPreloadTemplates), nullptr},
Sergio Collazos9fcc6ed2021-10-06 00:58:03255};
256
Mohammad Refaatab6bee62022-05-16 16:31:15257const FeatureEntry::FeatureParam kDiscoverFeedTopSyncPromoFullWithTitle[] = {
adamtadb0bfc62022-08-01 17:37:47258 {kDiscoverFeedTopSyncPromoStyleFullWithTitle, "true"},
259 {kDiscoverFeedTopSyncPromoStyleCompact, "false"}};
Mohammad Refaatab6bee62022-05-16 16:31:15260const FeatureEntry::FeatureParam kDiscoverFeedTopSyncPromoCompact[] = {
adamtadb0bfc62022-08-01 17:37:47261 {kDiscoverFeedTopSyncPromoStyleFullWithTitle, "false"},
262 {kDiscoverFeedTopSyncPromoStyleCompact, "true"}};
263
Mohammad Refaatab6bee62022-05-16 16:31:15264const FeatureEntry::FeatureVariation kDiscoverFeedTopSyncPromoVariations[] = {
265 {"Full with title", kDiscoverFeedTopSyncPromoFullWithTitle,
266 std::size(kDiscoverFeedTopSyncPromoFullWithTitle), nullptr},
267 {"Compact", kDiscoverFeedTopSyncPromoCompact,
268 std::size(kDiscoverFeedTopSyncPromoCompact), nullptr}};
269
Robbie Gibson46351032022-03-31 19:46:23270const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion1[] = {
271 {kIOSOmniboxUpdatedPopupUIVariationName,
272 kIOSOmniboxUpdatedPopupUIVariation1}};
273const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion2[] = {
274 {kIOSOmniboxUpdatedPopupUIVariationName,
275 kIOSOmniboxUpdatedPopupUIVariation2}};
Stepan Khapugin0fd1869a2022-08-09 10:23:47276const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion3[] = {
277 {kIOSOmniboxUpdatedPopupUIVariationName,
278 kIOSOmniboxUpdatedPopupUIVariation1UIKit}};
279const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion4[] = {
280 {kIOSOmniboxUpdatedPopupUIVariationName,
281 kIOSOmniboxUpdatedPopupUIVariation2UIKit}};
Robbie Gibson46351032022-03-31 19:46:23282const FeatureEntry::FeatureVariation kiOSOmniboxUpdatedPopupUIVariations[] = {
Stepan Khapugin0fd1869a2022-08-09 10:23:47283 {"Version 1 - SwiftUI", kiOSOmniboxUpdatedPopupUIVersion1,
Robbie Gibson46351032022-03-31 19:46:23284 std::size(kiOSOmniboxUpdatedPopupUIVersion1), nullptr},
Stepan Khapugin0fd1869a2022-08-09 10:23:47285 {"Version 2 - SwiftUI", kiOSOmniboxUpdatedPopupUIVersion2,
286 std::size(kiOSOmniboxUpdatedPopupUIVersion2), nullptr},
287 {"Version 1 - UIKit", kiOSOmniboxUpdatedPopupUIVersion3,
288 std::size(kiOSOmniboxUpdatedPopupUIVersion3), nullptr},
289 {"Version 2 - UIKit", kiOSOmniboxUpdatedPopupUIVersion4,
290 std::size(kiOSOmniboxUpdatedPopupUIVersion4), nullptr}};
Robbie Gibson46351032022-03-31 19:46:23291
gogerald53c6e7a2021-04-15 22:07:35292const FeatureEntry::FeatureParam kStartSurfaceTenSecondsShrinkLogo[] = {
Chris Lu5470417c2021-03-03 18:43:08293 {kStartSurfaceShrinkLogoParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35294 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
295const FeatureEntry::FeatureParam kStartSurfaceTenSecondsHideShortcuts[] = {
Chris Lu5470417c2021-03-03 18:43:08296 {kStartSurfaceHideShortcutsParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35297 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
298const FeatureEntry::FeatureParam kStartSurfaceTenSecondsReturnToRecentTab[] = {
Chris Lu5470417c2021-03-03 18:43:08299 {kStartSurfaceReturnToRecentTabParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35300 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
301const FeatureEntry::FeatureParam
302 kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab[] = {
303 {kStartSurfaceShrinkLogoParam, "true"},
304 {kStartSurfaceReturnToRecentTabParam, "true"},
305 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
306const FeatureEntry::FeatureParam
307 kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab[] = {
308 {kStartSurfaceHideShortcutsParam, "true"},
309 {kStartSurfaceReturnToRecentTabParam, "true"},
310 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
311const FeatureEntry::FeatureParam kStartSurfaceOneHourShrinkLogo[] = {
Chris Lu5470417c2021-03-03 18:43:08312 {kStartSurfaceShrinkLogoParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35313 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
314const FeatureEntry::FeatureParam kStartSurfaceOneHourHideShortcuts[] = {
315 {kStartSurfaceHideShortcutsParam, "true"},
316 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
317const FeatureEntry::FeatureParam kStartSurfaceOneHourReturnToRecentTab[] = {
Chris Lu5470417c2021-03-03 18:43:08318 {kStartSurfaceReturnToRecentTabParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35319 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
320const FeatureEntry::FeatureParam
321 kStartSurfaceOneHourShrinkLogoReturnToRecentTab[] = {
322 {kStartSurfaceShrinkLogoParam, "true"},
323 {kStartSurfaceReturnToRecentTabParam, "true"},
324 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
325const FeatureEntry::FeatureParam
326 kStartSurfaceOneHourHideShortcutsReturnToRecentTab[] = {
327 {kStartSurfaceHideShortcutsParam, "true"},
328 {kStartSurfaceReturnToRecentTabParam, "true"},
329 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
Chris Lu5470417c2021-03-03 18:43:08330
gogerald0e39e3aa2021-02-10 18:41:23331const FeatureEntry::FeatureVariation kStartSurfaceVariations[] = {
gogerald53c6e7a2021-04-15 22:07:35332 {"10s:Show Return to Recent Tab tile",
333 kStartSurfaceTenSecondsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53334 std::size(kStartSurfaceTenSecondsReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35335 {"10s:Shrink Logo", kStartSurfaceTenSecondsShrinkLogo,
Daniel Cheng1f047a82022-02-26 10:04:53336 std::size(kStartSurfaceTenSecondsShrinkLogo), nullptr},
gogerald53c6e7a2021-04-15 22:07:35337 {"10s:Hide Shortcuts", kStartSurfaceTenSecondsHideShortcuts,
Daniel Cheng1f047a82022-02-26 10:04:53338 std::size(kStartSurfaceTenSecondsHideShortcuts), nullptr},
gogerald53c6e7a2021-04-15 22:07:35339 {"10s:Shrink Logo and show Return to Recent Tab tile",
340 kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53341 std::size(kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35342 {"10s:Hide Shortcuts and show Return to Recent Tab tile",
343 kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53344 std::size(kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35345 {"1h:Show Return to Recent Tab tile", kStartSurfaceOneHourReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53346 std::size(kStartSurfaceOneHourReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35347 {"1h:Shrink Logo", kStartSurfaceOneHourShrinkLogo,
Daniel Cheng1f047a82022-02-26 10:04:53348 std::size(kStartSurfaceOneHourShrinkLogo), nullptr},
gogerald53c6e7a2021-04-15 22:07:35349 {"1h:Hide Shortcuts", kStartSurfaceOneHourHideShortcuts,
Daniel Cheng1f047a82022-02-26 10:04:53350 std::size(kStartSurfaceOneHourHideShortcuts), nullptr},
gogerald53c6e7a2021-04-15 22:07:35351 {"1h:Shrink Logo and show Return to Recent Tab tile",
352 kStartSurfaceOneHourShrinkLogoReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53353 std::size(kStartSurfaceOneHourShrinkLogoReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35354 {"1h:Hide Shortcuts and show Return to Recent Tab tile",
355 kStartSurfaceOneHourHideShortcutsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53356 std::size(kStartSurfaceOneHourHideShortcutsReturnToRecentTab), nullptr},
Chris Lu5470417c2021-03-03 18:43:08357};
gogerald0e39e3aa2021-02-10 18:41:23358
Chris Lu8e308dc2022-09-06 16:59:40359const FeatureEntry::FeatureParam kModuleRefreshMinimizeSpacing[] = {
360 {kContentSuggestionsUIModuleRefreshMinimizeSpacingParam, "true"}};
361const FeatureEntry::FeatureParam kModuleRefreshNoHeaders[] = {
Chris Lu264e2372022-09-08 13:12:57362 {kContentSuggestionsUIModuleRefreshMinimizeSpacingParam, "true"},
Chris Lu8e308dc2022-09-06 16:59:40363 {kContentSuggestionsUIModuleRefreshRemoveHeadersParam, "true"}};
364
365const FeatureEntry::FeatureVariation kModuleRefreshVariations[] = {
366 {"Enabled with minimized spacing", kModuleRefreshMinimizeSpacing,
367 std::size(kModuleRefreshMinimizeSpacing), nullptr},
Chris Lu264e2372022-09-08 13:12:57368 {"Enabled with no headers and minimized spacing", kModuleRefreshNoHeaders,
Chris Lu8e308dc2022-09-06 16:59:40369 std::size(kModuleRefreshNoHeaders), nullptr},
370};
371
Ed Chin91e44992022-07-27 13:42:34372#if BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
Ed Chin59f617b2022-07-19 22:12:04373// Feed Background Refresh Feature Params
Ed Chin321b8fe2022-08-16 07:02:01374const FeatureEntry::FeatureParam kOneHourIntervalOneHourMaxAgeOnce[] = {
Ed Chin59f617b2022-07-19 22:12:04375 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
376 {kEnableRecurringBackgroundRefreshSchedule, "false"},
Ed Chin321b8fe2022-08-16 07:02:01377 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
Ed Chin59f617b2022-07-19 22:12:04378 {kBackgroundRefreshIntervalInSeconds, /* 60*60= */ "3600"}};
Ed Chin321b8fe2022-08-16 07:02:01379const FeatureEntry::FeatureParam kFourHourIntervalSixHourMaxAgeOnce[] = {
Ed Chin59f617b2022-07-19 22:12:04380 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
381 {kEnableRecurringBackgroundRefreshSchedule, "false"},
Ed Chin321b8fe2022-08-16 07:02:01382 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
Ed Chin59f617b2022-07-19 22:12:04383 {kBackgroundRefreshIntervalInSeconds, /* 4*60*60= */ "14400"}};
Ed Chin321b8fe2022-08-16 07:02:01384const FeatureEntry::FeatureParam kOneHourIntervalOneHourMaxAgeRecurring[] = {
Ed Chin59f617b2022-07-19 22:12:04385 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
386 {kEnableRecurringBackgroundRefreshSchedule, "true"},
Ed Chin321b8fe2022-08-16 07:02:01387 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
Ed Chin59f617b2022-07-19 22:12:04388 {kBackgroundRefreshIntervalInSeconds, /* 60*60= */ "3600"}};
Ed Chin321b8fe2022-08-16 07:02:01389const FeatureEntry::FeatureParam kFourHourIntervalSixHourMaxAgeRecurring[] = {
Ed Chin59f617b2022-07-19 22:12:04390 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
391 {kEnableRecurringBackgroundRefreshSchedule, "true"},
Ed Chin321b8fe2022-08-16 07:02:01392 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
Ed Chin59f617b2022-07-19 22:12:04393 {kBackgroundRefreshIntervalInSeconds, /* 4*60*60= */ "14400"}};
Ed Chin321b8fe2022-08-16 07:02:01394const FeatureEntry::FeatureParam kServerDrivenOneHourMaxAgeOnce[] = {
Ed Chin59f617b2022-07-19 22:12:04395 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
396 {kEnableRecurringBackgroundRefreshSchedule, "false"},
Ed Chin321b8fe2022-08-16 07:02:01397 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
398 {kBackgroundRefreshIntervalInSeconds, "0"}};
399const FeatureEntry::FeatureParam kServerDrivenOneHourMaxAgeRecurring[] = {
Ed Chin59f617b2022-07-19 22:12:04400 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
401 {kEnableRecurringBackgroundRefreshSchedule, "true"},
Ed Chin321b8fe2022-08-16 07:02:01402 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
403 {kBackgroundRefreshIntervalInSeconds, "0"}};
404const FeatureEntry::FeatureParam kServerDrivenSixHourMaxAgeOnce[] = {
405 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
406 {kEnableRecurringBackgroundRefreshSchedule, "false"},
407 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
408 {kBackgroundRefreshIntervalInSeconds, "0"}};
409const FeatureEntry::FeatureParam kServerDrivenSixHourMaxAgeRecurring[] = {
410 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
411 {kEnableRecurringBackgroundRefreshSchedule, "true"},
412 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
413 {kBackgroundRefreshIntervalInSeconds, "0"}};
Ed Chin59f617b2022-07-19 22:12:04414
415// Feed Background Refresh Feature Variations
Ed Chin59f617b2022-07-19 22:12:04416const FeatureEntry::FeatureVariation kFeedBackgroundRefreshVariations[] = {
Ed Chin321b8fe2022-08-16 07:02:01417 {"1hr Interval 1hr Max Age Once", kOneHourIntervalOneHourMaxAgeOnce,
418 std::size(kOneHourIntervalOneHourMaxAgeOnce), nullptr},
419 {"4hr Interval 6hr Max Age Once", kFourHourIntervalSixHourMaxAgeOnce,
420 std::size(kFourHourIntervalSixHourMaxAgeOnce), nullptr},
421 {"1hr Interval 1hr Max Age Recurring",
422 kOneHourIntervalOneHourMaxAgeRecurring,
423 std::size(kOneHourIntervalOneHourMaxAgeRecurring), nullptr},
424 {"4hr Interval 6hr Max Age Recurring",
425 kFourHourIntervalSixHourMaxAgeRecurring,
426 std::size(kFourHourIntervalSixHourMaxAgeRecurring), nullptr},
427 {"Server Driven 1hr Max Age Once", kServerDrivenOneHourMaxAgeOnce,
428 std::size(kServerDrivenOneHourMaxAgeOnce), nullptr},
429 {"Server Driven 1hr Max Age Recurring", kServerDrivenOneHourMaxAgeRecurring,
430 std::size(kServerDrivenOneHourMaxAgeRecurring), nullptr},
431 {"Server Driven 6hr Max Age Once", kServerDrivenSixHourMaxAgeOnce,
432 std::size(kServerDrivenSixHourMaxAgeOnce), nullptr},
433 {"Server Driven 6hr Max Age Recurring", kServerDrivenSixHourMaxAgeRecurring,
434 std::size(kServerDrivenSixHourMaxAgeRecurring), nullptr},
Ed Chin59f617b2022-07-19 22:12:04435};
Ed Chin91e44992022-07-27 13:42:34436#endif // BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
Ed Chin59f617b2022-07-19 22:12:04437
ginnnnnnny46435132022-06-01 16:06:04438const FeatureEntry::FeatureParam kFREDefaultBrowserPromoDefaultDelay[] = {
439 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoDefaultDelayParam}};
440const FeatureEntry::FeatureParam kFREDefaultBrowserPromoFirstRunOnly[] = {
441 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoFirstRunOnlyParam}};
442const FeatureEntry::FeatureParam kFREDefaultBrowserPromoShortDelay[] = {
443 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoShortDelayParam}};
444const FeatureEntry::FeatureVariation kFREDefaultBrowserPromoVariations[] = {
Aliona DANGLA8fae66f02021-10-06 15:47:11445 {"Wait 14 days after FRE default browser promo",
ginnnnnnny46435132022-06-01 16:06:04446 kFREDefaultBrowserPromoDefaultDelay,
447 std::size(kFREDefaultBrowserPromoDefaultDelay), nullptr},
448 {"FRE default browser promo only", kFREDefaultBrowserPromoFirstRunOnly,
449 std::size(kFREDefaultBrowserPromoFirstRunOnly), nullptr},
Aliona DANGLA8fae66f02021-10-06 15:47:11450 {"Wait 3 days after FRE default browser promo",
ginnnnnnny46435132022-06-01 16:06:04451 kFREDefaultBrowserPromoShortDelay,
452 std::size(kFREDefaultBrowserPromoShortDelay), nullptr},
Aliona DANGLA8fae66f02021-10-06 15:47:11453};
454
Chris Luc9a5cb12022-07-20 16:11:39455const FeatureEntry::FeatureParam kTrendingQueriesEnableAllUsers[] = {
456 {kTrendingQueriesHideShortcutsParam, "false"},
457 {kTrendingQueriesDisabledFeedParam, "false"},
458 {kTrendingQueriesSignedOutParam, "false"}};
459const FeatureEntry::FeatureParam kTrendingQueriesEnableAllUsersHideShortcuts[] =
460 {{kTrendingQueriesHideShortcutsParam, "true"},
461 {kTrendingQueriesDisabledFeedParam, "false"},
462 {kTrendingQueriesSignedOutParam, "false"}};
463const FeatureEntry::FeatureParam kTrendingQueriesEnableFeedDisabled[] = {
464 {kTrendingQueriesHideShortcutsParam, "false"},
465 {kTrendingQueriesDisabledFeedParam, "true"},
466 {kTrendingQueriesSignedOutParam, "false"}};
467const FeatureEntry::FeatureParam kTrendingQueriesEnableSignedOut[] = {
468 {kTrendingQueriesHideShortcutsParam, "true"},
469 {kTrendingQueriesDisabledFeedParam, "false"},
470 {kTrendingQueriesSignedOutParam, "true"}};
Chris Luecd575f2022-08-05 23:23:06471const FeatureEntry::FeatureParam
472 kTrendingQueriesEnableNeverShowHideShortcuts[] = {
473 {kTrendingQueriesHideShortcutsParam, "true"},
474 {kTrendingQueriesDisabledFeedParam, "false"},
475 {kTrendingQueriesSignedOutParam, "false"},
476 {kTrendingQueriesNeverShowModuleParam, "true"}};
Chris Luc9a5cb12022-07-20 16:11:39477
478const FeatureEntry::FeatureVariation kTrendingQueriesModuleVariations[] = {
479 {"Enabled All Users", kTrendingQueriesEnableAllUsers,
480 std::size(kTrendingQueriesEnableAllUsers), nullptr},
481 {"Enabled All Users Hide Shortcuts",
482 kTrendingQueriesEnableAllUsersHideShortcuts,
483 std::size(kTrendingQueriesEnableAllUsersHideShortcuts), nullptr},
484 {"Enabled Disabled Feed", kTrendingQueriesEnableFeedDisabled,
485 std::size(kTrendingQueriesEnableFeedDisabled), nullptr},
486 {"Enabled Signed Out", kTrendingQueriesEnableSignedOut,
487 std::size(kTrendingQueriesEnableSignedOut), nullptr},
Chris Luecd575f2022-08-05 23:23:06488 {"Enabled Never Show and Hide Shortcuts",
489 kTrendingQueriesEnableNeverShowHideShortcuts,
490 std::size(kTrendingQueriesEnableNeverShowHideShortcuts), nullptr},
491
Chris Luc9a5cb12022-07-20 16:11:39492};
493
jlebel041fc1c2022-03-04 12:53:30494const FeatureEntry::FeatureParam kNewMICEFREWithUMADialog[] = {
495 {kNewMobileIdentityConsistencyFREParam,
496 kNewMobileIdentityConsistencyFREParamUMADialog}};
Jérôme Lebel95010c2f2022-09-21 11:19:56497const FeatureEntry::FeatureParam kNewMICEFREWithTangibleSync[] = {
jlebel041fc1c2022-03-04 12:53:30498 {kNewMobileIdentityConsistencyFREParam,
Jérôme Lebel95010c2f2022-09-21 11:19:56499 kNewMobileIdentityConsistencyFREParamTangibleSync}};
jlebel041fc1c2022-03-04 12:53:30500const FeatureEntry::FeatureParam kNewMICEFREWithTwoSteps[] = {
501 {kNewMobileIdentityConsistencyFREParam,
502 kNewMobileIdentityConsistencyFREParamTwoSteps}};
503const FeatureEntry::FeatureVariation
504 kNewMobileIdentityConsistencyFREVariations[] = {
505 {"New FRE with UMA dialog", kNewMICEFREWithUMADialog,
506 std::size(kNewMICEFREWithUMADialog), nullptr},
Jérôme Lebel95010c2f2022-09-21 11:19:56507 {"new FRE with tangible sync", kNewMICEFREWithTangibleSync,
508 std::size(kNewMICEFREWithTangibleSync), nullptr},
jlebel041fc1c2022-03-04 12:53:30509 {"new FRE with 2 steps", kNewMICEFREWithTwoSteps,
510 std::size(kNewMICEFREWithTwoSteps), nullptr}};
511
Louis Romero023cc5052022-04-08 23:29:39512const FeatureEntry::FeatureParam kBubbleRichIPHTargetHighlight[] = {
513 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterTargetHighlight}};
Christian Xubd60c4b72022-03-22 15:25:01514const FeatureEntry::FeatureParam kBubbleRichIPHExplicitDismissal[] = {
515 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterExplicitDismissal}};
516const FeatureEntry::FeatureParam kBubbleRichIPHRich[] = {
517 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRich}};
518const FeatureEntry::FeatureParam kBubbleRichIPHRichWithSnooze[] = {
519 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRichWithSnooze}};
520const FeatureEntry::FeatureVariation kBubbleRichIPHVariations[] = {
Louis Romero023cc5052022-04-08 23:29:39521 {"Target Highlight", kBubbleRichIPHTargetHighlight,
522 std::size(kBubbleRichIPHTargetHighlight), nullptr},
Christian Xubd60c4b72022-03-22 15:25:01523 {"Explicit dismissal", kBubbleRichIPHExplicitDismissal,
524 std::size(kBubbleRichIPHExplicitDismissal), nullptr},
525 {"Dismissal and rich content", kBubbleRichIPHRich,
526 std::size(kBubbleRichIPHRich), nullptr},
Louis Romero023cc5052022-04-08 23:29:39527 {"Dismissal, rich content, and snooze", kBubbleRichIPHRichWithSnooze,
Christian Xubd60c4b72022-03-22 15:25:01528 std::size(kBubbleRichIPHRichWithSnooze), nullptr},
529};
530
Christian Xubdedabec2022-07-04 10:00:13531const FeatureEntry::FeatureParam kOmniboxPasteButtonBlueIconCapsule[] = {
532 {kOmniboxPasteButtonParameterName,
533 kOmniboxPasteButtonParameterBlueIconCapsule}};
534const FeatureEntry::FeatureParam kOmniboxPasteButtonBlueFullCapsule[] = {
535 {kOmniboxPasteButtonParameterName,
536 kOmniboxPasteButtonParameterBlueFullCapsule}};
537const FeatureEntry::FeatureVariation kOmniboxPasteButtonVariations[] = {
538 {"Icon only", kOmniboxPasteButtonBlueIconCapsule,
539 std::size(kOmniboxPasteButtonBlueIconCapsule), nullptr},
540 {"Icon and text", kOmniboxPasteButtonBlueFullCapsule,
541 std::size(kOmniboxPasteButtonBlueFullCapsule), nullptr},
542};
543
Gauthier Ambard30ad9ca2022-06-09 14:15:26544const FeatureEntry::FeatureParam kPopupMenuBookmarkStringAddABookmark[] = {
545 {kPopupMenuBookmarkStringParamName,
546 kPopupMenuBookmarkStringParamAddABookmark}};
547const FeatureEntry::FeatureParam kPopupMenuBookmarkStringAddToBookmarks[] = {
548 {kPopupMenuBookmarkStringParamName,
549 kPopupMenuBookmarkStringParamAddToBookmarks}};
550const FeatureEntry::FeatureParam kPopupMenuBookmarkStringBookmarkThisPage[] = {
551 {kPopupMenuBookmarkStringParamName,
552 kPopupMenuBookmarkStringParamBookmarkThisPage}};
553
554const FeatureEntry::FeatureVariation kPopupMenuBookmarkStringVarations[] = {
555 {"(Add A Bookmark)", kPopupMenuBookmarkStringAddABookmark,
556 std::size(kPopupMenuBookmarkStringAddABookmark), nullptr},
557 {"(Add To Bookmarks)", kPopupMenuBookmarkStringAddToBookmarks,
558 std::size(kPopupMenuBookmarkStringAddToBookmarks), nullptr},
559 {"(Bookmark This Page)", kPopupMenuBookmarkStringBookmarkThisPage,
560 std::size(kPopupMenuBookmarkStringBookmarkThisPage), nullptr}};
561
Igor Ruvinov44fed9f2022-06-10 22:51:42562const FeatureEntry::FeatureParam kDmTokenDeletionParam[] = {{"forced", "true"}};
563const FeatureEntry::FeatureVariation kDmTokenDeletionVariation[] = {
564 {"(Forced)", kDmTokenDeletionParam, std::size(kDmTokenDeletionParam),
565 nullptr}};
566
Aliona DANGLAa5257ccc2022-08-29 14:01:49567const FeatureEntry::FeatureParam kOpenInDownloadWithWKDownload[] = {
568 {kOpenInDownloadWithWKDownloadParam, "true"}};
569const FeatureEntry::FeatureParam kOpenInDownloadWithV2[] = {
570 {kOpenInDownloadWithV2Param, "true"}};
571const FeatureEntry::FeatureVariation kOpenInDownloadVariations[] = {
572 {"With WKDownload", kOpenInDownloadWithWKDownload,
573 std::size(kOpenInDownloadWithWKDownload), nullptr},
574 {"With V2", kOpenInDownloadWithV2, std::size(kOpenInDownloadWithV2),
575 nullptr},
576};
577
ginnnnnnny591a4972022-09-01 16:10:27578const FeatureEntry::FeatureParam kAutofillBrandingIOSMonotone[] = {
579 {autofill::features::kAutofillBrandingIOSParam, "true"}};
580const FeatureEntry::FeatureVariation kAutofillBrandingIOSVariations[] = {
581 {"(Monotone)", kAutofillBrandingIOSMonotone,
582 std::size(kAutofillBrandingIOSMonotone), nullptr}};
583
Scott Yodercb2fe632022-09-12 15:28:35584const FeatureEntry::FeatureParam kIOSNewPostRestoreExperienceMinimal[] = {
Benjamin Williams3d3a2ec2022-09-13 20:01:26585 {post_restore_signin::features::kIOSNewPostRestoreExperienceParam, "true"}};
Scott Yodercb2fe632022-09-12 15:28:35586const FeatureEntry::FeatureVariation kIOSNewPostRestoreExperienceVariations[] =
587 {{"minimal", kIOSNewPostRestoreExperienceMinimal,
588 std::size(kIOSNewPostRestoreExperienceMinimal), nullptr}};
589
Cooper Knaak1e026562017-07-26 05:22:28590// To add a new entry, add to the end of kFeatureEntries. There are four
sdefresne14900ee2015-11-27 14:43:21591// distinct types of entries:
Cooper Knaak1e026562017-07-26 05:22:28592// . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the
593// default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE
sdefresne14900ee2015-11-27 14:43:21594// macro for this type supplying the command line to the macro.
595// . MULTI_VALUE: a list of choices, the first of which should correspond to a
596// deactivated state for this lab (i.e. no command line option). To specify
597// this type of entry use the macro MULTI_VALUE_TYPE supplying it the
598// array of choices.
Cooper Knaak1e026562017-07-26 05:22:28599// . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is
600// either enabled, disabled, or uses the default value of the associated
601// base::Feature instance. To specify this type of entry use the macro
602// FEATURE_VALUE_TYPE supplying it the base::Feature instance.
603// . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a
604// base::Feature instance. Choices corresponding to the default state, a
605// universally enabled state, and a universally disabled state are
606// automatically included. To specify this type of entry use the macro
607// FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and
608// the array of choices.
609//
sdefresne14900ee2015-11-27 14:43:21610// See the documentation of FeatureEntry for details on the fields.
611//
612// When adding a new choice, add it to the end of the list.
613const flags_ui::FeatureEntry kFeatureEntries[] = {
Cooper Knaak1e026562017-07-26 05:22:28614 {"in-product-help-demo-mode-choice",
615 flag_descriptions::kInProductHelpDemoModeName,
616 flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos,
617 FEATURE_WITH_PARAMS_VALUE_TYPE(
Tommy Nyquistc1d6dea12017-07-26 20:37:23618 feature_engagement::kIPHDemoMode,
619 feature_engagement::kIPHDemoModeChoiceVariations,
Marc Treib2752e8b2017-08-04 14:12:09620 "IPH_DemoMode")},
Moe Ahmadic3fd7cd2018-05-11 21:40:22621 {"enable-autofill-credit-card-upload",
622 flag_descriptions::kAutofillCreditCardUploadName,
623 flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos,
Anne Lim579b5732018-08-30 18:24:24624 FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)},
Tina Wang41d431c2021-06-21 21:04:13625 {"enable-discover-feed-preview",
626 flag_descriptions::kEnableDiscoverFeedPreviewName,
627 flag_descriptions::kEnableDiscoverFeedPreviewDescription, flags_ui::kOsIos,
628 FEATURE_VALUE_TYPE(kEnableDiscoverFeedPreview)},
Moe Ahmadid6d5d172018-06-20 17:20:23629 {"use-sync-sandbox", flag_descriptions::kSyncSandboxName,
630 flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos,
631 SINGLE_VALUE_TYPE_AND_VALUE(
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51632 syncer::kSyncServiceURL,
Moe Ahmadid6d5d172018-06-20 17:20:23633 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")},
634 {"wallet-service-use-sandbox",
635 flag_descriptions::kWalletServiceUseSandboxName,
636 flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos,
637 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
638 autofill::switches::kWalletServiceUseSandbox,
639 "1",
640 autofill::switches::kWalletServiceUseSandbox,
641 "0")},
Mohamad Ahmadic4df81f2017-12-20 04:41:59642 {"show-autofill-type-predictions",
643 flag_descriptions::kShowAutofillTypePredictionsName,
644 flag_descriptions::kShowAutofillTypePredictionsDescription,
645 flags_ui::kOsIos,
Gauthier Ambardcfd85182018-01-05 10:37:46646 FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)},
Olivier Robin3d60411622018-02-23 10:03:22647 {"autofill-ios-delay-between-fields",
648 flag_descriptions::kAutofillIOSDelayBetweenFieldsName,
649 flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription,
650 flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)},
Benjamin Williams14233d72022-07-26 18:32:20651 {"fullscreen-promos-manager",
652 flag_descriptions::kFullscreenPromosManagerName,
653 flag_descriptions::kFullscreenPromosManagerDescription, flags_ui::kOsIos,
654 FEATURE_VALUE_TYPE(kFullscreenPromosManager)},
Kurt Horimotodc33af32018-05-01 01:39:14655 {"fullscreen-viewport-adjustment-experiment",
Chris Lu481a9322019-09-25 22:16:53656 flag_descriptions::kFullscreenSmoothScrollingName,
657 flag_descriptions::kFullscreenSmoothScrollingDescription, flags_ui::kOsIos,
658 FEATURE_VALUE_TYPE(fullscreen::features::kSmoothScrollingDefault)},
Robbie Gibson1f37a5e2020-08-06 17:03:06659 {"webpage-default-zoom-from-dynamic-type",
660 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeName,
661 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeDescription,
662 flags_ui::kOsIos,
663 FEATURE_VALUE_TYPE(web::kWebPageDefaultZoomFromDynamicType)},
Robbie Gibson88f23962020-09-28 14:35:56664 {"webpage-alternative-text-zoom",
665 flag_descriptions::kWebPageAlternativeTextZoomName,
666 flag_descriptions::kWebPageAlternativeTextZoomDescription,
667 flags_ui::kOsIos, FEATURE_VALUE_TYPE(web::kWebPageAlternativeTextZoom)},
Robbie Gibson1095b72c2022-06-06 17:03:34668 {"webpage-text-zoom-ipad", flag_descriptions::kWebPageTextZoomIPadName,
669 flag_descriptions::kWebPageTextZoomIPadDescription, flags_ui::kOsIos,
670 FEATURE_VALUE_TYPE(web::kWebPageTextZoomIPad)},
Kurt Horimoto79d590b2018-09-12 19:09:28671 {"toolbar-container", flag_descriptions::kToolbarContainerName,
672 flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos,
673 FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)},
Stepan Khapugincc4e9842019-01-23 13:38:13674 {"omnibox-ui-max-autocomplete-matches",
675 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName,
676 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription,
677 flags_ui::kOsIos,
678 FEATURE_WITH_PARAMS_VALUE_TYPE(
679 omnibox::kUIExperimentMaxAutocompleteMatches,
680 kOmniboxUIMaxAutocompleteMatchesVariations,
681 "OmniboxUIMaxAutocompleteVariations")},
Moe Ahmadi01028f22022-08-06 17:57:35682 {"omnibox-local-history-zero-suggest-beyond-ntp",
683 flag_descriptions::kOmniboxLocalHistoryZeroSuggestBeyondNTPName,
684 flag_descriptions::kOmniboxLocalHistoryZeroSuggestBeyondNTPDescription,
685 flags_ui::kOsIos,
686 FEATURE_VALUE_TYPE(omnibox::kLocalHistoryZeroSuggestBeyondNTP)},
Stepan Khapuginbac467e2022-05-06 21:11:54687 {"omnibox-max-zps-matches", flag_descriptions::kOmniboxMaxZPSMatchesName,
688 flag_descriptions::kOmniboxMaxZPSMatchesDescription, flags_ui::kOsIos,
689 FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kMaxZeroSuggestMatches,
690 kOmniboxMaxZPSMatchesVariations,
691 "OmniboxMaxZPSVariations")},
Peter Boström3f798572022-07-26 23:44:36692#if BUILDFLAG(DCHECK_IS_CONFIGURABLE)
Justin Cohen20b6f072019-01-16 01:38:50693 {"dcheck-is-fatal", flag_descriptions::kDcheckIsFatalName,
694 flag_descriptions::kDcheckIsFatalDescription, flags_ui::kOsIos,
695 FEATURE_VALUE_TYPE(base::kDCheckIsFatalFeature)},
Peter Boström3f798572022-07-26 23:44:36696#endif // BUILDFLAG(DCHECK_IS_CONFIGURABLE)
Caitlin Fischer43edd90a2019-05-01 13:24:30697 {"autofill-use-mobile-label-disambiguation",
698 flag_descriptions::kAutofillUseMobileLabelDisambiguationName,
699 flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription,
700 flags_ui::kOsIos,
Caitlin Fischer37e01232019-05-24 13:05:45701 FEATURE_WITH_PARAMS_VALUE_TYPE(
702 autofill::features::kAutofillUseMobileLabelDisambiguation,
703 kAutofillUseMobileLabelDisambiguationVariations,
704 "AutofillUseMobileLabelDisambiguation")},
Olivier Robin43814bb2021-06-22 15:25:45705 {"metrickit-crash-reports", flag_descriptions::kMetrickitCrashReportName,
706 flag_descriptions::kMetrickitCrashReportDescription, flags_ui::kOsIos,
707 FEATURE_VALUE_TYPE(kMetrickitCrashReport)},
Mike Doughertyb6c770d2019-09-13 22:56:46708 {"ios-breadcrumbs", flag_descriptions::kLogBreadcrumbsName,
709 flag_descriptions::kLogBreadcrumbsDescription, flags_ui::kOsIos,
Jesse McKenna85c1a59f2021-05-05 19:08:30710 FEATURE_VALUE_TYPE(breadcrumbs::kLogBreadcrumbs)},
Eugene But2823dc7e2020-07-21 18:10:37711 {"ios-synthetic-crash-reports",
712 flag_descriptions::kSyntheticCrashReportsForUteName,
713 flag_descriptions::kSyntheticCrashReportsForUteDescription,
714 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSyntheticCrashReportsForUte)},
Jérôme Lebelc374fdd2019-09-27 10:36:48715 {"force-startup-signin-promo",
716 flag_descriptions::kForceStartupSigninPromoName,
717 flag_descriptions::kForceStartupSigninPromoDescription, flags_ui::kOsIos,
Alice Wang345e09442021-07-05 09:03:29718 FEATURE_VALUE_TYPE(switches::kForceStartupSigninPromo)},
Yoichi Osato7ae11752021-03-16 03:27:22719 {"restore-session-from-cache",
720 flag_descriptions::kRestoreSessionFromCacheName,
721 flag_descriptions::kRestoreSessionFromCacheDescription, flags_ui::kOsIos,
Justin Cohen3ec2522c2021-04-23 18:23:49722 FEATURE_VALUE_TYPE(web::kRestoreSessionFromCache)},
sczs4622e6e2019-11-06 01:17:59723 {"autofill-save-card-dismiss-on-navigation",
724 flag_descriptions::kAutofillSaveCardDismissOnNavigationName,
725 flag_descriptions::kAutofillSaveCardDismissOnNavigationDescription,
726 flags_ui::kOsIos,
727 FEATURE_VALUE_TYPE(
728 autofill::features::kAutofillSaveCardDismissOnNavigation)},
sczs37d9c132020-07-18 06:06:33729 {"new-content-suggestions-feed", flag_descriptions::kDiscoverFeedInNtpName,
adamta22a4d502020-05-21 03:12:21730 flag_descriptions::kDiscoverFeedInNtpDescription, flags_ui::kOsIos,
gogeralddb0d8ae2020-11-13 03:56:58731 FEATURE_WITH_PARAMS_VALUE_TYPE(kDiscoverFeedInNtp,
732 kDiscoverFeedInNtpVariations,
733 "IOSDiscoverFeed")},
Roberto Mourab87b9722020-06-17 17:12:09734 {"expanded-tab-strip", flag_descriptions::kExpandedTabStripName,
735 flag_descriptions::kExpandedTabStripDescription, flags_ui::kOsIos,
736 FEATURE_VALUE_TYPE(kExpandedTabStrip)},
Tommy Martino6b4eb7e2020-06-25 18:25:41737 {"shared-highlighting-ios", flag_descriptions::kSharedHighlightingIOSName,
738 flag_descriptions::kSharedHighlightingIOSDescription, flags_ui::kOsIos,
739 FEATURE_VALUE_TYPE(kSharedHighlightingIOS)},
Veronique Nguyen6593c762021-11-30 17:28:56740 {"enable-fre-ui-module-ios-with-options",
741 flag_descriptions::kEnableFREUIModuleIOSName,
Tina Wanga252ca42021-04-01 17:14:23742 flag_descriptions::kEnableFREUIModuleIOSDescription, flags_ui::kOsIos,
ginnnnnnny429b5522022-05-05 03:50:06743 FEATURE_VALUE_TYPE(kEnableFREUIModuleIOS)},
jlebel041fc1c2022-03-04 12:53:30744 {"new-mobile-identity-consistency-fre",
745 flag_descriptions::kNewMobileIdentityConsistencyFREName,
746 flag_descriptions::kNewMobileIdentityConsistencyFREDescription,
747 flags_ui::kOsIos,
748 FEATURE_WITH_PARAMS_VALUE_TYPE(signin::kNewMobileIdentityConsistencyFRE,
749 kNewMobileIdentityConsistencyFREVariations,
ginnnnnnny46435132022-06-01 16:06:04750 kIOSMICeAndDefaultBrowserTrialName)},
Sylvain Defresne9c107082020-10-27 16:39:13751#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
edchin81467b82020-09-03 19:31:45752 {"screen-time-integration-ios",
753 flag_descriptions::kScreenTimeIntegrationName,
754 flag_descriptions::kScreenTimeIntegrationDescription, flags_ui::kOsIos,
755 FEATURE_VALUE_TYPE(kScreenTimeIntegration)},
Sylvain Defresne9c107082020-10-27 16:39:13756#endif
Nazerke3e993f72020-09-21 13:00:06757 {"modern-tab-strip", flag_descriptions::kModernTabStripName,
758 flag_descriptions::kModernTabStripDescription, flags_ui::kOsIos,
759 FEATURE_VALUE_TYPE(kModernTabStrip)},
Nohemi Fernandez222d6d42020-09-30 20:35:57760 {"minutes-delay-to-restore-gaia-cookies-if-deleted",
761 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieName,
762 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieDescription,
763 flags_ui::kOsIos,
764 MULTI_VALUE_TYPE(kDelayThresholdMinutesToUpdateGaiaCookieChoices)},
Eugene Butf869bff2020-12-10 01:16:55765 {"record-snapshot-size", flag_descriptions::kRecordSnapshotSizeName,
766 flag_descriptions::kRecordSnapshotSizeDescription, flags_ui::kOsIos,
767 FEATURE_VALUE_TYPE(web::features::kRecordSnapshotSize)},
Chris Lub17195f2020-12-10 20:49:14768 {"default-browser-fullscreen-promo-experiment",
769 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentName,
770 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentDescription,
771 flags_ui::kOsIos,
Javier Ernesto Flores Robles159414232021-06-16 14:29:59772 FEATURE_WITH_PARAMS_VALUE_TYPE(
773 kDefaultBrowserFullscreenPromoExperiment,
774 kDefaultBrowserFullscreenPromoExperimentVariations,
775 "IOSDefaultBrowserFullscreenPromoExperiment")},
Cheick Cisse76ade3d2020-12-16 00:15:11776 {"ios-shared-highlighting-color-change",
777 flag_descriptions::kIOSSharedHighlightingColorChangeName,
778 flag_descriptions::kIOSSharedHighlightingColorChangeDescription,
Cheick Cissed0b5bfe2021-02-11 14:23:07779 flags_ui::kOsIos,
780 FEATURE_VALUE_TYPE(web::features::kIOSSharedHighlightingColorChange)},
Cheick Cissefe994862021-12-15 16:01:34781 {"ios-shared-highlighting-v2",
782 flag_descriptions::kIOSSharedHighlightingV2Name,
783 flag_descriptions::kIOSSharedHighlightingV2Description, flags_ui::kOsIos,
784 FEATURE_VALUE_TYPE(shared_highlighting::kIOSSharedHighlightingV2)},
Stepan Khapugin04341202021-01-07 12:22:45785 {"omnibox-new-textfield-implementation",
786 flag_descriptions::kOmniboxNewImplementationName,
787 flag_descriptions::kOmniboxNewImplementationDescription, flags_ui::kOsIos,
788 FEATURE_VALUE_TYPE(kIOSNewOmniboxImplementation)},
Stepan Khapugin0be8f6d2022-09-21 20:22:26789 {"omnibox-on-focus-suggestions-contextual-web",
790 flag_descriptions::kOmniboxFocusTriggersContextualWebZeroSuggestName,
791 flag_descriptions::
792 kOmniboxFocusTriggersContextualWebZeroSuggestDescription,
793 flags_ui::kOsIos,
794 FEATURE_VALUE_TYPE(omnibox::kFocusTriggersContextualWebZeroSuggest)},
795 {"omnibox-on-focus-suggestions-srp",
796 flag_descriptions::kOmniboxFocusTriggersSRPZeroSuggestName,
797 flag_descriptions::kOmniboxFocusTriggersSRPZeroSuggestDescription,
798 flags_ui::kOsIos,
799 FEATURE_VALUE_TYPE(omnibox::kFocusTriggersSRPZeroSuggest)},
Stepan Khapuginecf128a92022-08-30 11:23:15800 {"omnibox-fuzzy-url-suggestions",
801 flag_descriptions::kOmniboxFuzzyUrlSuggestionsName,
802 flag_descriptions::kOmniboxFuzzyUrlSuggestionsDescription,
803 flags_ui::kOsIos,
804 FEATURE_VALUE_TYPE(omnibox::kOmniboxFuzzyUrlSuggestions)},
Stepan Khapugin422f08d2022-02-18 16:19:44805 {"omnibox-new-popup-ui", flag_descriptions::kIOSOmniboxUpdatedPopupUIName,
806 flag_descriptions::kIOSOmniboxUpdatedPopupUIDescription, flags_ui::kOsIos,
Robbie Gibson46351032022-03-31 19:46:23807 FEATURE_WITH_PARAMS_VALUE_TYPE(kIOSOmniboxUpdatedPopupUI,
808 kiOSOmniboxUpdatedPopupUIVariations,
Stepan Khapugina45baed2022-05-13 19:15:43809 "IOSOmniboxUpdatedPopupUI")},
gogerald0ff29e52021-02-03 18:56:19810 {"start-surface", flag_descriptions::kStartSurfaceName,
811 flag_descriptions::kStartSurfaceDescription, flags_ui::kOsIos,
gogerald0e39e3aa2021-02-10 18:41:23812 FEATURE_WITH_PARAMS_VALUE_TYPE(kStartSurface,
813 kStartSurfaceVariations,
814 "StartSurface")},
Justin Cohen13ac7a202021-02-04 18:27:28815 {"ios-crashpad", flag_descriptions::kCrashpadIOSName,
816 flag_descriptions::kCrashpadIOSDescription, flags_ui::kOsIos,
817 FEATURE_VALUE_TYPE(kCrashpadIOS)},
Vidhan Jain451b4752021-07-15 10:16:42818 {"autofill-address-verification-in-save-prompt",
819 flag_descriptions::kEnableAutofillAddressSavePromptAddressVerificationName,
820 flag_descriptions::
821 kEnableAutofillAddressSavePromptAddressVerificationDescription,
822 flags_ui::kOsIos,
823 FEATURE_VALUE_TYPE(
824 autofill::features::
825 kAutofillAddressProfileSavePromptAddressVerificationSupport)},
Vidhan Jaina65741552021-03-09 17:18:27826 {"autofill-address-save-prompt",
827 flag_descriptions::kEnableAutofillAddressSavePromptName,
828 flag_descriptions::kEnableAutofillAddressSavePromptDescription,
829 flags_ui::kOsIos,
830 FEATURE_VALUE_TYPE(autofill::features::kAutofillAddressProfileSavePrompt)},
Viktor Semeniuk68e794a2021-03-24 10:23:25831 {"filling-across-affiliated-websites",
832 flag_descriptions::kFillingAcrossAffiliatedWebsitesName,
833 flag_descriptions::kFillingAcrossAffiliatedWebsitesDescription,
834 flags_ui::kOsIos,
835 FEATURE_VALUE_TYPE(
836 password_manager::features::kFillingAcrossAffiliatedWebsites)},
Jared Sauld47c2b72021-03-25 22:47:31837 {"autofill-parse-merchant-promo-code-fields",
838 flag_descriptions::kAutofillParseMerchantPromoCodeFieldsName,
839 flag_descriptions::kAutofillParseMerchantPromoCodeFieldsDescription,
840 flags_ui::kOsIos,
841 FEATURE_VALUE_TYPE(
842 autofill::features::kAutofillParseMerchantPromoCodeFields)},
edchin257cea2f2021-04-07 13:07:13843 {"interest-feed-v2-clicks-and-views-cond-upload",
844 flag_descriptions::kInterestFeedV2ClickAndViewActionsConditionalUploadName,
845 flag_descriptions::
846 kInterestFeedV2ClickAndViewActionsConditionalUploadDescription,
847 flags_ui::kOsIos,
848 FEATURE_VALUE_TYPE(feed::kInterestFeedV2ClicksAndViewsConditionalUpload)},
Side Yilmaz6c53f7102021-09-07 13:26:19849 {"incognito-ntp-revamp", flag_descriptions::kIncognitoNtpRevampName,
850 flag_descriptions::kIncognitoNtpRevampDescription, flags_ui::kOsIos,
851 FEATURE_VALUE_TYPE(kIncognitoNtpRevamp)},
Side YILMAZ4b40a3082022-04-11 10:13:33852 {"update-history-entry-points-in-incognito",
853 flag_descriptions::kUpdateHistoryEntryPointsInIncognitoName,
854 flag_descriptions::kUpdateHistoryEntryPointsInIncognitoDescription,
855 flags_ui::kOsIos,
856 FEATURE_VALUE_TYPE(kUpdateHistoryEntryPointsInIncognito)},
jlebeld95434d652021-06-22 10:32:48857 {"sync-trusted-vault-passphrase-ios-rpc",
858 flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCName,
859 flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCDescription,
860 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51861 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseiOSRPC)},
Mikel Astiz850b0fe2021-06-16 09:47:27862 {"sync-trusted-vault-passphrase-promo",
863 flag_descriptions::kSyncTrustedVaultPassphrasePromoName,
864 flag_descriptions::kSyncTrustedVaultPassphrasePromoDescription,
865 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51866 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphrasePromo)},
Mikel Astiz850b0fe2021-06-16 09:47:27867 {"sync-trusted-vault-passphrase-recovery",
868 flag_descriptions::kSyncTrustedVaultPassphraseRecoveryName,
869 flag_descriptions::kSyncTrustedVaultPassphraseRecoveryDescription,
870 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51871 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseRecovery)},
Nohemi Fernandezc00842a2021-07-26 11:47:34872 {"wait-threshold-seconds-for-capabilities-api",
873 flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiName,
874 flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiDescription,
875 flags_ui::kOsIos,
876 MULTI_VALUE_TYPE(kWaitThresholdMillisecondsForCapabilitiesApiChoices)},
Jared Saul2188f762021-08-02 21:22:23877 {"autofill-fill-merchant-promo-code-fields",
878 flag_descriptions::kAutofillFillMerchantPromoCodeFieldsName,
879 flag_descriptions::kAutofillFillMerchantPromoCodeFieldsDescription,
880 flags_ui::kOsIos,
881 FEATURE_VALUE_TYPE(
882 autofill::features::kAutofillFillMerchantPromoCodeFields)},
Sylvain Defresnedff67e42021-09-24 09:43:03883 {"new-overflow-menu", flag_descriptions::kNewOverflowMenuName,
884 flag_descriptions::kNewOverflowMenuDescription, flags_ui::kOsIos,
885 FEATURE_VALUE_TYPE(kNewOverflowMenu)},
Robbie Gibsondf097a72022-09-05 08:17:18886 {"new-overflow-menu-alternate-iph",
887 flag_descriptions::kNewOverflowMenuAlternateIPHName,
888 flag_descriptions::kNewOverflowMenuAlternateIPHDescription,
889 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kNewOverflowMenuAlternateIPH)},
Robbie Gibsonfe748e52022-05-09 18:20:46890 {"new-overflow-menu-settings-action",
891 flag_descriptions::kNewOverflowMenuSettingsActionName,
Robbie Gibsone2ad5632022-05-16 20:46:10892 flag_descriptions::kNewOverflowMenuSettingsActionDescription,
893 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kNewOverflowMenuSettingsAction)},
894 {"new-overflow-menu-simple-destination-icons",
895 flag_descriptions::kNewOverflowMenuSimpleDestinationIconsName,
896 flag_descriptions::kNewOverflowMenuSimpleDestinationIconsDescription,
897 flags_ui::kOsIos,
898 FEATURE_VALUE_TYPE(kNewOverflowMenuSimpleDestinationIcons)},
Robbie Gibson640bccb32022-05-10 18:43:35899 {"new-overflow-menu-cbd-action",
900 flag_descriptions::kNewOverflowMenuCBDActionName,
901 flag_descriptions::kNewOverflowMenuCBDActionDescription, flags_ui::kOsIos,
902 FEATURE_VALUE_TYPE(kNewOverflowMenuCBDAction)},
Evan Bernstein0a85f332021-09-29 19:07:24903 {"use-lens-to-search-for-image",
904 flag_descriptions::kUseLensToSearchForImageName,
905 flag_descriptions::kUseLensToSearchForImageDescription, flags_ui::kOsIos,
Ali Juma02a9b7b2021-10-01 13:44:44906 FEATURE_VALUE_TYPE(kUseLensToSearchForImage)},
Jason Hu3830a072022-08-19 20:56:22907 {"enable-lens-in-home-screen-widget",
908 flag_descriptions::kEnableLensInHomeScreenWidgetName,
909 flag_descriptions::kEnableLensInHomeScreenWidgetDescription,
910 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableLensInHomeScreenWidget)},
911 {"enable-lens-in-keyboard", flag_descriptions::kEnableLensInKeyboardName,
912 flag_descriptions::kEnableLensInKeyboardDescription, flags_ui::kOsIos,
913 FEATURE_VALUE_TYPE(kEnableLensInKeyboard)},
914 {"enable-lens-in-ntp", flag_descriptions::kEnableLensInNTPName,
915 flag_descriptions::kEnableLensInNTPDescription, flags_ui::kOsIos,
916 FEATURE_VALUE_TYPE(kEnableLensInNTP)},
Benjamin Williamsbee6ab62022-02-28 18:09:40917 {"use-load-simulated-request-for-error-page-navigation",
Gauthier Ambard33cceaf2022-05-05 14:00:23918 flag_descriptions::kUseLoadSimulatedRequestForOfflinePageName,
919 flag_descriptions::kUseLoadSimulatedRequestForOfflinePageDescription,
Benjamin Williamsbee6ab62022-02-28 18:09:40920 flags_ui::kOsIos,
Gauthier Ambard33cceaf2022-05-05 14:00:23921 FEATURE_VALUE_TYPE(web::features::kUseLoadSimulatedRequestForOfflinePage)},
Sergio Collazos9fcc6ed2021-10-06 00:58:03922 {"enable-discover-feed-static-resource-serving",
923 flag_descriptions::kEnableDiscoverFeedStaticResourceServingName,
924 flag_descriptions::kEnableDiscoverFeedStaticResourceServingDescription,
925 flags_ui::kOsIos,
926 FEATURE_WITH_PARAMS_VALUE_TYPE(
927 kEnableDiscoverFeedStaticResourceServing,
928 kEnableDiscoverFeedStaticResourceServingVariations,
929 "IOSDiscoverFeedStaticResourceServing")},
930 {"enable-disco-feed-endpoint",
931 flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointName,
932 flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointDescription,
933 flags_ui::kOsIos,
Aliona DANGLA8fae66f02021-10-06 15:47:11934 FEATURE_VALUE_TYPE(kEnableDiscoverFeedDiscoFeedEndpoint)},
Mohammad Refaatab6bee62022-05-16 16:31:15935 {"enable-discover-feed-top-sync-promo",
936 flag_descriptions::kEnableDiscoverFeedTopSyncPromoName,
937 flag_descriptions::kEnableDiscoverFeedTopSyncPromoDescription,
938 flags_ui::kOsIos,
939 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableDiscoverFeedTopSyncPromo,
940 kDiscoverFeedTopSyncPromoVariations,
941 "EnableDiscoverFeedTopSyncPromo")},
Aliona DANGLA8fae66f02021-10-06 15:47:11942 {"enable-fre-default-browser-screen-testing",
ginnnnnnny46435132022-06-01 16:06:04943 flag_descriptions::kEnableFREDefaultBrowserPromoScreenName,
944 flag_descriptions::kEnableFREDefaultBrowserPromoScreenDescription,
Aliona DANGLA8fae66f02021-10-06 15:47:11945 flags_ui::kOsIos,
ginnnnnnny46435132022-06-01 16:06:04946 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFREDefaultBrowserPromoScreen,
947 kFREDefaultBrowserPromoVariations,
948 kIOSMICeAndDefaultBrowserTrialName)},
Tommy Martino7393d762021-10-12 17:59:28949 {"shared-highlighting-amp",
950 flag_descriptions::kIOSSharedHighlightingAmpName,
951 flag_descriptions::kIOSSharedHighlightingAmpDescription, flags_ui::kOsIos,
952 FEATURE_VALUE_TYPE(shared_highlighting::kSharedHighlightingAmp)},
David Maunderf4a5e1e2021-10-18 17:24:28953 {"enable-commerce-price-tracking",
Matt Jones125dfb42022-02-11 17:23:42954 commerce::flag_descriptions::kCommercePriceTrackingName,
955 commerce::flag_descriptions::kCommercePriceTrackingDescription,
956 flags_ui::kOsIos,
957 FEATURE_WITH_PARAMS_VALUE_TYPE(commerce::kCommercePriceTracking,
958 commerce::kCommercePriceTrackingVariations,
adamta67b6c5812021-10-19 17:02:15959 "CommercePriceTracking")},
Tina Wang8058d5f2021-11-04 20:06:06960 {"web-feed-ios", flag_descriptions::kEnableWebChannelsName,
961 flag_descriptions::kEnableWebChannelsDescription, flags_ui::kOsIos,
962 FEATURE_VALUE_TYPE(kEnableWebChannels)},
adamta39331592021-11-01 20:18:54963 {"ntp-view-hierarchy-repair",
964 flag_descriptions::kNTPViewHierarchyRepairName,
965 flag_descriptions::kNTPViewHierarchyRepairDescription, flags_ui::kOsIos,
966 FEATURE_VALUE_TYPE(kNTPViewHierarchyRepair)},
Justin Cohen69cec682021-11-04 20:10:26967 {"synthesized-restore-session",
968 flag_descriptions::kSynthesizedRestoreSessionName,
969 flag_descriptions::kSynthesizedRestoreSessionDescription, flags_ui::kOsIos,
970 FEATURE_VALUE_TYPE(web::features::kSynthesizedRestoreSession)},
Benjamin Williams0e7e2fb2021-11-17 03:03:41971 {"enable-password-manager-branding-update",
972 flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateName,
973 flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateDescription,
974 flags_ui::kOsIos,
Aliona DANGLAe5b0b6e52021-11-30 11:58:19975 FEATURE_VALUE_TYPE(
976 password_manager::features::kIOSEnablePasswordManagerBrandingUpdate)},
ginnnnnnnyee3036e2022-08-12 18:01:18977 {"ios-media-permissions-control",
978 flag_descriptions::kMediaPermissionsControlName,
979 flag_descriptions::kMediaPermissionsControlDescription, flags_ui::kOsIos,
980 FEATURE_VALUE_TYPE(web::features::kMediaPermissionsControl)},
Olivier Robin3a957df2021-12-21 18:04:34981 {"enable-save-session-tabs-in-separate-files",
982 flag_descriptions::kSaveSessionTabsToSeparateFilesName,
983 flag_descriptions::kSaveSessionTabsToSeparateFilesDescription,
984 flags_ui::kOsIos,
985 FEATURE_VALUE_TYPE(sessions::kSaveSessionTabsToSeparateFiles)},
Ewann8c7aadc2022-05-19 15:41:05986 {"use-sf-symbols", flag_descriptions::kUseSFSymbolsName,
987 flag_descriptions::kUseSFSymbolsDescription, flags_ui::kOsIos,
988 FEATURE_VALUE_TYPE(kUseSFSymbols)},
Nohemi Fernandez76f54802022-01-10 18:23:32989 {"enable-unicorn-account-support",
990 flag_descriptions::kEnableUnicornAccountSupportName,
991 flag_descriptions::kEnableUnicornAccountSupportDescription,
992 flags_ui::kOsIos,
993 FEATURE_VALUE_TYPE(signin::kEnableUnicornAccountSupport)},
David Jeanc2b88ab602022-08-08 14:52:51994 {"ios-webpage-intent-annotations",
995 flag_descriptions::kEnableWebPageAnnotationsName,
996 flag_descriptions::kEnableWebPageAnnotationsDescription, flags_ui::kOsIos,
997 FEATURE_VALUE_TYPE(web::features::kEnableWebPageAnnotations)},
Veronique Nguyen00ba26ea2022-02-25 14:57:17998 {"enable-favicon-passwords",
999 flag_descriptions::kEnableFaviconForPasswordsName,
1000 flag_descriptions::kEnableFaviconForPasswordsDescription, flags_ui::kOsIos,
1001 FEATURE_VALUE_TYPE(
1002 password_manager::features::kEnableFaviconForPasswords)},
Veronique Nguyen11f8c9f2022-09-12 16:51:261003 {"enable-password-grouping", flag_descriptions::kPasswordsGroupingName,
1004 flag_descriptions::kPasswordsGroupingDescription, flags_ui::kOsIos,
1005 FEATURE_VALUE_TYPE(password_manager::features::kPasswordsGrouping)},
Shivani Chauhanbf97b0d2022-02-08 22:21:281006 {"autofill-enable-sending-bcn-in-get-upload-details",
1007 flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsName,
1008 flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsDescription,
1009 flags_ui::kOsIos,
1010 FEATURE_VALUE_TYPE(
1011 autofill::features::kAutofillEnableSendingBcnInGetUploadDetails)},
Ali Juma1429cf8a2022-02-09 15:31:011012 {"enable-fullscreen-api", flag_descriptions::kEnableFullscreenAPIName,
1013 flag_descriptions::kEnableFullscreenAPIDescription, flags_ui::kOsIos,
1014 FEATURE_VALUE_TYPE(web::features::kEnableFullscreenAPI)},
Joemer Ramos34175732022-02-14 18:59:161015 {"enable-enhanced-safe-browsing",
1016 flag_descriptions::kEnhancedProtectionName,
1017 flag_descriptions::kEnhancedProtectionDescription, flags_ui::kOsIos,
1018 FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtection)},
Joemer Ramos26e2b512022-05-24 17:26:411019 {"enable-enhanced-safe-browsing-phase-2",
1020 flag_descriptions::kEnhancedProtectionPhase2Name,
1021 flag_descriptions::kEnhancedProtectionPhase2Description, flags_ui::kOsIos,
1022 FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtectionPhase2IOS)},
Shivani Chauhanaf1eb74d2022-02-11 21:13:191023 {"autofill-enable-unmask-card-request-set-instrument-id",
1024 flag_descriptions::kAutofillEnableUnmaskCardRequestSetInstrumentIdName,
1025 flag_descriptions::
1026 kAutofillEnableUnmaskCardRequestSetInstrumentIdDescription,
1027 flags_ui::kOsIos,
1028 FEATURE_VALUE_TYPE(
1029 autofill::features::kAutofillEnableUnmaskCardRequestSetInstrumentId)},
Vishwas Uppoor89303a92022-08-03 00:56:261030 {"autofill-enable-card-product-name",
1031 flag_descriptions::kAutofillEnableCardProductNameName,
1032 flag_descriptions::kAutofillEnableCardProductNameDescription,
1033 flags_ui::kOsIos,
1034 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableCardProductName)},
Victor Hugo Vianna Silvaf0a44002022-02-16 10:38:001035 {"send-tab-to-self-signin-promo",
1036 flag_descriptions::kSendTabToSelfSigninPromoName,
1037 flag_descriptions::kSendTabToSelfSigninPromoDescription, flags_ui::kOsIos,
1038 FEATURE_VALUE_TYPE(send_tab_to_self::kSendTabToSelfSigninPromo)},
Christian Xubd60c4b72022-03-22 15:25:011039 {"bubble-rich-iph", flag_descriptions::kBubbleRichIPHName,
1040 flag_descriptions::kBubbleRichIPHDescription, flags_ui::kOsIos,
1041 FEATURE_WITH_PARAMS_VALUE_TYPE(kBubbleRichIPH,
1042 kBubbleRichIPHVariations,
1043 "BubbleRichIPH")},
Siyu Anff02e742022-04-07 19:08:221044 {"autofill-enforce-delays-in-strike-database",
1045 flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseName,
1046 flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseDescription,
1047 flags_ui::kOsIos,
1048 FEATURE_VALUE_TYPE(
1049 autofill::features::kAutofillEnforceDelaysInStrikeDatabase)},
Jared Saulb0473bd2022-04-20 00:03:411050 {"autofill-upstream-allow-additional-email-domains",
1051 flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsName,
1052 flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsDescription,
1053 flags_ui::kOsIos,
1054 FEATURE_VALUE_TYPE(
1055 autofill::features::kAutofillUpstreamAllowAdditionalEmailDomains)},
1056 {"autofill-upstream-allow-all-email-domains",
1057 flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsName,
1058 flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsDescription,
1059 flags_ui::kOsIos,
1060 FEATURE_VALUE_TYPE(
1061 autofill::features::kAutofillUpstreamAllowAllEmailDomains)},
Olivier Robinffe767c2022-04-21 13:13:231062 {"enable-tflite-language-detection",
1063 flag_descriptions::kTFLiteLanguageDetectionName,
1064 flag_descriptions::kTFLiteLanguageDetectionDescription, flags_ui::kOsIos,
1065 FEATURE_VALUE_TYPE(translate::kTFLiteLanguageDetectionEnabled)},
Raj Ta921ffc2022-08-25 19:00:201066 {"optimization-guide-debug-logs",
1067 flag_descriptions::kOptimizationGuideDebugLogsName,
1068 flag_descriptions::kOptimizationGuideDebugLogsDescription,
1069 flags_ui::kOsIos,
1070 SINGLE_VALUE_TYPE(optimization_guide::switches::kDebugLoggingEnabled)},
Olivier Robinffe767c2022-04-21 13:13:231071 {"optimization-guide-model-downloading",
1072 flag_descriptions::kOptimizationGuideModelDownloadingName,
1073 flag_descriptions::kOptimizationGuideModelDownloadingDescription,
1074 flags_ui::kOsIos,
1075 FEATURE_VALUE_TYPE(
1076 optimization_guide::features::kOptimizationGuideModelDownloading)},
1077 {"optimization-target-prediction",
1078 flag_descriptions::kOptimizationTargetPredictionName,
1079 flag_descriptions::kOptimizationTargetPredictionDescription,
1080 flags_ui::kOsIos,
1081 FEATURE_VALUE_TYPE(
1082 optimization_guide::features::kOptimizationTargetPrediction)},
Rushan Suleymanov727309602022-04-28 20:08:541083 {"sync-standalone-invalidations", flag_descriptions::kSyncInvalidationsName,
1084 flag_descriptions::kSyncInvalidationsDescription, flags_ui::kOsIos,
1085 FEATURE_VALUE_TYPE(::syncer::kUseSyncInvalidations)},
1086 {"sync-standalone-invalidations-wallet-and-offer",
1087 flag_descriptions::kSyncInvalidationsWalletAndOfferName,
1088 flag_descriptions::kSyncInvalidationsWalletAndOfferDescription,
1089 flags_ui::kOsIos,
1090 FEATURE_VALUE_TYPE(::syncer::kUseSyncInvalidationsForWalletAndOffer)},
Christian Xub8c06cd2022-04-29 20:55:011091 {"suggestions-scrolling-ipad",
1092 flag_descriptions::kEnableSuggestionsScrollingOnIPadName,
1093 flag_descriptions::kEnableSuggestionsScrollingOnIPadDescription,
1094 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableSuggestionsScrollingOnIPad)},
David Jean7a8fa702022-05-02 15:21:221095 {"experience-kit-calendar", flag_descriptions::kCalendarExperienceKitName,
1096 flag_descriptions::kCalendarExperienceKitDescription, flags_ui::kOsIos,
1097 FEATURE_VALUE_TYPE(kCalendarExperienceKit)},
Zhixiang Teoh82d17bb2022-06-16 21:00:391098 {"enable-expkit-calendar-text-classifier",
1099 flag_descriptions::kEnableExpKitCalendarTextClassifierName,
1100 flag_descriptions::kEnableExpKitCalendarTextClassifierDescription,
1101 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableExpKitCalendarTextClassifier)},
Elmehdi Rahmaoui9d4ce40c62022-08-05 15:31:181102 {"experience-kit-maps", flag_descriptions::kMapsExperienceKitName,
1103 flag_descriptions::kMapsExperienceKitDescription, flags_ui::kOsIos,
1104 FEATURE_VALUE_TYPE(kMapsExperienceKit)},
Mustafa Emre Acer4de8863a2022-05-03 22:17:011105 {"https-only-mode", flag_descriptions::kHttpsOnlyModeName,
1106 flag_descriptions::kHttpsOnlyModeDescription, flags_ui::kOsIos,
1107 FEATURE_VALUE_TYPE(security_interstitials::features::kHttpsOnlyMode)},
Mustafa Emre Acerb8bb01f2022-07-20 19:43:251108 {"omnibox-https-upgrades", flag_descriptions::kOmniboxHttpsUpgradesName,
1109 flag_descriptions::kOmniboxHttpsUpgradesDescription, flags_ui::kOsIos,
1110 FEATURE_VALUE_TYPE(omnibox::kDefaultTypedNavigationsToHttps)},
Benjamin Williams419c81e2022-05-04 18:33:221111 {"smart-sorting-new-overflow-menu",
1112 flag_descriptions::kSmartSortingNewOverflowMenuName,
1113 flag_descriptions::kSmartSortingNewOverflowMenuDescription,
1114 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSmartSortingNewOverflowMenu)},
Scott Yoder10493562022-06-28 17:37:441115 {"new-overflow-menu-share-chrome-action",
1116 flag_descriptions::kNewOverflowMenuShareChromeActionName,
1117 flag_descriptions::kNewOverflowMenuShareChromeActionDescription,
1118 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kNewOverflowMenuShareChromeAction)},
Alexander Tekled46a36982022-05-09 20:32:421119 {"autofill-enable-ranking-formula",
1120 flag_descriptions::kAutofillEnableRankingFormulaName,
1121 flag_descriptions::kAutofillEnableRankingFormulaDescription,
1122 flags_ui::kOsIos,
1123 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableRankingFormula)},
Sergio Collazos58558712022-05-18 17:24:021124 {"enable-feed-ablation", flag_descriptions::kEnableFeedAblationName,
1125 flag_descriptions::kEnableFeedAblationDescription, flags_ui::kOsIos,
1126 FEATURE_VALUE_TYPE(kEnableFeedAblation)},
Chris Lu7f024ed2c2022-05-27 23:11:271127 {"content-suggestions-ui-module-refresh",
1128 flag_descriptions::kContentSuggestionsUIModuleRefreshName,
1129 flag_descriptions::kContentSuggestionsUIModuleRefreshDescription,
Chris Lu8e308dc2022-09-06 16:59:401130 flags_ui::kOsIos,
1131 FEATURE_WITH_PARAMS_VALUE_TYPE(kContentSuggestionsUIModuleRefresh,
1132 kModuleRefreshVariations,
1133 "StartSurface")},
Quentin Pubertd7546ae2022-05-30 14:28:571134 {"3p-intents-in-incognito", flag_descriptions::kIOS3PIntentsInIncognitoName,
1135 flag_descriptions::kIOS3PIntentsInIncognitoDescription, flags_ui::kOsIos,
1136 FEATURE_VALUE_TYPE(kIOS3PIntentsInIncognito)},
Olivier Robin058c1fad2022-05-31 18:24:061137 {"default-browser-intents-show-settings",
1138 flag_descriptions::kDefaultBrowserIntentsShowSettingsName,
1139 flag_descriptions::kDefaultBrowserIntentsShowSettingsDescription,
1140 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDefaultBrowserIntentsShowSettings)},
Ed Chin76b1b35e2022-06-08 23:01:171141 {"enable-discover-feed-ghost-cards",
1142 flag_descriptions::kEnableDiscoverFeedGhostCardsName,
1143 flag_descriptions::kEnableDiscoverFeedGhostCardsDescription,
1144 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDiscoverFeedGhostCardsEnabled)},
Gauthier Ambard30ad9ca2022-06-09 14:15:261145 {"bookmark-string-menu", flag_descriptions::kBookmarkStringName,
1146 flag_descriptions::kBookmarkStringDescription, flags_ui::kOsIos,
1147 FEATURE_WITH_PARAMS_VALUE_TYPE(kBookmarkString,
1148 kPopupMenuBookmarkStringVarations,
1149 "BookmarkString")},
Igor Ruvinova43a66dc2022-06-09 21:57:451150 {"dm-token-deletion", flag_descriptions::kDmTokenDeletionName,
1151 flag_descriptions::kDmTokenDeletionDescription, flags_ui::kOsIos,
Igor Ruvinov44fed9f2022-06-10 22:51:421152 FEATURE_WITH_PARAMS_VALUE_TYPE(policy::features::kDmTokenDeletion,
1153 kDmTokenDeletionVariation,
1154 "DmTokenDeletion")},
Tommy Martinoad42be52022-06-13 11:51:191155 {"ios-password-ui-split", flag_descriptions::kIOSPasswordUISplitName,
1156 flag_descriptions::kIOSPasswordUISplitDescription, flags_ui::kOsIos,
1157 FEATURE_VALUE_TYPE(password_manager::features::kIOSPasswordUISplit)},
Theodor-Stefan Cristea6d087b82022-07-26 15:25:291158 {"ios-password-manager-cross-origin-iframe-support",
1159 flag_descriptions::kIOSPasswordManagerCrossOriginIframeSupportName,
1160 flag_descriptions::kIOSPasswordManagerCrossOriginIframeSupportDescription,
1161 flags_ui::kOsIos,
1162 FEATURE_VALUE_TYPE(password_manager::features::
1163 kIOSPasswordManagerCrossOriginIframeSupport)},
Christian Xud105a1352022-06-17 19:54:141164 {"omnibox-adaptive-suggestions-count",
1165 flag_descriptions::kAdaptiveSuggestionsCountName,
1166 flag_descriptions::kAdaptiveSuggestionsCountDescription, flags_ui::kOsIos,
1167 FEATURE_VALUE_TYPE(omnibox::kAdaptiveSuggestionsCount)},
Chris Lu2fd473f2022-06-28 13:38:201168 {"trending-queries-module", flag_descriptions::kTrendingQueriesModuleName,
1169 flag_descriptions::kTrendingQueriesModuleDescription, flags_ui::kOsIos,
Chris Luc9a5cb12022-07-20 16:11:391170 FEATURE_WITH_PARAMS_VALUE_TYPE(kTrendingQueriesModule,
1171 kTrendingQueriesModuleVariations,
Chris Lu438e1c052022-08-17 02:57:001172 kTrendingQueriesFieldTrialName)},
Nakul Vaidyaddfdfbc2022-06-28 23:43:321173 {"autofill-parse-iban-fields",
Nakul Vaidya876210f2022-08-08 17:47:191174 flag_descriptions::kAutofillParseIBANFieldsName,
1175 flag_descriptions::kAutofillParseIBANFieldsDescription, flags_ui::kOsIos,
1176 FEATURE_VALUE_TYPE(autofill::features::kAutofillParseIBANFields)},
Ernesto Izquierdo Clua7f4e36e22022-07-01 09:38:361177 {"autofill-enable-new-card-unmask-prompt-view",
1178 flag_descriptions::kAutofillEnableNewCardUnmaskPromptViewName,
1179 flag_descriptions::kAutofillEnableNewCardUnmaskPromptViewDescription,
1180 flags_ui::kOsIos,
ginnnnnnny591a4972022-09-01 16:10:271181 FEATURE_VALUE_TYPE(
1182 autofill::features::kAutofillEnableNewCardUnmaskPromptView)},
Christian Xubdedabec2022-07-04 10:00:131183 {"omnibox-paste-button", flag_descriptions::kOmniboxPasteButtonName,
1184 flag_descriptions::kOmniboxPasteButtonDescription, flags_ui::kOsIos,
1185 FEATURE_WITH_PARAMS_VALUE_TYPE(kOmniboxPasteButton,
1186 kOmniboxPasteButtonVariations,
1187 "OmniboxPasteButton")},
Moe Ahmadi098519d82022-07-27 18:34:241188 {"omnibox-zero-suggest-prefetching",
1189 flag_descriptions::kOmniboxZeroSuggestPrefetchingName,
1190 flag_descriptions::kOmniboxZeroSuggestPrefetchingDescription,
1191 flags_ui::kOsIos, FEATURE_VALUE_TYPE(omnibox::kZeroSuggestPrefetching)},
Vincent Boissellead6cbe22022-07-04 19:32:391192 {"enable-user-policy", flag_descriptions::kEnableUserPolicyName,
1193 flag_descriptions::kEnableUserPolicyDescription, flags_ui::kOsIos,
1194 SINGLE_VALUE_TYPE(policy::kEnableUserPolicy)},
Marc Treibb9d8ed802022-07-05 15:15:491195 {"enable-sync-history-datatype",
1196 flag_descriptions::kSyncEnableHistoryDataTypeName,
1197 flag_descriptions::kSyncEnableHistoryDataTypeDescription, flags_ui::kOsIos,
1198 FEATURE_VALUE_TYPE(syncer::kSyncEnableHistoryDataType)},
Christian Xucf26d562022-07-06 09:28:361199 {"omnibox-max-url-matches", flag_descriptions::kOmniboxMaxURLMatchesName,
1200 flag_descriptions::kOmniboxMaxURLMatchesDescription, flags_ui::kOsIos,
1201 FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kOmniboxMaxURLMatches,
1202 kOmniboxMaxURLMatchesVariations,
1203 "OmniboxMaxURLMatches")},
Olivier Robin60d3a062022-07-06 17:34:061204 {"metrickit-non-crash-reports",
1205 flag_descriptions::kMetrickitNonCrashReportName,
1206 flag_descriptions::kMetrickitNonCrashReportDescription, flags_ui::kOsIos,
1207 FEATURE_VALUE_TYPE(kMetrickitNonCrashReport)},
Siyu An3194bda2022-07-13 19:30:371208 {"autofill-enable-remade-downstream-metrics",
1209 flag_descriptions::kAutofillEnableRemadeDownstreamMetricsName,
1210 flag_descriptions::kAutofillEnableRemadeDownstreamMetricsDescription,
1211 flags_ui::kOsIos,
1212 FEATURE_VALUE_TYPE(
1213 autofill::features::kAutofillEnableRemadeDownstreamMetrics)},
Nakul Vaidya13ca2042022-07-27 01:59:551214 {"autofill-parse-vcn-card-on-file-standalone-cvc-fields",
1215 flag_descriptions::kAutofillParseVcnCardOnFileStandaloneCvcFieldsName,
1216 flag_descriptions::
1217 kAutofillParseVcnCardOnFileStandaloneCvcFieldsDescription,
1218 flags_ui::kOsIos,
1219 FEATURE_VALUE_TYPE(
1220 autofill::features::kAutofillParseVcnCardOnFileStandaloneCvcFields)},
Ed Chin91e44992022-07-27 13:42:341221#if BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
1222 {"feed-background-refresh-ios",
1223 flag_descriptions::kFeedBackgroundRefreshName,
1224 flag_descriptions::kFeedBackgroundRefreshDescription, flags_ui::kOsIos,
1225 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFeedBackgroundRefresh,
1226 kFeedBackgroundRefreshVariations,
1227 "FeedBackgroundRefresh")},
Christian Xu164a2e512022-08-01 20:38:191228 {"omnibox-keyboard-paste-button",
1229 flag_descriptions::kOmniboxKeyboardPasteButtonName,
1230 flag_descriptions::kOmniboxKeyboardPasteButtonDescription,
1231 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kOmniboxKeyboardPasteButton)},
Ed Chin91e44992022-07-27 13:42:341232#endif // BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
Arthur Milchiorcf4877e2022-07-29 14:23:411233 {"enable-cbd-sign-out", flag_descriptions::kEnableCBDSignOutName,
1234 flag_descriptions::kEnableCBDSignOutDescription, flags_ui::kOsIos,
Arthur Milchiord36e2502022-08-11 16:10:111235 FEATURE_VALUE_TYPE(switches::kEnableCbdSignOut)},
Aliona DANGLAa5257ccc2022-08-29 14:01:491236 {"enable-open-in-download", flag_descriptions::kEnableOpenInDownloadName,
1237 flag_descriptions::kEnableOpenInDownloadDescription, flags_ui::kOsIos,
1238 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableOpenInDownload,
1239 kOpenInDownloadVariations,
1240 "EnableOpenInDownload")},
Cheick Cisse87a51cb2022-09-08 21:29:171241 {"whats-new-ios", flag_descriptions::kWhatsNewIOSName,
1242 flag_descriptions::kWhatsNewIOSDescription, flags_ui::kOsIos,
1243 FEATURE_VALUE_TYPE(kWhatsNewIOS)},
ginnnnnnny591a4972022-09-01 16:10:271244 {"ios-autofill-branding", flag_descriptions::kAutofillBrandingIOSName,
1245 flag_descriptions::kAutofillBrandingIOSDescription, flags_ui::kOsIos,
1246 FEATURE_WITH_PARAMS_VALUE_TYPE(autofill::features::kAutofillBrandingIOS,
1247 kAutofillBrandingIOSVariations,
Hira Mahmoodb0e5f412022-09-01 19:41:051248 "AutofillBrandingIOS")},
1249 {"app-store-rating", flag_descriptions::kAppStoreRatingName,
1250 flag_descriptions::kAppStoreRatingDescription, flags_ui::kOsIos,
1251 FEATURE_VALUE_TYPE(kAppStoreRating)},
Scott Yodercb2fe632022-09-12 15:28:351252 {"ios-new-post-restore-experience",
1253 flag_descriptions::kIOSNewPostRestoreExperienceName,
1254 flag_descriptions::kIOSNewPostRestoreExperienceDescription,
1255 flags_ui::kOsIos,
Benjamin Williams3d3a2ec2022-09-13 20:01:261256 FEATURE_WITH_PARAMS_VALUE_TYPE(
1257 post_restore_signin::features::kIOSNewPostRestoreExperience,
1258 kIOSNewPostRestoreExperienceVariations,
1259 "IOSNewPostRestoreExperience")},
Christian Xu6b90c2a32022-09-13 18:17:021260 {"most-visited-tiles", flag_descriptions::kMostVisitedTilesName,
1261 flag_descriptions::kMostVisitedTilesDescription, flags_ui::kOsIos,
1262 FEATURE_VALUE_TYPE(omnibox::kMostVisitedTiles)},
Olivier ROBINf05518782022-09-14 23:55:501263 {"enable-tflite-language-detection-ignore",
1264 flag_descriptions::kTFLiteLanguageDetectionIgnoreName,
1265 flag_descriptions::kTFLiteLanguageDetectionIgnoreDescription,
1266 flags_ui::kOsIos,
1267 FEATURE_VALUE_TYPE(translate::kTFLiteLanguageDetectionIgnoreEnabled)},
Hira Mahmoodb0e5f412022-09-01 19:41:051268};
sdefresne14900ee2015-11-27 14:43:211269
Rohit Raobed794c2020-04-27 15:27:451270bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
1271 return false;
1272}
1273
1274flags_ui::FlagsState& GetGlobalFlagsState() {
1275 static base::NoDestructor<flags_ui::FlagsState> flags_state(kFeatureEntries,
1276 nullptr);
1277 return *flags_state;
1278}
David Jean5ca263c2021-08-18 09:19:301279// Creates the experimental test policies map, used by AsyncPolicyLoader and
1280// PolicyLoaderIOS to locally enable policies.
Vincent Boisselleed0e6f1a2021-11-09 06:47:341281NSMutableDictionary* CreateExperimentalTestingPolicies() {
sdefresne14900ee2015-11-27 14:43:211282 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1283
Guillaume Jenkins25e9bd72020-08-27 17:39:061284 // Shared variables for all enterprise experimental flags.
Guillaume Jenkins57606d72020-08-13 17:32:551285 NSMutableDictionary* testing_policies = [[NSMutableDictionary alloc] init];
Guillaume Jenkins25e9bd72020-08-27 17:39:061286 NSMutableArray* allowed_experimental_policies = [[NSMutableArray alloc] init];
Guillaume Jenkins57606d72020-08-13 17:32:551287
Guillaume Jenkins25e9bd72020-08-27 17:39:061288 // Set some sample policy values for testing if EnableSamplePolicies is set to
1289 // true.
Guillaume Jenkinseeb7007c2020-06-25 22:55:401290 if ([defaults boolForKey:@"EnableSamplePolicies"]) {
Guillaume Jenkins57606d72020-08-13 17:32:551291 [testing_policies addEntriesFromDictionary:@{
Tina Wang59d0b7e2020-08-11 04:41:011292 base::SysUTF8ToNSString(policy::key::kAutofillAddressEnabled) : @NO,
1293
Guillaume Jenkinseeb7007c2020-06-25 22:55:401294 base::SysUTF8ToNSString(policy::key::kAutofillCreditCardEnabled) : @NO,
1295
1296 // 2 = Disable all variations
1297 base::SysUTF8ToNSString(policy::key::kChromeVariations) : @2,
1298
1299 // 2 = Do not allow any site to show popups
1300 base::SysUTF8ToNSString(policy::key::kDefaultPopupsSetting) : @2,
1301
Tina Wang5abee802020-07-29 23:09:521302 // Set default search engine.
1303 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderEnabled) :
1304 @YES,
1305 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderSearchURL) :
1306 @"http://www.google.com/search?q={searchTerms}",
1307 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderName) :
Tina Wang7cd0a062020-09-15 21:31:021308 @"TestEngine",
Tina Wang5abee802020-07-29 23:09:521309
Tina Wang89068c82020-10-29 15:51:501310 base::SysUTF8ToNSString(policy::key::kEditBookmarksEnabled) : @NO,
1311
Gauthier Ambard21b23702021-04-16 16:11:271312 base::SysUTF8ToNSString(policy::key::kNTPContentSuggestionsEnabled) : @NO,
1313
Guillaume Jenkinseeb7007c2020-06-25 22:55:401314 base::SysUTF8ToNSString(policy::key::kPasswordManagerEnabled) : @NO,
Tina Wang59d0b7e2020-08-11 04:41:011315
1316 base::SysUTF8ToNSString(policy::key::kTranslateEnabled) : @NO,
Tina Wang54dddfc22020-08-20 22:34:531317
1318 // 2 = Enhanced safe browsing protection
1319 base::SysUTF8ToNSString(policy::key::kSafeBrowsingProtectionLevel) : @2,
1320
1321 base::SysUTF8ToNSString(policy::key::kSearchSuggestEnabled) : @YES,
Guillaume Jenkins57606d72020-08-13 17:32:551322 }];
1323 }
1324
Ewann227a3c02021-04-19 12:04:541325 if ([defaults boolForKey:@"EnableSyncDisabledPolicy"]) {
Guillaume Jenkinsfe46d3a2021-04-26 19:51:041326 NSString* sync_policy_key =
1327 base::SysUTF8ToNSString(policy::key::kSyncDisabled);
David Jean5ca263c2021-08-18 09:19:301328 [testing_policies addEntriesFromDictionary:@{sync_policy_key : @YES}];
Ewann227a3c02021-04-19 12:04:541329 }
Ewann227a3c02021-04-19 12:04:541330
Ewann570a6302021-08-17 07:22:421331 // SyncTypesListDisabled policy.
1332 NSString* Sync_types_list_disabled_key =
1333 base::SysUTF8ToNSString(policy::key::kSyncTypesListDisabled);
1334 NSMutableArray* Sync_types_list_disabled_values =
1335 [[NSMutableArray alloc] init];
1336 if ([defaults boolForKey:@"SyncTypesListBookmarks"]) {
1337 [Sync_types_list_disabled_values addObject:@"bookmarks"];
1338 }
1339 if ([defaults boolForKey:@"SyncTypesListReadingList"]) {
1340 [Sync_types_list_disabled_values addObject:@"readingList"];
1341 }
1342 if ([defaults boolForKey:@"SyncTypesListPreferences"]) {
1343 [Sync_types_list_disabled_values addObject:@"preferences"];
1344 }
1345 if ([defaults boolForKey:@"SyncTypesListPasswords"]) {
1346 [Sync_types_list_disabled_values addObject:@"passwords"];
1347 }
1348 if ([defaults boolForKey:@"SyncTypesListAutofill"]) {
1349 [Sync_types_list_disabled_values addObject:@"autofill"];
1350 }
1351 if ([defaults boolForKey:@"SyncTypesListTypedUrls"]) {
1352 [Sync_types_list_disabled_values addObject:@"typedUrls"];
1353 }
1354 if ([defaults boolForKey:@"SyncTypesListTabs"]) {
1355 [Sync_types_list_disabled_values addObject:@"tabs"];
1356 }
1357 if ([Sync_types_list_disabled_values count]) {
1358 [testing_policies addEntriesFromDictionary:@{
1359 Sync_types_list_disabled_key : Sync_types_list_disabled_values
1360 }];
Ewann570a6302021-08-17 07:22:421361 }
1362
Gauthier Ambard073eaa92021-11-22 15:24:131363 // If an incognito mode availability is set, set the value.
Tina Wangc6bcf572021-01-27 18:15:521364 NSString* incognito_policy_key =
1365 base::SysUTF8ToNSString(policy::key::kIncognitoModeAvailability);
1366 NSInteger incognito_mode_availability =
1367 [defaults integerForKey:incognito_policy_key];
1368 if (incognito_mode_availability) {
Tina Wangc6bcf572021-01-27 18:15:521369 [testing_policies addEntriesFromDictionary:@{
1370 incognito_policy_key : @(incognito_mode_availability),
1371 }];
1372 }
1373
Ewann40a8f8a2021-07-29 10:01:201374 NSString* restriction_pattern =
1375 [defaults stringForKey:@"RestrictAccountsToPatterns"];
1376 if ([restriction_pattern length] > 0) {
Ewannb3bee382021-08-16 09:12:291377 NSString* restrict_key =
1378 base::SysUTF8ToNSString(policy::key::kRestrictAccountsToPatterns);
Ewann40a8f8a2021-07-29 10:01:201379 [testing_policies addEntriesFromDictionary:@{
Ewannb3bee382021-08-16 09:12:291380 restrict_key : @[ restriction_pattern ]
Ewann40a8f8a2021-07-29 10:01:201381 }];
1382 }
1383
Vincent Boisselle19200bc2021-09-01 17:58:251384 // If the sign-in policy is set (not "None"), add the policy key to the list
1385 // of enabled experimental policies, and set the value.
1386 NSString* const kSigninPolicyKey = @"BrowserSignin";
1387 NSInteger signin_policy_mode = [defaults integerForKey:kSigninPolicyKey];
1388 if (signin_policy_mode) {
1389 // Remove the mode offset that was used to represent the unset policy.
1390 --signin_policy_mode;
1391 DCHECK(signin_policy_mode >= 0);
1392
Vincent Boisselle19200bc2021-09-01 17:58:251393 [testing_policies addEntriesFromDictionary:@{
1394 kSigninPolicyKey : @(signin_policy_mode),
1395 }];
1396 }
1397
Veronique Nguyen9b1044f2022-01-11 14:41:131398 // If the New Tab Page URL is set (not empty) add the value to the list of
1399 // test policies.
1400 NSString* ntp_location = [defaults stringForKey:@"NTPLocation"];
1401 if ([ntp_location length] > 0) {
1402 NSString* ntp_location_key =
1403 base::SysUTF8ToNSString(policy::key::kNewTabPageLocation);
1404 [testing_policies
1405 addEntriesFromDictionary:@{ntp_location_key : ntp_location}];
Veronique Nguyen302d8702022-01-12 21:18:571406 [allowed_experimental_policies addObject:ntp_location_key];
Veronique Nguyen9b1044f2022-01-11 14:41:131407 }
1408
Ali Juma9ec36d2b2022-03-28 14:53:121409 if ([defaults boolForKey:@"DisallowChromeDataInBackups"]) {
1410 NSString* allow_backups_key =
1411 base::SysUTF8ToNSString(policy::key::kAllowChromeDataInBackups);
1412 [testing_policies addEntriesFromDictionary:@{allow_backups_key : @NO}];
1413 [allowed_experimental_policies addObject:allow_backups_key];
1414 }
1415
Guillaume Jenkins25e9bd72020-08-27 17:39:061416 // If any experimental policy was allowed, set the EnableExperimentalPolicies
1417 // policy.
1418 if ([allowed_experimental_policies count] > 0) {
1419 [testing_policies setValue:allowed_experimental_policies
1420 forKey:base::SysUTF8ToNSString(
1421 policy::key::kEnableExperimentalPolicies)];
1422 }
1423
jlebel2eb40222022-05-06 11:15:421424 NSString* metrics_reporting_key = @"MetricsReportingEnabled";
1425 switch ([defaults integerForKey:metrics_reporting_key]) {
1426 case 1:
1427 // Metrics reporting forced.
1428 [testing_policies setValue:@(YES) forKey:metrics_reporting_key];
1429 break;
1430 case 2:
1431 // Metrics reporting disabled.
1432 [testing_policies setValue:@(NO) forKey:metrics_reporting_key];
1433 break;
1434 default:
1435 // Metrics reporting not managed.
1436 break;
1437 }
1438
David Jean6f85d44f2021-08-19 08:08:451439 // Warning: Add new flags to TestingPoliciesHash() below.
1440
David Jean5ca263c2021-08-18 09:19:301441 return testing_policies;
1442}
David Jean6f85d44f2021-08-19 08:08:451443
1444// Generates a unique NSString based on currently monitored policies from
1445// NSUserDefaults standardUserDefaults.
1446NSString* TestingPoliciesHash() {
1447 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1448 return [NSString
jlebel2eb40222022-05-06 11:15:421449 stringWithFormat:@"%d|%d|%d|%d|%@|%d|%d|%d|%d|%d|%d|%d|%d|%@|%d",
Ali Juma9ec36d2b2022-03-28 14:53:121450 [defaults boolForKey:@"DisallowChromeDataInBackups"],
David Jean6f85d44f2021-08-19 08:08:451451 [defaults boolForKey:@"EnableSyncDisabledPolicy"],
1452 [defaults boolForKey:@"EnableSamplePolicies"],
jlebel2eb40222022-05-06 11:15:421453 static_cast<int>([defaults
1454 integerForKey:@"IncognitoModeAvailability"]),
David Jean6f85d44f2021-08-19 08:08:451455 [defaults stringForKey:@"RestrictAccountsToPatterns"],
1456 [defaults boolForKey:@"SyncTypesListBookmarks"],
1457 [defaults boolForKey:@"SyncTypesListReadingList"],
1458 [defaults boolForKey:@"SyncTypesListPreferences"],
1459 [defaults boolForKey:@"SyncTypesListPasswords"],
1460 [defaults boolForKey:@"SyncTypesListAutofill"],
1461 [defaults boolForKey:@"SyncTypesListTypedUrls"],
jlebel2eb40222022-05-06 11:15:421462 [defaults boolForKey:@"SyncTypesListTabs"],
1463 static_cast<int>(
1464 [defaults integerForKey:@"BrowserSignin"]),
1465 [defaults stringForKey:@"NTPLocation"],
1466 static_cast<int>([defaults
1467 integerForKey:@"MetricsReportingEnabled"])];
David Jean6f85d44f2021-08-19 08:08:451468}
David Jean5ca263c2021-08-18 09:19:301469} // namespace
1470
Gauthier Ambard02dbf022022-08-23 08:28:471471// Add all switches from experimental flags to `command_line`.
David Jean5ca263c2021-08-18 09:19:301472void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) {
1473 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1474
1475 // Set the UA flag if UseMobileSafariUA is enabled.
1476 if ([defaults boolForKey:@"UseMobileSafariUA"]) {
1477 // Safari uses "Vesion/", followed by the OS version excluding bugfix, where
1478 // Chrome puts its product token.
1479 int32_t major = 0;
1480 int32_t minor = 0;
1481 int32_t bugfix = 0;
1482 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix);
1483 std::string product = base::StringPrintf("Version/%d.%d", major, minor);
1484
1485 command_line->AppendSwitchASCII(switches::kUserAgent,
1486 web::BuildMobileUserAgent(product));
1487 }
1488
1489 // Shared variables for all enterprise experimental flags.
Vincent Boisselleed0e6f1a2021-11-09 06:47:341490 NSMutableDictionary* testing_policies = CreateExperimentalTestingPolicies();
David Jean5ca263c2021-08-18 09:19:301491
1492 // If a CBCM enrollment token is provided, force Chrome Browser Cloud
1493 // Management to enabled and add the token to the list of policies.
1494 NSString* token_key =
1495 base::SysUTF8ToNSString(policy::key::kCloudManagementEnrollmentToken);
1496 NSString* token = [defaults stringForKey:token_key];
1497
1498 if ([token length] > 0) {
1499 command_line->AppendSwitch(switches::kEnableChromeBrowserCloudManagement);
1500 [testing_policies setValue:token forKey:token_key];
1501 }
1502
Vincent Boisselled042d552022-04-09 01:22:591503 if ([defaults boolForKey:@"EnableUserPolicy"]) {
1504 policy::EnableUserPolicy();
1505 }
1506
Guillaume Jenkins57606d72020-08-13 17:32:551507 // If some policies were set, commit them to the app's registration defaults.
1508 if ([testing_policies count] > 0) {
Guillaume Jenkinseeb7007c2020-06-25 22:55:401509 NSDictionary* registration_defaults =
1510 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
1511 [defaults registerDefaults:registration_defaults];
1512 }
1513
sdefresne14900ee2015-11-27 14:43:211514 // Freeform commandline flags. These are added last, so that any flags added
1515 // earlier in this function take precedence.
1516 if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) {
1517 base::CommandLine::StringVector flags;
1518 // Append an empty "program" argument.
1519 flags.push_back("");
1520
1521 // The number of flags corresponds to the number of text fields in
1522 // Experimental.plist.
1523 const int kNumFreeformFlags = 5;
1524 for (int i = 1; i <= kNumFreeformFlags; ++i) {
1525 NSString* key =
1526 [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i];
1527 NSString* flag = [defaults stringForKey:key];
1528 if ([flag length]) {
Robbie Gibsonc91ce622019-05-20 14:44:331529 // iOS keyboard replaces -- with —, so undo that.
1530 flag = [flag stringByReplacingOccurrencesOfString:@"—"
1531 withString:@"--"
1532 options:0
1533 range:NSMakeRange(0, 1)];
1534 // To make things easier, allow flags with no dashes by prepending them
1535 // here. This also allows for flags that just have one dash if they
1536 // exist.
1537 if (![flag hasPrefix:@"-"]) {
1538 flag = [@"--" stringByAppendingString:flag];
1539 }
sdefresne14900ee2015-11-27 14:43:211540 flags.push_back(base::SysNSStringToUTF8(flag));
1541 }
1542 }
1543
1544 base::CommandLine temp_command_line(flags);
1545 command_line->AppendArguments(temp_command_line, false);
1546 }
msardafc76f662017-02-24 12:46:281547
justincohendacc85d2017-06-28 23:34:101548 // Populate command line flag for 3rd party keyboard omnibox workaround.
1549 NSString* enableThirdPartyKeyboardWorkaround =
1550 [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"];
1551 if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) {
1552 command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround);
1553 } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) {
1554 command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround);
1555 }
1556
Sylvain Defresned3cd8d92022-01-18 13:35:081557 ios::provider::AppendSwitchesFromExperimentalSettings(defaults, command_line);
sdefresne14900ee2015-11-27 14:43:211558}
1559
David Jean5ca263c2021-08-18 09:19:301560void MonitorExperimentalSettingsChanges() {
David Jean5ca263c2021-08-18 09:19:301561 // Startup values for settings to be observed.
David Jean6f85d44f2021-08-19 08:08:451562 __block NSString* hash = TestingPoliciesHash();
David Jeane83ed652021-08-25 14:52:481563 static std::atomic_bool pending_check(false);
David Jean5ca263c2021-08-18 09:19:301564
1565 auto monitor = ^(NSNotification* notification) {
David Jeane83ed652021-08-25 14:52:481566 bool has_pending_check = pending_check.exchange(true);
1567 if (has_pending_check)
1568 return;
1569
David Jeanbc0fae32021-08-25 10:31:391570 // Can be called from any thread from where the notification was sent,
1571 // but since it may change standardUserDefaults, and that has to be on main
1572 // thread, dispatch to main thread.
1573 dispatch_async(dispatch_get_main_queue(), ^{
1574 // Check if observed settings have changed. Since source and destination
1575 // are both user defaults, this is required to avoid cycling back here.
1576 NSString* newHash = TestingPoliciesHash();
1577 if (![newHash isEqualToString:hash]) {
1578 hash = newHash;
David Jean5ca263c2021-08-18 09:19:301579
David Jeanbc0fae32021-08-25 10:31:391580 // Publish update.
1581 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1582 NSMutableDictionary* testing_policies =
Vincent Boisselleed0e6f1a2021-11-09 06:47:341583 CreateExperimentalTestingPolicies();
David Jeanbc0fae32021-08-25 10:31:391584 NSDictionary* registration_defaults =
1585 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
1586 [defaults registerDefaults:registration_defaults];
1587 }
David Jeane83ed652021-08-25 14:52:481588
1589 pending_check.store(false);
David Jeanbc0fae32021-08-25 10:31:391590 });
David Jean5ca263c2021-08-18 09:19:301591 };
1592
1593 NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
1594 [center addObserverForName:NSUserDefaultsDidChangeNotification
1595 object:nil
David Jeanbc0fae32021-08-25 10:31:391596 queue:nil
David Jean5ca263c2021-08-18 09:19:301597 usingBlock:monitor];
1598}
1599
sdefresne14900ee2015-11-27 14:43:211600void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage,
1601 base::CommandLine* command_line) {
Sylvain Defresne8327a2f2019-01-17 14:19:181602 GetGlobalFlagsState().ConvertFlagsToSwitches(
sdefresnec9763902015-12-02 10:30:111603 flags_storage, command_line, flags_ui::kAddSentinels,
Gregory Chatzinofff6523722017-11-21 01:33:531604 switches::kEnableFeatures, switches::kDisableFeatures);
sdefresne14900ee2015-11-27 14:43:211605}
1606
jkrcalbf073372016-07-29 07:21:311607std::vector<std::string> RegisterAllFeatureVariationParameters(
1608 flags_ui::FlagsStorage* flags_storage,
1609 base::FeatureList* feature_list) {
Justin Cohen2e2adb52019-10-25 17:00:021610 // Occasionally DCHECK crashes on canary can be very distuptive. An
1611 // experimental flag was added to aid in temporarily disabling this for
1612 // canary testers.
Peter Boström3f798572022-07-26 23:44:361613#if BUILDFLAG(DCHECK_IS_CONFIGURABLE)
Justin Cohen2e2adb52019-10-25 17:00:021614 if (experimental_flags::AreDCHECKCrashesDisabled()) {
1615 std::vector<base::FeatureList::FeatureOverrideInfo> overrides;
1616 overrides.push_back(
1617 {std::cref(base::kDCheckIsFatalFeature),
1618 base::FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE});
1619 feature_list->RegisterExtraFeatureOverrides(std::move(overrides));
1620 }
Peter Boström3f798572022-07-26 23:44:361621#endif // BUILDFLAG(DCHECK_IS_CONFIGURABLE)
Justin Cohen2e2adb52019-10-25 17:00:021622
Sylvain Defresne8327a2f2019-01-17 14:19:181623 return GetGlobalFlagsState().RegisterAllFeatureVariationParameters(
1624 flags_storage, feature_list);
jkrcalbf073372016-07-29 07:21:311625}
1626
sdefresne14900ee2015-11-27 14:43:211627void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage,
1628 flags_ui::FlagAccess access,
Matt Menke4d777572022-06-15 15:55:501629 base::Value::List& supported_entries,
1630 base::Value::List& unsupported_entries) {
Sylvain Defresne8327a2f2019-01-17 14:19:181631 GetGlobalFlagsState().GetFlagFeatureEntries(
sdefresne14900ee2015-11-27 14:43:211632 flags_storage, access, supported_entries, unsupported_entries,
Renjie Tang208c8192020-11-03 00:46:511633 base::BindRepeating(&SkipConditionalFeatureEntry));
sdefresne14900ee2015-11-27 14:43:211634}
1635
1636void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage,
1637 const std::string& internal_name,
1638 bool enable) {
Sylvain Defresne8327a2f2019-01-17 14:19:181639 GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name,
1640 enable);
sdefresne14900ee2015-11-27 14:43:211641}
1642
1643void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) {
Sylvain Defresne8327a2f2019-01-17 14:19:181644 GetGlobalFlagsState().ResetAllFlags(flags_storage);
sdefresne14900ee2015-11-27 14:43:211645}
1646
1647namespace testing {
1648
Elly Fong-Jones323ab1092021-08-23 22:36:311649base::span<const flags_ui::FeatureEntry> GetFeatureEntries() {
1650 return base::span<const flags_ui::FeatureEntry>(kFeatureEntries,
Daniel Cheng1f047a82022-02-26 10:04:531651 std::size(kFeatureEntries));
sdefresne14900ee2015-11-27 14:43:211652}
1653
1654} // namespace testing