blob: b7f7c96d50d70f2e42909642b8c134af0a654d99 [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"
Benjamin Williamsaa8da8142022-11-14 19:51:0342#import "components/ntp_tiles/features.h"
Gauthier Ambard999088c2022-09-13 08:36:5743#import "components/ntp_tiles/switches.h"
44#import "components/omnibox/browser/omnibox_field_trial.h"
45#import "components/omnibox/common/omnibox_features.h"
46#import "components/optimization_guide/core/optimization_guide_features.h"
Raj Ta921ffc2022-08-25 19:00:2047#import "components/optimization_guide/core/optimization_guide_switches.h"
Gauthier Ambard999088c2022-09-13 08:36:5748#import "components/password_manager/core/common/password_manager_features.h"
49#import "components/payments/core/features.h"
50#import "components/policy/core/common/features.h"
Guillaume Jenkinseeb7007c2020-06-25 22:55:4051#import "components/policy/core/common/policy_loader_ios_constants.h"
Gauthier Ambard999088c2022-09-13 08:36:5752#import "components/policy/policy_constants.h"
53#import "components/safe_browsing/core/common/features.h"
Victor Hugo Vianna Silva0399402f2021-09-07 21:41:2554#import "components/send_tab_to_self/features.h"
Gauthier Ambard999088c2022-09-13 08:36:5755#import "components/shared_highlighting/core/common/shared_highlighting_features.h"
56#import "components/signin/core/browser/account_reconcilor.h"
57#import "components/signin/ios/browser/features.h"
58#import "components/signin/public/base/signin_switches.h"
59#import "components/strings/grit/components_strings.h"
60#import "components/sync/base/command_line_switches.h"
61#import "components/sync/base/features.h"
62#import "components/sync/base/pref_names.h"
63#import "components/translate/core/browser/translate_prefs.h"
64#import "components/translate/core/common/translate_util.h"
Ed Chin91e44992022-07-27 13:42:3465#import "ios/chrome/app/background_mode_buildflags.h"
Gauthier Ambard999088c2022-09-13 08:36:5766#import "ios/chrome/browser/browsing_data/browsing_data_features.h"
67#import "ios/chrome/browser/crash_report/features.h"
Gauthier Ambard92605132022-08-26 13:25:1768#import "ios/chrome/browser/flags/chrome_switches.h"
Gauthier Ambard999088c2022-09-13 08:36:5769#import "ios/chrome/browser/flags/ios_chrome_flag_descriptions.h"
Gauthier Ambard92605132022-08-26 13:25:1770#import "ios/chrome/browser/flags/system_flags.h"
Ed Chin100660bf2022-04-26 16:59:1371#import "ios/chrome/browser/ntp/features.h"
Vincent Boisselle88fef222022-09-23 18:54:5072#import "ios/chrome/browser/policy/cloud/user_policy_constants.h"
Vincent Boissellead6cbe22022-07-04 19:32:3973#import "ios/chrome/browser/policy/cloud/user_policy_switch.h"
Gauthier Ambard999088c2022-09-13 08:36:5774#import "ios/chrome/browser/policy/policy_util.h"
Benjamin Williams14233d72022-07-26 18:32:2075#import "ios/chrome/browser/promos_manager/features.h"
Gauthier Ambard999088c2022-09-13 08:36:5776#import "ios/chrome/browser/screen_time/screen_time_buildflags.h"
Olivier Robin3a957df2021-12-21 18:04:3477#import "ios/chrome/browser/sessions/session_features.h"
Zhixiang Teoh40027a22022-07-28 03:24:3478#import "ios/chrome/browser/text_selection/text_selection_util.h"
Hira Mahmoodb0e5f412022-09-01 19:41:0579#import "ios/chrome/browser/ui/app_store_rating/features.h"
Gauthier Ambard999088c2022-09-13 08:36:5780#import "ios/chrome/browser/ui/autofill/features.h"
81#import "ios/chrome/browser/ui/bubble/bubble_features.h"
adamta22a4d502020-05-21 03:12:2182#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h"
Javier Ernesto Flores Robles209b2822021-03-25 19:16:5083#import "ios/chrome/browser/ui/default_promo/default_browser_utils.h"
Ewann1a9d33d2021-06-14 11:12:2484#import "ios/chrome/browser/ui/download/features.h"
Rohit Rao5aa791a2022-08-19 17:34:5385#import "ios/chrome/browser/ui/first_run/field_trial_constants.h"
Chris Lu438e1c052022-08-17 02:57:0086#import "ios/chrome/browser/ui/first_run/trending_queries_field_trial.h"
Kurt Horimoto4da682b022018-04-12 07:43:3587#import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h"
Louis Romeroc18612b962022-10-07 12:08:1488#import "ios/chrome/browser/ui/keyboard/features.h"
Benjamin Williamsaa8da8142022-11-14 19:51:0389#import "ios/chrome/browser/ui/ntp/field_trial_constants.h"
adamta273568472020-12-04 23:53:5790#import "ios/chrome/browser/ui/ntp/new_tab_page_feature.h"
Christian Xub8c06cd2022-04-29 20:55:0191#import "ios/chrome/browser/ui/omnibox/omnibox_ui_features.h"
Aliona DANGLAa5257ccc2022-08-29 14:01:4992#import "ios/chrome/browser/ui/open_in/features.h"
Robbie Gibson686c56732021-10-04 17:11:4593#import "ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.h"
Benjamin Williams3d3a2ec2022-09-13 20:01:2694#import "ios/chrome/browser/ui/post_restore_signin/features.h"
gogerald0ff29e52021-02-03 18:56:1995#import "ios/chrome/browser/ui/start_surface/start_surface_features.h"
Kurt Horimoto79d590b2018-09-12 19:09:2896#import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h"
Gauthier Ambard999088c2022-09-13 08:36:5797#import "ios/chrome/browser/ui/ui_feature_flags.h"
Cheick Cisse87a51cb2022-09-08 21:29:1798#import "ios/chrome/browser/ui/whats_new/feature_flags.h"
Gauthier Ambard999088c2022-09-13 08:36:5799#import "ios/chrome/browser/web/features.h"
100#import "ios/chrome/grit/ios_strings.h"
101#import "ios/components/security_interstitials/https_only_mode/feature.h"
102#import "ios/public/provider/chrome/browser/app_utils/app_utils_api.h"
103#import "ios/web/common/features.h"
104#import "ios/web/common/user_agent.h"
105#import "ios/web/common/web_view_creation_util.h"
sdefresne14900ee2015-11-27 14:43:21106
Sylvain Defresne9c107082020-10-27 16:39:13107#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
Gauthier Ambard999088c2022-09-13 08:36:57108#import "ios/chrome/browser/screen_time/features.h"
Sylvain Defresne9c107082020-10-27 16:39:13109#endif
110
sdefresne14900ee2015-11-27 14:43:21111#if !defined(OFFICIAL_BUILD)
Gauthier Ambard999088c2022-09-13 08:36:57112#import "components/variations/variations_switches.h"
vitaliii489217aa2017-01-30 14:50:22113#endif
stkhapuginc1be1792016-12-13 14:30:53114
115#if !defined(__has_feature) || !__has_feature(objc_arc)
116#error "This file requires ARC support."
117#endif
sdefresne14900ee2015-11-27 14:43:21118
elawrence816f6790e2017-06-16 18:19:28119using flags_ui::FeatureEntry;
120
sdefresne14900ee2015-11-27 14:43:21121namespace {
Emily Starkbafa9062017-12-27 15:22:46122
Olivier Robin3d60411622018-02-23 10:03:22123const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = {
124 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
125 {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"},
126 {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"},
127 {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"},
128 {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"},
129 {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"},
130 {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"},
131 {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"},
132 {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"},
133};
134
Nohemi Fernandezc00842a2021-07-26 11:47:34135const FeatureEntry::Choice
136 kWaitThresholdMillisecondsForCapabilitiesApiChoices[] = {
137 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
138 {"200", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "200"},
139 {"500", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "500"},
140 {"5000", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "5000"},
141};
142
Stepan Khapugincc4e9842019-01-23 13:38:13143const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = {
144 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}};
145const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = {
146 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}};
147const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = {
148 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}};
149const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = {
150 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}};
151const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = {
152 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}};
153const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = {
154 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}};
155const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = {
156 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}};
157
158const FeatureEntry::FeatureVariation
159 kOmniboxUIMaxAutocompleteMatchesVariations[] = {
160 {"3 matches", kOmniboxUIMaxAutocompleteMatches3,
Daniel Cheng1f047a82022-02-26 10:04:53161 std::size(kOmniboxUIMaxAutocompleteMatches3), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13162 {"4 matches", kOmniboxUIMaxAutocompleteMatches4,
Daniel Cheng1f047a82022-02-26 10:04:53163 std::size(kOmniboxUIMaxAutocompleteMatches4), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13164 {"5 matches", kOmniboxUIMaxAutocompleteMatches5,
Daniel Cheng1f047a82022-02-26 10:04:53165 std::size(kOmniboxUIMaxAutocompleteMatches5), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13166 {"6 matches", kOmniboxUIMaxAutocompleteMatches6,
Daniel Cheng1f047a82022-02-26 10:04:53167 std::size(kOmniboxUIMaxAutocompleteMatches6), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13168 {"8 matches", kOmniboxUIMaxAutocompleteMatches8,
Daniel Cheng1f047a82022-02-26 10:04:53169 std::size(kOmniboxUIMaxAutocompleteMatches8), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13170 {"10 matches", kOmniboxUIMaxAutocompleteMatches10,
Daniel Cheng1f047a82022-02-26 10:04:53171 std::size(kOmniboxUIMaxAutocompleteMatches10), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13172 {"12 matches", kOmniboxUIMaxAutocompleteMatches12,
Daniel Cheng1f047a82022-02-26 10:04:53173 std::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}};
Stepan Khapugincc4e9842019-01-23 13:38:13174
Stepan Khapuginbac467e2022-05-06 21:11:54175const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches6[] = {
176 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "6"}};
177const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches15[] = {
178 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "15"}};
179const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches20[] = {
180 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "20"}};
181
182const FeatureEntry::FeatureVariation kOmniboxMaxZPSMatchesVariations[] = {
183 {"6 matches", kOmniboxMaxZPSMatches6, std::size(kOmniboxMaxZPSMatches6),
184 nullptr},
185 {"15 matches", kOmniboxMaxZPSMatches15, std::size(kOmniboxMaxZPSMatches15),
186 nullptr},
187 {"20 matches", kOmniboxMaxZPSMatches20, std::size(kOmniboxMaxZPSMatches20),
188 nullptr},
189};
190
Christian Xucf26d562022-07-06 09:28:36191const FeatureEntry::FeatureParam kOmniboxMaxURLMatches5[] = {
192 {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "5"}};
193const FeatureEntry::FeatureParam kOmniboxMaxURLMatches6[] = {
194 {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "6"}};
195const FeatureEntry::FeatureParam kOmniboxMaxURLMatches7[] = {
196 {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "7"}};
197
198const FeatureEntry::FeatureVariation kOmniboxMaxURLMatchesVariations[] = {
199 {"5 matches", kOmniboxMaxURLMatches5, std::size(kOmniboxMaxURLMatches5),
200 nullptr},
201 {"6 matches", kOmniboxMaxURLMatches6, std::size(kOmniboxMaxURLMatches6),
202 nullptr},
203 {"7 matches", kOmniboxMaxURLMatches7, std::size(kOmniboxMaxURLMatches7),
204 nullptr},
205};
206
Cheick Cissef37087902022-10-07 19:01:41207const FeatureEntry::FeatureParam kWhatsNewModuleLayout[] = {
208 {kWhatsNewModuleBasedLayoutParam, "true"}};
209
210const FeatureEntry::FeatureVariation kWhatsNewLayoutVariations[] = {
211 {"Display module layout", kWhatsNewModuleLayout,
212 std::size(kWhatsNewModuleLayout), nullptr},
213};
214
Caitlin Fischer37e01232019-05-24 13:05:45215const FeatureEntry::FeatureParam
216 kAutofillUseMobileLabelDisambiguationShowAll[] = {
217 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
218 autofill::features::
219 kAutofillUseMobileLabelDisambiguationParameterShowAll}};
220const FeatureEntry::FeatureParam
221 kAutofillUseMobileLabelDisambiguationShowOne[] = {
222 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
223 autofill::features::
224 kAutofillUseMobileLabelDisambiguationParameterShowOne}};
225
226const FeatureEntry::FeatureVariation
227 kAutofillUseMobileLabelDisambiguationVariations[] = {
228 {"(show all)", kAutofillUseMobileLabelDisambiguationShowAll,
Daniel Cheng1f047a82022-02-26 10:04:53229 std::size(kAutofillUseMobileLabelDisambiguationShowAll), nullptr},
Caitlin Fischer37e01232019-05-24 13:05:45230 {"(show one)", kAutofillUseMobileLabelDisambiguationShowOne,
Daniel Cheng1f047a82022-02-26 10:04:53231 std::size(kAutofillUseMobileLabelDisambiguationShowOne), nullptr}};
Caitlin Fischer37e01232019-05-24 13:05:45232
Javier Ernesto Flores Roblese85f4a12021-02-23 18:10:10233const FeatureEntry::FeatureParam
Javier Ernesto Flores Robles159414232021-06-16 14:29:59234 kDefaultBrowserFullscreenPromoExperimentRemindMeLater[] = {
235 {kDefaultBrowserFullscreenPromoExperimentRemindMeGroupParam, "true"}};
236const FeatureEntry::FeatureVariation
237 kDefaultBrowserFullscreenPromoExperimentVariations[] = {
238 {"Remind me later",
239 kDefaultBrowserFullscreenPromoExperimentRemindMeLater,
Daniel Cheng1f047a82022-02-26 10:04:53240 std::size(kDefaultBrowserFullscreenPromoExperimentRemindMeLater),
Javier Ernesto Flores Robles159414232021-06-16 14:29:59241 nullptr}};
242
gogeralddb0d8ae2020-11-13 03:56:58243const FeatureEntry::FeatureParam kDiscoverFeedInNtpEnableNativeUI[] = {
244 {kDiscoverFeedIsNativeUIEnabled, "true"}};
245const FeatureEntry::FeatureVariation kDiscoverFeedInNtpVariations[] = {
246 {"Native UI", kDiscoverFeedInNtpEnableNativeUI,
Daniel Cheng1f047a82022-02-26 10:04:53247 std::size(kDiscoverFeedInNtpEnableNativeUI), nullptr}};
gogeralddb0d8ae2020-11-13 03:56:58248
Sergio Collazos9fcc6ed2021-10-06 00:58:03249const FeatureEntry::FeatureParam kDiscoverFeedSRSReconstructedTemplates[] = {
250 {kDiscoverFeedSRSReconstructedTemplatesEnabled, "true"}};
251const FeatureEntry::FeatureParam kDiscoverFeedSRSPreloadTemplates[] = {
252 {kDiscoverFeedSRSPreloadTemplatesEnabled, "true"}};
253const FeatureEntry::FeatureVariation
254 kEnableDiscoverFeedStaticResourceServingVariations[] = {
255 {"Reconstruct Templates", kDiscoverFeedSRSReconstructedTemplates,
Daniel Cheng1f047a82022-02-26 10:04:53256 std::size(kDiscoverFeedSRSReconstructedTemplates), nullptr},
Sergio Collazos9fcc6ed2021-10-06 00:58:03257 {"Preload Templates", kDiscoverFeedSRSPreloadTemplates,
Daniel Cheng1f047a82022-02-26 10:04:53258 std::size(kDiscoverFeedSRSPreloadTemplates), nullptr},
Sergio Collazos9fcc6ed2021-10-06 00:58:03259};
260
Mohammad Refaatab6bee62022-05-16 16:31:15261const FeatureEntry::FeatureParam kDiscoverFeedTopSyncPromoFullWithTitle[] = {
adamtadb0bfc62022-08-01 17:37:47262 {kDiscoverFeedTopSyncPromoStyleFullWithTitle, "true"},
263 {kDiscoverFeedTopSyncPromoStyleCompact, "false"}};
Mohammad Refaatab6bee62022-05-16 16:31:15264const FeatureEntry::FeatureParam kDiscoverFeedTopSyncPromoCompact[] = {
adamtadb0bfc62022-08-01 17:37:47265 {kDiscoverFeedTopSyncPromoStyleFullWithTitle, "false"},
266 {kDiscoverFeedTopSyncPromoStyleCompact, "true"}};
267
Mohammad Refaatab6bee62022-05-16 16:31:15268const FeatureEntry::FeatureVariation kDiscoverFeedTopSyncPromoVariations[] = {
269 {"Full with title", kDiscoverFeedTopSyncPromoFullWithTitle,
270 std::size(kDiscoverFeedTopSyncPromoFullWithTitle), nullptr},
271 {"Compact", kDiscoverFeedTopSyncPromoCompact,
272 std::size(kDiscoverFeedTopSyncPromoCompact), nullptr}};
273
Robbie Gibson46351032022-03-31 19:46:23274const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion1[] = {
275 {kIOSOmniboxUpdatedPopupUIVariationName,
276 kIOSOmniboxUpdatedPopupUIVariation1}};
277const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion2[] = {
278 {kIOSOmniboxUpdatedPopupUIVariationName,
279 kIOSOmniboxUpdatedPopupUIVariation2}};
Stepan Khapugin0fd1869a2022-08-09 10:23:47280const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion3[] = {
281 {kIOSOmniboxUpdatedPopupUIVariationName,
282 kIOSOmniboxUpdatedPopupUIVariation1UIKit}};
283const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion4[] = {
284 {kIOSOmniboxUpdatedPopupUIVariationName,
285 kIOSOmniboxUpdatedPopupUIVariation2UIKit}};
Robbie Gibson46351032022-03-31 19:46:23286const FeatureEntry::FeatureVariation kiOSOmniboxUpdatedPopupUIVariations[] = {
Stepan Khapugin0fd1869a2022-08-09 10:23:47287 {"Version 1 - SwiftUI", kiOSOmniboxUpdatedPopupUIVersion1,
Robbie Gibson46351032022-03-31 19:46:23288 std::size(kiOSOmniboxUpdatedPopupUIVersion1), nullptr},
Stepan Khapugin0fd1869a2022-08-09 10:23:47289 {"Version 2 - SwiftUI", kiOSOmniboxUpdatedPopupUIVersion2,
290 std::size(kiOSOmniboxUpdatedPopupUIVersion2), nullptr},
291 {"Version 1 - UIKit", kiOSOmniboxUpdatedPopupUIVersion3,
292 std::size(kiOSOmniboxUpdatedPopupUIVersion3), nullptr},
293 {"Version 2 - UIKit", kiOSOmniboxUpdatedPopupUIVersion4,
294 std::size(kiOSOmniboxUpdatedPopupUIVersion4), nullptr}};
Robbie Gibson46351032022-03-31 19:46:23295
gogerald53c6e7a2021-04-15 22:07:35296const FeatureEntry::FeatureParam kStartSurfaceTenSecondsShrinkLogo[] = {
Chris Lu5470417c2021-03-03 18:43:08297 {kStartSurfaceShrinkLogoParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35298 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
299const FeatureEntry::FeatureParam kStartSurfaceTenSecondsHideShortcuts[] = {
Chris Lu5470417c2021-03-03 18:43:08300 {kStartSurfaceHideShortcutsParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35301 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
302const FeatureEntry::FeatureParam kStartSurfaceTenSecondsReturnToRecentTab[] = {
Chris Lu5470417c2021-03-03 18:43:08303 {kStartSurfaceReturnToRecentTabParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35304 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
305const FeatureEntry::FeatureParam
306 kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab[] = {
307 {kStartSurfaceShrinkLogoParam, "true"},
308 {kStartSurfaceReturnToRecentTabParam, "true"},
309 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
310const FeatureEntry::FeatureParam
311 kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab[] = {
312 {kStartSurfaceHideShortcutsParam, "true"},
313 {kStartSurfaceReturnToRecentTabParam, "true"},
314 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
315const FeatureEntry::FeatureParam kStartSurfaceOneHourShrinkLogo[] = {
Chris Lu5470417c2021-03-03 18:43:08316 {kStartSurfaceShrinkLogoParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35317 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
318const FeatureEntry::FeatureParam kStartSurfaceOneHourHideShortcuts[] = {
319 {kStartSurfaceHideShortcutsParam, "true"},
320 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
321const FeatureEntry::FeatureParam kStartSurfaceOneHourReturnToRecentTab[] = {
Chris Lu5470417c2021-03-03 18:43:08322 {kStartSurfaceReturnToRecentTabParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35323 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
324const FeatureEntry::FeatureParam
325 kStartSurfaceOneHourShrinkLogoReturnToRecentTab[] = {
326 {kStartSurfaceShrinkLogoParam, "true"},
327 {kStartSurfaceReturnToRecentTabParam, "true"},
328 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
329const FeatureEntry::FeatureParam
330 kStartSurfaceOneHourHideShortcutsReturnToRecentTab[] = {
331 {kStartSurfaceHideShortcutsParam, "true"},
332 {kStartSurfaceReturnToRecentTabParam, "true"},
333 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
Chris Lu5470417c2021-03-03 18:43:08334
gogerald0e39e3aa2021-02-10 18:41:23335const FeatureEntry::FeatureVariation kStartSurfaceVariations[] = {
gogerald53c6e7a2021-04-15 22:07:35336 {"10s:Show Return to Recent Tab tile",
337 kStartSurfaceTenSecondsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53338 std::size(kStartSurfaceTenSecondsReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35339 {"10s:Shrink Logo", kStartSurfaceTenSecondsShrinkLogo,
Daniel Cheng1f047a82022-02-26 10:04:53340 std::size(kStartSurfaceTenSecondsShrinkLogo), nullptr},
gogerald53c6e7a2021-04-15 22:07:35341 {"10s:Hide Shortcuts", kStartSurfaceTenSecondsHideShortcuts,
Daniel Cheng1f047a82022-02-26 10:04:53342 std::size(kStartSurfaceTenSecondsHideShortcuts), nullptr},
gogerald53c6e7a2021-04-15 22:07:35343 {"10s:Shrink Logo and show Return to Recent Tab tile",
344 kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53345 std::size(kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35346 {"10s:Hide Shortcuts and show Return to Recent Tab tile",
347 kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53348 std::size(kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35349 {"1h:Show Return to Recent Tab tile", kStartSurfaceOneHourReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53350 std::size(kStartSurfaceOneHourReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35351 {"1h:Shrink Logo", kStartSurfaceOneHourShrinkLogo,
Daniel Cheng1f047a82022-02-26 10:04:53352 std::size(kStartSurfaceOneHourShrinkLogo), nullptr},
gogerald53c6e7a2021-04-15 22:07:35353 {"1h:Hide Shortcuts", kStartSurfaceOneHourHideShortcuts,
Daniel Cheng1f047a82022-02-26 10:04:53354 std::size(kStartSurfaceOneHourHideShortcuts), nullptr},
gogerald53c6e7a2021-04-15 22:07:35355 {"1h:Shrink Logo and show Return to Recent Tab tile",
356 kStartSurfaceOneHourShrinkLogoReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53357 std::size(kStartSurfaceOneHourShrinkLogoReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35358 {"1h:Hide Shortcuts and show Return to Recent Tab tile",
359 kStartSurfaceOneHourHideShortcutsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53360 std::size(kStartSurfaceOneHourHideShortcutsReturnToRecentTab), nullptr},
Chris Lu5470417c2021-03-03 18:43:08361};
gogerald0e39e3aa2021-02-10 18:41:23362
Chris Lu8e308dc2022-09-06 16:59:40363const FeatureEntry::FeatureParam kModuleRefreshMinimizeSpacing[] = {
364 {kContentSuggestionsUIModuleRefreshMinimizeSpacingParam, "true"}};
365const FeatureEntry::FeatureParam kModuleRefreshNoHeaders[] = {
Chris Lu264e2372022-09-08 13:12:57366 {kContentSuggestionsUIModuleRefreshMinimizeSpacingParam, "true"},
Chris Lu8e308dc2022-09-06 16:59:40367 {kContentSuggestionsUIModuleRefreshRemoveHeadersParam, "true"}};
368
369const FeatureEntry::FeatureVariation kModuleRefreshVariations[] = {
370 {"Enabled with minimized spacing", kModuleRefreshMinimizeSpacing,
371 std::size(kModuleRefreshMinimizeSpacing), nullptr},
Chris Lu264e2372022-09-08 13:12:57372 {"Enabled with no headers and minimized spacing", kModuleRefreshNoHeaders,
Chris Lu8e308dc2022-09-06 16:59:40373 std::size(kModuleRefreshNoHeaders), nullptr},
374};
375
Ed Chin91e44992022-07-27 13:42:34376#if BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
Ed Chin59f617b2022-07-19 22:12:04377// Feed Background Refresh Feature Params
Ed Chin321b8fe2022-08-16 07:02:01378const FeatureEntry::FeatureParam kOneHourIntervalOneHourMaxAgeOnce[] = {
Ed Chin59f617b2022-07-19 22:12:04379 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
380 {kEnableRecurringBackgroundRefreshSchedule, "false"},
Ed Chin321b8fe2022-08-16 07:02:01381 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
Ed Chin59f617b2022-07-19 22:12:04382 {kBackgroundRefreshIntervalInSeconds, /* 60*60= */ "3600"}};
Ed Chin321b8fe2022-08-16 07:02:01383const FeatureEntry::FeatureParam kFourHourIntervalSixHourMaxAgeOnce[] = {
Ed Chin59f617b2022-07-19 22:12:04384 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
385 {kEnableRecurringBackgroundRefreshSchedule, "false"},
Ed Chin321b8fe2022-08-16 07:02:01386 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
Ed Chin59f617b2022-07-19 22:12:04387 {kBackgroundRefreshIntervalInSeconds, /* 4*60*60= */ "14400"}};
Ed Chin321b8fe2022-08-16 07:02:01388const FeatureEntry::FeatureParam kOneHourIntervalOneHourMaxAgeRecurring[] = {
Ed Chin59f617b2022-07-19 22:12:04389 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
390 {kEnableRecurringBackgroundRefreshSchedule, "true"},
Ed Chin321b8fe2022-08-16 07:02:01391 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
Ed Chin59f617b2022-07-19 22:12:04392 {kBackgroundRefreshIntervalInSeconds, /* 60*60= */ "3600"}};
Ed Chin321b8fe2022-08-16 07:02:01393const FeatureEntry::FeatureParam kFourHourIntervalSixHourMaxAgeRecurring[] = {
Ed Chin59f617b2022-07-19 22:12:04394 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
395 {kEnableRecurringBackgroundRefreshSchedule, "true"},
Ed Chin321b8fe2022-08-16 07:02:01396 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
Ed Chin59f617b2022-07-19 22:12:04397 {kBackgroundRefreshIntervalInSeconds, /* 4*60*60= */ "14400"}};
Ed Chin321b8fe2022-08-16 07:02:01398const FeatureEntry::FeatureParam kServerDrivenOneHourMaxAgeOnce[] = {
Ed Chin59f617b2022-07-19 22:12:04399 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
400 {kEnableRecurringBackgroundRefreshSchedule, "false"},
Ed Chin321b8fe2022-08-16 07:02:01401 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
402 {kBackgroundRefreshIntervalInSeconds, "0"}};
403const FeatureEntry::FeatureParam kServerDrivenOneHourMaxAgeRecurring[] = {
Ed Chin59f617b2022-07-19 22:12:04404 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
405 {kEnableRecurringBackgroundRefreshSchedule, "true"},
Ed Chin321b8fe2022-08-16 07:02:01406 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
407 {kBackgroundRefreshIntervalInSeconds, "0"}};
408const FeatureEntry::FeatureParam kServerDrivenSixHourMaxAgeOnce[] = {
409 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
410 {kEnableRecurringBackgroundRefreshSchedule, "false"},
411 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
412 {kBackgroundRefreshIntervalInSeconds, "0"}};
413const FeatureEntry::FeatureParam kServerDrivenSixHourMaxAgeRecurring[] = {
414 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
415 {kEnableRecurringBackgroundRefreshSchedule, "true"},
416 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
417 {kBackgroundRefreshIntervalInSeconds, "0"}};
Ed Chin59f617b2022-07-19 22:12:04418
419// Feed Background Refresh Feature Variations
Ed Chin59f617b2022-07-19 22:12:04420const FeatureEntry::FeatureVariation kFeedBackgroundRefreshVariations[] = {
Ed Chin321b8fe2022-08-16 07:02:01421 {"1hr Interval 1hr Max Age Once", kOneHourIntervalOneHourMaxAgeOnce,
422 std::size(kOneHourIntervalOneHourMaxAgeOnce), nullptr},
423 {"4hr Interval 6hr Max Age Once", kFourHourIntervalSixHourMaxAgeOnce,
424 std::size(kFourHourIntervalSixHourMaxAgeOnce), nullptr},
425 {"1hr Interval 1hr Max Age Recurring",
426 kOneHourIntervalOneHourMaxAgeRecurring,
427 std::size(kOneHourIntervalOneHourMaxAgeRecurring), nullptr},
428 {"4hr Interval 6hr Max Age Recurring",
429 kFourHourIntervalSixHourMaxAgeRecurring,
430 std::size(kFourHourIntervalSixHourMaxAgeRecurring), nullptr},
431 {"Server Driven 1hr Max Age Once", kServerDrivenOneHourMaxAgeOnce,
432 std::size(kServerDrivenOneHourMaxAgeOnce), nullptr},
433 {"Server Driven 1hr Max Age Recurring", kServerDrivenOneHourMaxAgeRecurring,
434 std::size(kServerDrivenOneHourMaxAgeRecurring), nullptr},
435 {"Server Driven 6hr Max Age Once", kServerDrivenSixHourMaxAgeOnce,
436 std::size(kServerDrivenSixHourMaxAgeOnce), nullptr},
437 {"Server Driven 6hr Max Age Recurring", kServerDrivenSixHourMaxAgeRecurring,
438 std::size(kServerDrivenSixHourMaxAgeRecurring), nullptr},
Ed Chin59f617b2022-07-19 22:12:04439};
Ed Chin91e44992022-07-27 13:42:34440#endif // BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
Ed Chin59f617b2022-07-19 22:12:04441
ginnnnnnny46435132022-06-01 16:06:04442const FeatureEntry::FeatureParam kFREDefaultBrowserPromoDefaultDelay[] = {
443 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoDefaultDelayParam}};
444const FeatureEntry::FeatureParam kFREDefaultBrowserPromoFirstRunOnly[] = {
445 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoFirstRunOnlyParam}};
446const FeatureEntry::FeatureParam kFREDefaultBrowserPromoShortDelay[] = {
447 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoShortDelayParam}};
448const FeatureEntry::FeatureVariation kFREDefaultBrowserPromoVariations[] = {
Aliona DANGLA8fae66f02021-10-06 15:47:11449 {"Wait 14 days after FRE default browser promo",
ginnnnnnny46435132022-06-01 16:06:04450 kFREDefaultBrowserPromoDefaultDelay,
451 std::size(kFREDefaultBrowserPromoDefaultDelay), nullptr},
452 {"FRE default browser promo only", kFREDefaultBrowserPromoFirstRunOnly,
453 std::size(kFREDefaultBrowserPromoFirstRunOnly), nullptr},
Aliona DANGLA8fae66f02021-10-06 15:47:11454 {"Wait 3 days after FRE default browser promo",
ginnnnnnny46435132022-06-01 16:06:04455 kFREDefaultBrowserPromoShortDelay,
456 std::size(kFREDefaultBrowserPromoShortDelay), nullptr},
Aliona DANGLA8fae66f02021-10-06 15:47:11457};
458
Chris Luc9a5cb12022-07-20 16:11:39459const FeatureEntry::FeatureParam kTrendingQueriesEnableAllUsers[] = {
Chris Lu85e8cc642022-09-23 20:27:58460 {kTrendingQueriesHideShortcutsParam, "false"}};
Chris Luc9a5cb12022-07-20 16:11:39461const FeatureEntry::FeatureParam kTrendingQueriesEnableAllUsersHideShortcuts[] =
Chris Lu85e8cc642022-09-23 20:27:58462 {{kTrendingQueriesHideShortcutsParam, "true"}};
Chris Luc9a5cb12022-07-20 16:11:39463const FeatureEntry::FeatureParam kTrendingQueriesEnableFeedDisabled[] = {
464 {kTrendingQueriesHideShortcutsParam, "false"},
465 {kTrendingQueriesDisabledFeedParam, "true"},
Chris Lu85e8cc642022-09-23 20:27:58466};
Chris Luc9a5cb12022-07-20 16:11:39467
468const FeatureEntry::FeatureVariation kTrendingQueriesModuleVariations[] = {
469 {"Enabled All Users", kTrendingQueriesEnableAllUsers,
470 std::size(kTrendingQueriesEnableAllUsers), nullptr},
471 {"Enabled All Users Hide Shortcuts",
472 kTrendingQueriesEnableAllUsersHideShortcuts,
473 std::size(kTrendingQueriesEnableAllUsersHideShortcuts), nullptr},
474 {"Enabled Disabled Feed", kTrendingQueriesEnableFeedDisabled,
475 std::size(kTrendingQueriesEnableFeedDisabled), nullptr},
Chris Luc9a5cb12022-07-20 16:11:39476};
477
Jérôme Lebelc46af972022-10-04 15:16:32478const FeatureEntry::FeatureParam kNewMICEFREWithTangibleSyncA[] = {
jlebel041fc1c2022-03-04 12:53:30479 {kNewMobileIdentityConsistencyFREParam,
Jérôme Lebelc46af972022-10-04 15:16:32480 kNewMobileIdentityConsistencyFREParamTangibleSyncA}};
481const FeatureEntry::FeatureParam kNewMICEFREWithTangibleSyncB[] = {
482 {kNewMobileIdentityConsistencyFREParam,
483 kNewMobileIdentityConsistencyFREParamTangibleSyncB}};
484const FeatureEntry::FeatureParam kNewMICEFREWithTangibleSyncC[] = {
485 {kNewMobileIdentityConsistencyFREParam,
486 kNewMobileIdentityConsistencyFREParamTangibleSyncC}};
jlebel041fc1c2022-03-04 12:53:30487const FeatureEntry::FeatureParam kNewMICEFREWithTwoSteps[] = {
488 {kNewMobileIdentityConsistencyFREParam,
489 kNewMobileIdentityConsistencyFREParamTwoSteps}};
Jérôme Lebelce6f7162022-11-07 19:07:32490const FeatureEntry::FeatureParam kNewMICEFREWithTangibleSyncD[] = {
491 {kNewMobileIdentityConsistencyFREParam,
492 kNewMobileIdentityConsistencyFREParamTangibleSyncD}};
493const FeatureEntry::FeatureParam kNewMICEFREWithTangibleSyncE[] = {
494 {kNewMobileIdentityConsistencyFREParam,
495 kNewMobileIdentityConsistencyFREParamTangibleSyncE}};
496const FeatureEntry::FeatureParam kNewMICEFREWithTangibleSyncF[] = {
497 {kNewMobileIdentityConsistencyFREParam,
498 kNewMobileIdentityConsistencyFREParamTangibleSyncF}};
jlebel041fc1c2022-03-04 12:53:30499const FeatureEntry::FeatureVariation
500 kNewMobileIdentityConsistencyFREVariations[] = {
Jérôme Lebelc46af972022-10-04 15:16:32501 {"new FRE with tangible sync A", kNewMICEFREWithTangibleSyncA,
502 std::size(kNewMICEFREWithTangibleSyncA), nullptr},
503 {"new FRE with tangible sync B", kNewMICEFREWithTangibleSyncB,
504 std::size(kNewMICEFREWithTangibleSyncB), nullptr},
505 {"new FRE with tangible sync C", kNewMICEFREWithTangibleSyncC,
506 std::size(kNewMICEFREWithTangibleSyncC), nullptr},
Jérôme Lebelce6f7162022-11-07 19:07:32507 {"new FRE with tangible sync D", kNewMICEFREWithTangibleSyncD,
508 std::size(kNewMICEFREWithTangibleSyncD), nullptr},
509 {"new FRE with tangible sync E", kNewMICEFREWithTangibleSyncE,
510 std::size(kNewMICEFREWithTangibleSyncE), nullptr},
511 {"new FRE with tangible sync F", kNewMICEFREWithTangibleSyncF,
512 std::size(kNewMICEFREWithTangibleSyncF), nullptr},
jlebel041fc1c2022-03-04 12:53:30513 {"new FRE with 2 steps", kNewMICEFREWithTwoSteps,
514 std::size(kNewMICEFREWithTwoSteps), nullptr}};
515
Louis Romero023cc5052022-04-08 23:29:39516const FeatureEntry::FeatureParam kBubbleRichIPHTargetHighlight[] = {
517 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterTargetHighlight}};
Christian Xubd60c4b72022-03-22 15:25:01518const FeatureEntry::FeatureParam kBubbleRichIPHExplicitDismissal[] = {
519 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterExplicitDismissal}};
520const FeatureEntry::FeatureParam kBubbleRichIPHRich[] = {
521 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRich}};
522const FeatureEntry::FeatureParam kBubbleRichIPHRichWithSnooze[] = {
523 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRichWithSnooze}};
524const FeatureEntry::FeatureVariation kBubbleRichIPHVariations[] = {
Louis Romero023cc5052022-04-08 23:29:39525 {"Target Highlight", kBubbleRichIPHTargetHighlight,
526 std::size(kBubbleRichIPHTargetHighlight), nullptr},
Christian Xubd60c4b72022-03-22 15:25:01527 {"Explicit dismissal", kBubbleRichIPHExplicitDismissal,
528 std::size(kBubbleRichIPHExplicitDismissal), nullptr},
529 {"Dismissal and rich content", kBubbleRichIPHRich,
530 std::size(kBubbleRichIPHRich), nullptr},
Louis Romero023cc5052022-04-08 23:29:39531 {"Dismissal, rich content, and snooze", kBubbleRichIPHRichWithSnooze,
Christian Xubd60c4b72022-03-22 15:25:01532 std::size(kBubbleRichIPHRichWithSnooze), nullptr},
533};
534
Christian Xubdedabec2022-07-04 10:00:13535const FeatureEntry::FeatureParam kOmniboxPasteButtonBlueIconCapsule[] = {
536 {kOmniboxPasteButtonParameterName,
537 kOmniboxPasteButtonParameterBlueIconCapsule}};
538const FeatureEntry::FeatureParam kOmniboxPasteButtonBlueFullCapsule[] = {
539 {kOmniboxPasteButtonParameterName,
540 kOmniboxPasteButtonParameterBlueFullCapsule}};
541const FeatureEntry::FeatureVariation kOmniboxPasteButtonVariations[] = {
542 {"Icon only", kOmniboxPasteButtonBlueIconCapsule,
543 std::size(kOmniboxPasteButtonBlueIconCapsule), nullptr},
544 {"Icon and text", kOmniboxPasteButtonBlueFullCapsule,
545 std::size(kOmniboxPasteButtonBlueFullCapsule), nullptr},
546};
547
Igor Ruvinov44fed9f2022-06-10 22:51:42548const FeatureEntry::FeatureParam kDmTokenDeletionParam[] = {{"forced", "true"}};
549const FeatureEntry::FeatureVariation kDmTokenDeletionVariation[] = {
550 {"(Forced)", kDmTokenDeletionParam, std::size(kDmTokenDeletionParam),
551 nullptr}};
552
Aliona DANGLA00ae7db2022-10-04 16:58:50553const FeatureEntry::FeatureParam kOpenInDownloadInShareButton[] = {
Ewann Pelleec8ef892022-10-20 13:13:58554 {kOpenInDownloadParameterName, kOpenInDownloadInShareButtonParam}};
Aliona DANGLAa5257ccc2022-08-29 14:01:49555const FeatureEntry::FeatureParam kOpenInDownloadWithWKDownload[] = {
Ewann Pelleec8ef892022-10-20 13:13:58556 {kOpenInDownloadParameterName, kOpenInDownloadWithWKDownloadParam}};
Aliona DANGLAa5257ccc2022-08-29 14:01:49557const FeatureEntry::FeatureParam kOpenInDownloadWithV2[] = {
Ewann Pelleec8ef892022-10-20 13:13:58558 {kOpenInDownloadParameterName, kOpenInDownloadWithV2Param}};
559
Aliona DANGLAa5257ccc2022-08-29 14:01:49560const FeatureEntry::FeatureVariation kOpenInDownloadVariations[] = {
Aliona DANGLA00ae7db2022-10-04 16:58:50561 {"With legacy download", kOpenInDownloadInShareButton,
562 std::size(kOpenInDownloadInShareButton), nullptr},
Aliona DANGLAa5257ccc2022-08-29 14:01:49563 {"With WKDownload", kOpenInDownloadWithWKDownload,
564 std::size(kOpenInDownloadWithWKDownload), nullptr},
565 {"With V2", kOpenInDownloadWithV2, std::size(kOpenInDownloadWithV2),
566 nullptr},
567};
568
ginnnnnnny591a4972022-09-01 16:10:27569const FeatureEntry::FeatureParam kAutofillBrandingIOSMonotone[] = {
570 {autofill::features::kAutofillBrandingIOSParam, "true"}};
571const FeatureEntry::FeatureVariation kAutofillBrandingIOSVariations[] = {
572 {"(Monotone)", kAutofillBrandingIOSMonotone,
573 std::size(kAutofillBrandingIOSMonotone), nullptr}};
574
Scott Yodercb2fe632022-09-12 15:28:35575const FeatureEntry::FeatureParam kIOSNewPostRestoreExperienceMinimal[] = {
Benjamin Williams3d3a2ec2022-09-13 20:01:26576 {post_restore_signin::features::kIOSNewPostRestoreExperienceParam, "true"}};
Scott Yodercb2fe632022-09-12 15:28:35577const FeatureEntry::FeatureVariation kIOSNewPostRestoreExperienceVariations[] =
578 {{"minimal", kIOSNewPostRestoreExperienceMinimal,
579 std::size(kIOSNewPostRestoreExperienceMinimal), nullptr}};
580
Benjamin Williamsaa8da8142022-11-14 19:51:03581const FeatureEntry::FeatureParam kIOSPopularSitesExcludePopularApps[] = {
582 {ntp_tiles::kIOSPopularSitesExcludePopularAppsParam, "true"}};
583const FeatureEntry::FeatureVariation
584 kIOSPopularSitesImprovedSuggestionsVariations[] = {
585 {"(Exclude popular apps)", kIOSPopularSitesExcludePopularApps,
586 std::size(kIOSPopularSitesExcludePopularApps), nullptr}};
587
Elmehdi Rahmaoui3d549fc2022-10-20 14:31:28588const FeatureEntry::FeatureParam kEnableExperienceKitMapsWithSrp[] = {
589 {kExperienceKitMapsVariationName, kEnableExperienceKitMapsVariationSrp}};
590const FeatureEntry::FeatureVariation kEnableExperienceKitMapsVariations[] = {
591 {"with search result page", kEnableExperienceKitMapsWithSrp,
592 std::size(kEnableExperienceKitMapsWithSrp), nullptr}};
593
adamta3811f9182022-10-24 17:49:33594const FeatureEntry::FeatureParam kFollowingFeedSortTypeGroupedByPublisher[] = {
595 {kFollowingFeedDefaultSortTypeGroupedByPublisher, "true"},
596 {kFollowingFeedDefaultSortTypeSortByLatest, "false"}};
597const FeatureEntry::FeatureParam kFollowingFeedSortTypeSortByLatest[] = {
598 {kFollowingFeedDefaultSortTypeGroupedByPublisher, "false"},
599 {kFollowingFeedDefaultSortTypeSortByLatest, "true"}};
600
601const FeatureEntry::FeatureVariation kFollowingFeedDefaultSortTypeVariations[] =
602 {{"Grouped by Publisher", kFollowingFeedSortTypeGroupedByPublisher,
603 std::size(kFollowingFeedSortTypeGroupedByPublisher), nullptr},
604 {"Sort by Latest", kFollowingFeedSortTypeSortByLatest,
605 std::size(kFollowingFeedSortTypeSortByLatest), nullptr}};
606
Cooper Knaak1e026562017-07-26 05:22:28607// To add a new entry, add to the end of kFeatureEntries. There are four
sdefresne14900ee2015-11-27 14:43:21608// distinct types of entries:
Cooper Knaak1e026562017-07-26 05:22:28609// . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the
610// default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE
sdefresne14900ee2015-11-27 14:43:21611// macro for this type supplying the command line to the macro.
612// . MULTI_VALUE: a list of choices, the first of which should correspond to a
613// deactivated state for this lab (i.e. no command line option). To specify
614// this type of entry use the macro MULTI_VALUE_TYPE supplying it the
615// array of choices.
Cooper Knaak1e026562017-07-26 05:22:28616// . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is
617// either enabled, disabled, or uses the default value of the associated
618// base::Feature instance. To specify this type of entry use the macro
619// FEATURE_VALUE_TYPE supplying it the base::Feature instance.
620// . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a
621// base::Feature instance. Choices corresponding to the default state, a
622// universally enabled state, and a universally disabled state are
623// automatically included. To specify this type of entry use the macro
624// FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and
625// the array of choices.
626//
sdefresne14900ee2015-11-27 14:43:21627// See the documentation of FeatureEntry for details on the fields.
628//
629// When adding a new choice, add it to the end of the list.
630const flags_ui::FeatureEntry kFeatureEntries[] = {
Cooper Knaak1e026562017-07-26 05:22:28631 {"in-product-help-demo-mode-choice",
632 flag_descriptions::kInProductHelpDemoModeName,
633 flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos,
634 FEATURE_WITH_PARAMS_VALUE_TYPE(
Tommy Nyquistc1d6dea12017-07-26 20:37:23635 feature_engagement::kIPHDemoMode,
636 feature_engagement::kIPHDemoModeChoiceVariations,
Marc Treib2752e8b2017-08-04 14:12:09637 "IPH_DemoMode")},
Moe Ahmadic3fd7cd2018-05-11 21:40:22638 {"enable-autofill-credit-card-upload",
639 flag_descriptions::kAutofillCreditCardUploadName,
640 flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos,
Anne Lim579b5732018-08-30 18:24:24641 FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)},
Tina Wang41d431c2021-06-21 21:04:13642 {"enable-discover-feed-preview",
643 flag_descriptions::kEnableDiscoverFeedPreviewName,
644 flag_descriptions::kEnableDiscoverFeedPreviewDescription, flags_ui::kOsIos,
645 FEATURE_VALUE_TYPE(kEnableDiscoverFeedPreview)},
Moe Ahmadid6d5d172018-06-20 17:20:23646 {"use-sync-sandbox", flag_descriptions::kSyncSandboxName,
647 flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos,
648 SINGLE_VALUE_TYPE_AND_VALUE(
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51649 syncer::kSyncServiceURL,
Moe Ahmadid6d5d172018-06-20 17:20:23650 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")},
651 {"wallet-service-use-sandbox",
652 flag_descriptions::kWalletServiceUseSandboxName,
653 flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos,
654 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
655 autofill::switches::kWalletServiceUseSandbox,
656 "1",
657 autofill::switches::kWalletServiceUseSandbox,
658 "0")},
Mohamad Ahmadic4df81f2017-12-20 04:41:59659 {"show-autofill-type-predictions",
660 flag_descriptions::kShowAutofillTypePredictionsName,
661 flag_descriptions::kShowAutofillTypePredictionsDescription,
662 flags_ui::kOsIos,
Gauthier Ambardcfd85182018-01-05 10:37:46663 FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)},
Olivier Robin3d60411622018-02-23 10:03:22664 {"autofill-ios-delay-between-fields",
665 flag_descriptions::kAutofillIOSDelayBetweenFieldsName,
666 flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription,
667 flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)},
Benjamin Williams14233d72022-07-26 18:32:20668 {"fullscreen-promos-manager",
669 flag_descriptions::kFullscreenPromosManagerName,
670 flag_descriptions::kFullscreenPromosManagerDescription, flags_ui::kOsIos,
671 FEATURE_VALUE_TYPE(kFullscreenPromosManager)},
Benjamin Williamsdf18e7e2022-10-03 18:46:05672 {"fullscreen-promos-manager-skip-internal-limits",
673 flag_descriptions::kFullscreenPromosManagerSkipInternalLimitsName,
674 flag_descriptions::kFullscreenPromosManagerSkipInternalLimitsDescription,
675 flags_ui::kOsIos,
676 FEATURE_VALUE_TYPE(kFullscreenPromosManagerSkipInternalLimits)},
Kurt Horimotodc33af32018-05-01 01:39:14677 {"fullscreen-viewport-adjustment-experiment",
Chris Lu481a9322019-09-25 22:16:53678 flag_descriptions::kFullscreenSmoothScrollingName,
679 flag_descriptions::kFullscreenSmoothScrollingDescription, flags_ui::kOsIos,
680 FEATURE_VALUE_TYPE(fullscreen::features::kSmoothScrollingDefault)},
Robbie Gibson1f37a5e2020-08-06 17:03:06681 {"webpage-default-zoom-from-dynamic-type",
682 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeName,
683 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeDescription,
684 flags_ui::kOsIos,
685 FEATURE_VALUE_TYPE(web::kWebPageDefaultZoomFromDynamicType)},
Robbie Gibson88f23962020-09-28 14:35:56686 {"webpage-alternative-text-zoom",
687 flag_descriptions::kWebPageAlternativeTextZoomName,
688 flag_descriptions::kWebPageAlternativeTextZoomDescription,
689 flags_ui::kOsIos, FEATURE_VALUE_TYPE(web::kWebPageAlternativeTextZoom)},
Robbie Gibson1095b72c2022-06-06 17:03:34690 {"webpage-text-zoom-ipad", flag_descriptions::kWebPageTextZoomIPadName,
691 flag_descriptions::kWebPageTextZoomIPadDescription, flags_ui::kOsIos,
692 FEATURE_VALUE_TYPE(web::kWebPageTextZoomIPad)},
Kurt Horimoto79d590b2018-09-12 19:09:28693 {"toolbar-container", flag_descriptions::kToolbarContainerName,
694 flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos,
695 FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)},
Stepan Khapugincc4e9842019-01-23 13:38:13696 {"omnibox-ui-max-autocomplete-matches",
697 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName,
698 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription,
699 flags_ui::kOsIos,
700 FEATURE_WITH_PARAMS_VALUE_TYPE(
701 omnibox::kUIExperimentMaxAutocompleteMatches,
702 kOmniboxUIMaxAutocompleteMatchesVariations,
703 "OmniboxUIMaxAutocompleteVariations")},
Moe Ahmadi01028f22022-08-06 17:57:35704 {"omnibox-local-history-zero-suggest-beyond-ntp",
705 flag_descriptions::kOmniboxLocalHistoryZeroSuggestBeyondNTPName,
706 flag_descriptions::kOmniboxLocalHistoryZeroSuggestBeyondNTPDescription,
707 flags_ui::kOsIos,
708 FEATURE_VALUE_TYPE(omnibox::kLocalHistoryZeroSuggestBeyondNTP)},
Stepan Khapuginbac467e2022-05-06 21:11:54709 {"omnibox-max-zps-matches", flag_descriptions::kOmniboxMaxZPSMatchesName,
710 flag_descriptions::kOmniboxMaxZPSMatchesDescription, flags_ui::kOsIos,
711 FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kMaxZeroSuggestMatches,
712 kOmniboxMaxZPSMatchesVariations,
713 "OmniboxMaxZPSVariations")},
Caitlin Fischer43edd90a2019-05-01 13:24:30714 {"autofill-use-mobile-label-disambiguation",
715 flag_descriptions::kAutofillUseMobileLabelDisambiguationName,
716 flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription,
717 flags_ui::kOsIos,
Caitlin Fischer37e01232019-05-24 13:05:45718 FEATURE_WITH_PARAMS_VALUE_TYPE(
719 autofill::features::kAutofillUseMobileLabelDisambiguation,
720 kAutofillUseMobileLabelDisambiguationVariations,
721 "AutofillUseMobileLabelDisambiguation")},
Mike Doughertyb6c770d2019-09-13 22:56:46722 {"ios-breadcrumbs", flag_descriptions::kLogBreadcrumbsName,
723 flag_descriptions::kLogBreadcrumbsDescription, flags_ui::kOsIos,
Jesse McKenna85c1a59f2021-05-05 19:08:30724 FEATURE_VALUE_TYPE(breadcrumbs::kLogBreadcrumbs)},
Jérôme Lebelc374fdd2019-09-27 10:36:48725 {"force-startup-signin-promo",
726 flag_descriptions::kForceStartupSigninPromoName,
727 flag_descriptions::kForceStartupSigninPromoDescription, flags_ui::kOsIos,
Alice Wang345e09442021-07-05 09:03:29728 FEATURE_VALUE_TYPE(switches::kForceStartupSigninPromo)},
Yoichi Osato7ae11752021-03-16 03:27:22729 {"restore-session-from-cache",
730 flag_descriptions::kRestoreSessionFromCacheName,
731 flag_descriptions::kRestoreSessionFromCacheDescription, flags_ui::kOsIos,
Justin Cohen3ec2522c2021-04-23 18:23:49732 FEATURE_VALUE_TYPE(web::kRestoreSessionFromCache)},
sczs4622e6e2019-11-06 01:17:59733 {"autofill-save-card-dismiss-on-navigation",
734 flag_descriptions::kAutofillSaveCardDismissOnNavigationName,
735 flag_descriptions::kAutofillSaveCardDismissOnNavigationDescription,
736 flags_ui::kOsIos,
737 FEATURE_VALUE_TYPE(
738 autofill::features::kAutofillSaveCardDismissOnNavigation)},
sczs37d9c132020-07-18 06:06:33739 {"new-content-suggestions-feed", flag_descriptions::kDiscoverFeedInNtpName,
adamta22a4d502020-05-21 03:12:21740 flag_descriptions::kDiscoverFeedInNtpDescription, flags_ui::kOsIos,
gogeralddb0d8ae2020-11-13 03:56:58741 FEATURE_WITH_PARAMS_VALUE_TYPE(kDiscoverFeedInNtp,
742 kDiscoverFeedInNtpVariations,
743 "IOSDiscoverFeed")},
Roberto Mourab87b9722020-06-17 17:12:09744 {"expanded-tab-strip", flag_descriptions::kExpandedTabStripName,
745 flag_descriptions::kExpandedTabStripDescription, flags_ui::kOsIos,
746 FEATURE_VALUE_TYPE(kExpandedTabStrip)},
Tommy Martino6b4eb7e2020-06-25 18:25:41747 {"shared-highlighting-ios", flag_descriptions::kSharedHighlightingIOSName,
748 flag_descriptions::kSharedHighlightingIOSDescription, flags_ui::kOsIos,
749 FEATURE_VALUE_TYPE(kSharedHighlightingIOS)},
jlebel041fc1c2022-03-04 12:53:30750 {"new-mobile-identity-consistency-fre",
751 flag_descriptions::kNewMobileIdentityConsistencyFREName,
752 flag_descriptions::kNewMobileIdentityConsistencyFREDescription,
753 flags_ui::kOsIos,
754 FEATURE_WITH_PARAMS_VALUE_TYPE(signin::kNewMobileIdentityConsistencyFRE,
755 kNewMobileIdentityConsistencyFREVariations,
ginnnnnnny46435132022-06-01 16:06:04756 kIOSMICeAndDefaultBrowserTrialName)},
Sylvain Defresne9c107082020-10-27 16:39:13757#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
edchin81467b82020-09-03 19:31:45758 {"screen-time-integration-ios",
759 flag_descriptions::kScreenTimeIntegrationName,
760 flag_descriptions::kScreenTimeIntegrationDescription, flags_ui::kOsIos,
761 FEATURE_VALUE_TYPE(kScreenTimeIntegration)},
Sylvain Defresne9c107082020-10-27 16:39:13762#endif
Nazerke3e993f72020-09-21 13:00:06763 {"modern-tab-strip", flag_descriptions::kModernTabStripName,
764 flag_descriptions::kModernTabStripDescription, flags_ui::kOsIos,
765 FEATURE_VALUE_TYPE(kModernTabStrip)},
Eugene Butf869bff2020-12-10 01:16:55766 {"record-snapshot-size", flag_descriptions::kRecordSnapshotSizeName,
767 flag_descriptions::kRecordSnapshotSizeDescription, flags_ui::kOsIos,
768 FEATURE_VALUE_TYPE(web::features::kRecordSnapshotSize)},
Chris Lub17195f2020-12-10 20:49:14769 {"default-browser-fullscreen-promo-experiment",
770 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentName,
771 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentDescription,
772 flags_ui::kOsIos,
Javier Ernesto Flores Robles159414232021-06-16 14:29:59773 FEATURE_WITH_PARAMS_VALUE_TYPE(
774 kDefaultBrowserFullscreenPromoExperiment,
775 kDefaultBrowserFullscreenPromoExperimentVariations,
776 "IOSDefaultBrowserFullscreenPromoExperiment")},
Cheick Cisse76ade3d2020-12-16 00:15:11777 {"ios-shared-highlighting-color-change",
778 flag_descriptions::kIOSSharedHighlightingColorChangeName,
779 flag_descriptions::kIOSSharedHighlightingColorChangeDescription,
Cheick Cissed0b5bfe2021-02-11 14:23:07780 flags_ui::kOsIos,
781 FEATURE_VALUE_TYPE(web::features::kIOSSharedHighlightingColorChange)},
Cheick Cissefe994862021-12-15 16:01:34782 {"ios-shared-highlighting-v2",
783 flag_descriptions::kIOSSharedHighlightingV2Name,
784 flag_descriptions::kIOSSharedHighlightingV2Description, flags_ui::kOsIos,
785 FEATURE_VALUE_TYPE(shared_highlighting::kIOSSharedHighlightingV2)},
Stepan Khapugin04341202021-01-07 12:22:45786 {"omnibox-new-textfield-implementation",
787 flag_descriptions::kOmniboxNewImplementationName,
788 flag_descriptions::kOmniboxNewImplementationDescription, flags_ui::kOsIos,
789 FEATURE_VALUE_TYPE(kIOSNewOmniboxImplementation)},
Stepan Khapugin0be8f6d2022-09-21 20:22:26790 {"omnibox-on-focus-suggestions-contextual-web",
791 flag_descriptions::kOmniboxFocusTriggersContextualWebZeroSuggestName,
792 flag_descriptions::
793 kOmniboxFocusTriggersContextualWebZeroSuggestDescription,
794 flags_ui::kOsIos,
795 FEATURE_VALUE_TYPE(omnibox::kFocusTriggersContextualWebZeroSuggest)},
796 {"omnibox-on-focus-suggestions-srp",
797 flag_descriptions::kOmniboxFocusTriggersSRPZeroSuggestName,
798 flag_descriptions::kOmniboxFocusTriggersSRPZeroSuggestDescription,
799 flags_ui::kOsIos,
800 FEATURE_VALUE_TYPE(omnibox::kFocusTriggersSRPZeroSuggest)},
Stepan Khapuginecf128a92022-08-30 11:23:15801 {"omnibox-fuzzy-url-suggestions",
802 flag_descriptions::kOmniboxFuzzyUrlSuggestionsName,
803 flag_descriptions::kOmniboxFuzzyUrlSuggestionsDescription,
804 flags_ui::kOsIos,
805 FEATURE_VALUE_TYPE(omnibox::kOmniboxFuzzyUrlSuggestions)},
Stepan Khapugin422f08d2022-02-18 16:19:44806 {"omnibox-new-popup-ui", flag_descriptions::kIOSOmniboxUpdatedPopupUIName,
807 flag_descriptions::kIOSOmniboxUpdatedPopupUIDescription, flags_ui::kOsIos,
Robbie Gibson46351032022-03-31 19:46:23808 FEATURE_WITH_PARAMS_VALUE_TYPE(kIOSOmniboxUpdatedPopupUI,
809 kiOSOmniboxUpdatedPopupUIVariations,
Stepan Khapugina45baed2022-05-13 19:15:43810 "IOSOmniboxUpdatedPopupUI")},
gogerald0ff29e52021-02-03 18:56:19811 {"start-surface", flag_descriptions::kStartSurfaceName,
812 flag_descriptions::kStartSurfaceDescription, flags_ui::kOsIos,
gogerald0e39e3aa2021-02-10 18:41:23813 FEATURE_WITH_PARAMS_VALUE_TYPE(kStartSurface,
814 kStartSurfaceVariations,
815 "StartSurface")},
Justin Cohen13ac7a202021-02-04 18:27:28816 {"ios-crashpad", flag_descriptions::kCrashpadIOSName,
817 flag_descriptions::kCrashpadIOSDescription, flags_ui::kOsIos,
818 FEATURE_VALUE_TYPE(kCrashpadIOS)},
Vidhan Jain451b4752021-07-15 10:16:42819 {"autofill-address-verification-in-save-prompt",
820 flag_descriptions::kEnableAutofillAddressSavePromptAddressVerificationName,
821 flag_descriptions::
822 kEnableAutofillAddressSavePromptAddressVerificationDescription,
823 flags_ui::kOsIos,
824 FEATURE_VALUE_TYPE(
825 autofill::features::
826 kAutofillAddressProfileSavePromptAddressVerificationSupport)},
Vidhan Jaina65741552021-03-09 17:18:27827 {"autofill-address-save-prompt",
828 flag_descriptions::kEnableAutofillAddressSavePromptName,
829 flag_descriptions::kEnableAutofillAddressSavePromptDescription,
830 flags_ui::kOsIos,
831 FEATURE_VALUE_TYPE(autofill::features::kAutofillAddressProfileSavePrompt)},
Viktor Semeniuk68e794a2021-03-24 10:23:25832 {"filling-across-affiliated-websites",
833 flag_descriptions::kFillingAcrossAffiliatedWebsitesName,
834 flag_descriptions::kFillingAcrossAffiliatedWebsitesDescription,
835 flags_ui::kOsIos,
836 FEATURE_VALUE_TYPE(
837 password_manager::features::kFillingAcrossAffiliatedWebsites)},
Jared Sauld47c2b72021-03-25 22:47:31838 {"autofill-parse-merchant-promo-code-fields",
839 flag_descriptions::kAutofillParseMerchantPromoCodeFieldsName,
840 flag_descriptions::kAutofillParseMerchantPromoCodeFieldsDescription,
841 flags_ui::kOsIos,
842 FEATURE_VALUE_TYPE(
843 autofill::features::kAutofillParseMerchantPromoCodeFields)},
edchin257cea2f2021-04-07 13:07:13844 {"interest-feed-v2-clicks-and-views-cond-upload",
845 flag_descriptions::kInterestFeedV2ClickAndViewActionsConditionalUploadName,
846 flag_descriptions::
847 kInterestFeedV2ClickAndViewActionsConditionalUploadDescription,
848 flags_ui::kOsIos,
849 FEATURE_VALUE_TYPE(feed::kInterestFeedV2ClicksAndViewsConditionalUpload)},
Side Yilmaz6c53f7102021-09-07 13:26:19850 {"incognito-ntp-revamp", flag_descriptions::kIncognitoNtpRevampName,
851 flag_descriptions::kIncognitoNtpRevampDescription, flags_ui::kOsIos,
852 FEATURE_VALUE_TYPE(kIncognitoNtpRevamp)},
Side YILMAZ4b40a3082022-04-11 10:13:33853 {"update-history-entry-points-in-incognito",
854 flag_descriptions::kUpdateHistoryEntryPointsInIncognitoName,
855 flag_descriptions::kUpdateHistoryEntryPointsInIncognitoDescription,
856 flags_ui::kOsIos,
857 FEATURE_VALUE_TYPE(kUpdateHistoryEntryPointsInIncognito)},
Mikel Astiz850b0fe2021-06-16 09:47:27858 {"sync-trusted-vault-passphrase-promo",
859 flag_descriptions::kSyncTrustedVaultPassphrasePromoName,
860 flag_descriptions::kSyncTrustedVaultPassphrasePromoDescription,
861 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51862 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphrasePromo)},
Mikel Astiz850b0fe2021-06-16 09:47:27863 {"sync-trusted-vault-passphrase-recovery",
864 flag_descriptions::kSyncTrustedVaultPassphraseRecoveryName,
865 flag_descriptions::kSyncTrustedVaultPassphraseRecoveryDescription,
866 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51867 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseRecovery)},
Nohemi Fernandezc00842a2021-07-26 11:47:34868 {"wait-threshold-seconds-for-capabilities-api",
869 flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiName,
870 flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiDescription,
871 flags_ui::kOsIos,
872 MULTI_VALUE_TYPE(kWaitThresholdMillisecondsForCapabilitiesApiChoices)},
Jared Saul2188f762021-08-02 21:22:23873 {"autofill-fill-merchant-promo-code-fields",
874 flag_descriptions::kAutofillFillMerchantPromoCodeFieldsName,
875 flag_descriptions::kAutofillFillMerchantPromoCodeFieldsDescription,
876 flags_ui::kOsIos,
877 FEATURE_VALUE_TYPE(
878 autofill::features::kAutofillFillMerchantPromoCodeFields)},
Sylvain Defresnedff67e42021-09-24 09:43:03879 {"new-overflow-menu", flag_descriptions::kNewOverflowMenuName,
880 flag_descriptions::kNewOverflowMenuDescription, flags_ui::kOsIos,
881 FEATURE_VALUE_TYPE(kNewOverflowMenu)},
Robbie Gibsondf097a72022-09-05 08:17:18882 {"new-overflow-menu-alternate-iph",
883 flag_descriptions::kNewOverflowMenuAlternateIPHName,
884 flag_descriptions::kNewOverflowMenuAlternateIPHDescription,
885 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kNewOverflowMenuAlternateIPH)},
Robbie Gibson640bccb32022-05-10 18:43:35886 {"new-overflow-menu-cbd-action",
887 flag_descriptions::kNewOverflowMenuCBDActionName,
888 flag_descriptions::kNewOverflowMenuCBDActionDescription, flags_ui::kOsIos,
889 FEATURE_VALUE_TYPE(kNewOverflowMenuCBDAction)},
Evan Bernstein0a85f332021-09-29 19:07:24890 {"use-lens-to-search-for-image",
891 flag_descriptions::kUseLensToSearchForImageName,
892 flag_descriptions::kUseLensToSearchForImageDescription, flags_ui::kOsIos,
Ali Juma02a9b7b2021-10-01 13:44:44893 FEATURE_VALUE_TYPE(kUseLensToSearchForImage)},
Jason Hu3830a072022-08-19 20:56:22894 {"enable-lens-in-home-screen-widget",
895 flag_descriptions::kEnableLensInHomeScreenWidgetName,
896 flag_descriptions::kEnableLensInHomeScreenWidgetDescription,
897 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableLensInHomeScreenWidget)},
898 {"enable-lens-in-keyboard", flag_descriptions::kEnableLensInKeyboardName,
899 flag_descriptions::kEnableLensInKeyboardDescription, flags_ui::kOsIos,
900 FEATURE_VALUE_TYPE(kEnableLensInKeyboard)},
901 {"enable-lens-in-ntp", flag_descriptions::kEnableLensInNTPName,
902 flag_descriptions::kEnableLensInNTPDescription, flags_ui::kOsIos,
903 FEATURE_VALUE_TYPE(kEnableLensInNTP)},
Jason Hu67cfb0f2022-11-14 20:21:44904 {"enable-lens-in-omnibox-copied-image",
905 flag_descriptions::kEnableLensInOmniboxCopiedImageName,
906 flag_descriptions::kEnableLensInOmniboxCopiedImageDescription,
907 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableLensInOmniboxCopiedImage)},
Benjamin Williamsbee6ab62022-02-28 18:09:40908 {"use-load-simulated-request-for-error-page-navigation",
Gauthier Ambard33cceaf2022-05-05 14:00:23909 flag_descriptions::kUseLoadSimulatedRequestForOfflinePageName,
910 flag_descriptions::kUseLoadSimulatedRequestForOfflinePageDescription,
Benjamin Williamsbee6ab62022-02-28 18:09:40911 flags_ui::kOsIos,
Gauthier Ambard33cceaf2022-05-05 14:00:23912 FEATURE_VALUE_TYPE(web::features::kUseLoadSimulatedRequestForOfflinePage)},
Sergio Collazos9fcc6ed2021-10-06 00:58:03913 {"enable-discover-feed-static-resource-serving",
914 flag_descriptions::kEnableDiscoverFeedStaticResourceServingName,
915 flag_descriptions::kEnableDiscoverFeedStaticResourceServingDescription,
916 flags_ui::kOsIos,
917 FEATURE_WITH_PARAMS_VALUE_TYPE(
918 kEnableDiscoverFeedStaticResourceServing,
919 kEnableDiscoverFeedStaticResourceServingVariations,
920 "IOSDiscoverFeedStaticResourceServing")},
921 {"enable-disco-feed-endpoint",
922 flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointName,
923 flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointDescription,
924 flags_ui::kOsIos,
Aliona DANGLA8fae66f02021-10-06 15:47:11925 FEATURE_VALUE_TYPE(kEnableDiscoverFeedDiscoFeedEndpoint)},
Mohammad Refaatab6bee62022-05-16 16:31:15926 {"enable-discover-feed-top-sync-promo",
927 flag_descriptions::kEnableDiscoverFeedTopSyncPromoName,
928 flag_descriptions::kEnableDiscoverFeedTopSyncPromoDescription,
929 flags_ui::kOsIos,
930 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableDiscoverFeedTopSyncPromo,
931 kDiscoverFeedTopSyncPromoVariations,
932 "EnableDiscoverFeedTopSyncPromo")},
Aliona DANGLA8fae66f02021-10-06 15:47:11933 {"enable-fre-default-browser-screen-testing",
ginnnnnnny46435132022-06-01 16:06:04934 flag_descriptions::kEnableFREDefaultBrowserPromoScreenName,
935 flag_descriptions::kEnableFREDefaultBrowserPromoScreenDescription,
Aliona DANGLA8fae66f02021-10-06 15:47:11936 flags_ui::kOsIos,
ginnnnnnny46435132022-06-01 16:06:04937 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFREDefaultBrowserPromoScreen,
938 kFREDefaultBrowserPromoVariations,
939 kIOSMICeAndDefaultBrowserTrialName)},
Tommy Martino7393d762021-10-12 17:59:28940 {"shared-highlighting-amp",
941 flag_descriptions::kIOSSharedHighlightingAmpName,
942 flag_descriptions::kIOSSharedHighlightingAmpDescription, flags_ui::kOsIos,
943 FEATURE_VALUE_TYPE(shared_highlighting::kSharedHighlightingAmp)},
David Maunderf4a5e1e2021-10-18 17:24:28944 {"enable-commerce-price-tracking",
Matt Jones125dfb42022-02-11 17:23:42945 commerce::flag_descriptions::kCommercePriceTrackingName,
946 commerce::flag_descriptions::kCommercePriceTrackingDescription,
947 flags_ui::kOsIos,
948 FEATURE_WITH_PARAMS_VALUE_TYPE(commerce::kCommercePriceTracking,
949 commerce::kCommercePriceTrackingVariations,
adamta67b6c5812021-10-19 17:02:15950 "CommercePriceTracking")},
Tina Wang8058d5f2021-11-04 20:06:06951 {"web-feed-ios", flag_descriptions::kEnableWebChannelsName,
952 flag_descriptions::kEnableWebChannelsDescription, flags_ui::kOsIos,
953 FEATURE_VALUE_TYPE(kEnableWebChannels)},
adamta39331592021-11-01 20:18:54954 {"ntp-view-hierarchy-repair",
955 flag_descriptions::kNTPViewHierarchyRepairName,
956 flag_descriptions::kNTPViewHierarchyRepairDescription, flags_ui::kOsIos,
957 FEATURE_VALUE_TYPE(kNTPViewHierarchyRepair)},
Justin Cohen69cec682021-11-04 20:10:26958 {"synthesized-restore-session",
959 flag_descriptions::kSynthesizedRestoreSessionName,
960 flag_descriptions::kSynthesizedRestoreSessionDescription, flags_ui::kOsIos,
961 FEATURE_VALUE_TYPE(web::features::kSynthesizedRestoreSession)},
Benjamin Williams0e7e2fb2021-11-17 03:03:41962 {"enable-password-manager-branding-update",
963 flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateName,
964 flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateDescription,
965 flags_ui::kOsIos,
Aliona DANGLAe5b0b6e52021-11-30 11:58:19966 FEATURE_VALUE_TYPE(
967 password_manager::features::kIOSEnablePasswordManagerBrandingUpdate)},
ginnnnnnnyee3036e2022-08-12 18:01:18968 {"ios-media-permissions-control",
969 flag_descriptions::kMediaPermissionsControlName,
970 flag_descriptions::kMediaPermissionsControlDescription, flags_ui::kOsIos,
971 FEATURE_VALUE_TYPE(web::features::kMediaPermissionsControl)},
Olivier Robin3a957df2021-12-21 18:04:34972 {"enable-save-session-tabs-in-separate-files",
973 flag_descriptions::kSaveSessionTabsToSeparateFilesName,
974 flag_descriptions::kSaveSessionTabsToSeparateFilesDescription,
975 flags_ui::kOsIos,
976 FEATURE_VALUE_TYPE(sessions::kSaveSessionTabsToSeparateFiles)},
Ewann8c7aadc2022-05-19 15:41:05977 {"use-sf-symbols", flag_descriptions::kUseSFSymbolsName,
978 flag_descriptions::kUseSFSymbolsDescription, flags_ui::kOsIos,
979 FEATURE_VALUE_TYPE(kUseSFSymbols)},
Nohemi Fernandez76f54802022-01-10 18:23:32980 {"enable-unicorn-account-support",
981 flag_descriptions::kEnableUnicornAccountSupportName,
982 flag_descriptions::kEnableUnicornAccountSupportDescription,
983 flags_ui::kOsIos,
984 FEATURE_VALUE_TYPE(signin::kEnableUnicornAccountSupport)},
David Jeanc2b88ab602022-08-08 14:52:51985 {"ios-webpage-intent-annotations",
986 flag_descriptions::kEnableWebPageAnnotationsName,
987 flag_descriptions::kEnableWebPageAnnotationsDescription, flags_ui::kOsIos,
988 FEATURE_VALUE_TYPE(web::features::kEnableWebPageAnnotations)},
Veronique Nguyen11f8c9f2022-09-12 16:51:26989 {"enable-password-grouping", flag_descriptions::kPasswordsGroupingName,
990 flag_descriptions::kPasswordsGroupingDescription, flags_ui::kOsIos,
991 FEATURE_VALUE_TYPE(password_manager::features::kPasswordsGrouping)},
Shivani Chauhanbf97b0d2022-02-08 22:21:28992 {"autofill-enable-sending-bcn-in-get-upload-details",
993 flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsName,
994 flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsDescription,
995 flags_ui::kOsIos,
996 FEATURE_VALUE_TYPE(
997 autofill::features::kAutofillEnableSendingBcnInGetUploadDetails)},
Ali Juma1429cf8a2022-02-09 15:31:01998 {"enable-fullscreen-api", flag_descriptions::kEnableFullscreenAPIName,
999 flag_descriptions::kEnableFullscreenAPIDescription, flags_ui::kOsIos,
1000 FEATURE_VALUE_TYPE(web::features::kEnableFullscreenAPI)},
Joemer Ramos34175732022-02-14 18:59:161001 {"enable-enhanced-safe-browsing",
1002 flag_descriptions::kEnhancedProtectionName,
1003 flag_descriptions::kEnhancedProtectionDescription, flags_ui::kOsIos,
1004 FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtection)},
Joemer Ramos26e2b512022-05-24 17:26:411005 {"enable-enhanced-safe-browsing-phase-2",
1006 flag_descriptions::kEnhancedProtectionPhase2Name,
1007 flag_descriptions::kEnhancedProtectionPhase2Description, flags_ui::kOsIos,
1008 FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtectionPhase2IOS)},
Joemer Ramosc34a30a02022-09-22 15:18:431009 {"enable-tailored-security-integration",
1010 flag_descriptions::kTailoredSecurityIntegrationName,
1011 flag_descriptions::kTailoredSecurityIntegrationDescription,
1012 flags_ui::kOsIos,
1013 FEATURE_VALUE_TYPE(safe_browsing::kTailoredSecurityIntegration)},
Shivani Chauhanaf1eb74d2022-02-11 21:13:191014 {"autofill-enable-unmask-card-request-set-instrument-id",
1015 flag_descriptions::kAutofillEnableUnmaskCardRequestSetInstrumentIdName,
1016 flag_descriptions::
1017 kAutofillEnableUnmaskCardRequestSetInstrumentIdDescription,
1018 flags_ui::kOsIos,
1019 FEATURE_VALUE_TYPE(
1020 autofill::features::kAutofillEnableUnmaskCardRequestSetInstrumentId)},
Vishwas Uppoor89303a92022-08-03 00:56:261021 {"autofill-enable-card-product-name",
1022 flag_descriptions::kAutofillEnableCardProductNameName,
1023 flag_descriptions::kAutofillEnableCardProductNameDescription,
1024 flags_ui::kOsIos,
1025 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableCardProductName)},
Victor Hugo Vianna Silvaf0a44002022-02-16 10:38:001026 {"send-tab-to-self-signin-promo",
1027 flag_descriptions::kSendTabToSelfSigninPromoName,
1028 flag_descriptions::kSendTabToSelfSigninPromoDescription, flags_ui::kOsIos,
1029 FEATURE_VALUE_TYPE(send_tab_to_self::kSendTabToSelfSigninPromo)},
Christian Xubd60c4b72022-03-22 15:25:011030 {"bubble-rich-iph", flag_descriptions::kBubbleRichIPHName,
1031 flag_descriptions::kBubbleRichIPHDescription, flags_ui::kOsIos,
1032 FEATURE_WITH_PARAMS_VALUE_TYPE(kBubbleRichIPH,
1033 kBubbleRichIPHVariations,
1034 "BubbleRichIPH")},
Siyu Anff02e742022-04-07 19:08:221035 {"autofill-enforce-delays-in-strike-database",
1036 flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseName,
1037 flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseDescription,
1038 flags_ui::kOsIos,
1039 FEATURE_VALUE_TYPE(
1040 autofill::features::kAutofillEnforceDelaysInStrikeDatabase)},
Jared Saulb0473bd2022-04-20 00:03:411041 {"autofill-upstream-allow-additional-email-domains",
1042 flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsName,
1043 flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsDescription,
1044 flags_ui::kOsIos,
1045 FEATURE_VALUE_TYPE(
1046 autofill::features::kAutofillUpstreamAllowAdditionalEmailDomains)},
1047 {"autofill-upstream-allow-all-email-domains",
1048 flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsName,
1049 flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsDescription,
1050 flags_ui::kOsIos,
1051 FEATURE_VALUE_TYPE(
1052 autofill::features::kAutofillUpstreamAllowAllEmailDomains)},
Olivier Robinffe767c2022-04-21 13:13:231053 {"enable-tflite-language-detection",
1054 flag_descriptions::kTFLiteLanguageDetectionName,
1055 flag_descriptions::kTFLiteLanguageDetectionDescription, flags_ui::kOsIos,
1056 FEATURE_VALUE_TYPE(translate::kTFLiteLanguageDetectionEnabled)},
Raj Ta921ffc2022-08-25 19:00:201057 {"optimization-guide-debug-logs",
1058 flag_descriptions::kOptimizationGuideDebugLogsName,
1059 flag_descriptions::kOptimizationGuideDebugLogsDescription,
1060 flags_ui::kOsIos,
1061 SINGLE_VALUE_TYPE(optimization_guide::switches::kDebugLoggingEnabled)},
Olivier Robinffe767c2022-04-21 13:13:231062 {"optimization-guide-model-downloading",
1063 flag_descriptions::kOptimizationGuideModelDownloadingName,
1064 flag_descriptions::kOptimizationGuideModelDownloadingDescription,
1065 flags_ui::kOsIos,
1066 FEATURE_VALUE_TYPE(
1067 optimization_guide::features::kOptimizationGuideModelDownloading)},
1068 {"optimization-target-prediction",
1069 flag_descriptions::kOptimizationTargetPredictionName,
1070 flag_descriptions::kOptimizationTargetPredictionDescription,
1071 flags_ui::kOsIos,
1072 FEATURE_VALUE_TYPE(
1073 optimization_guide::features::kOptimizationTargetPrediction)},
Rushan Suleymanov727309602022-04-28 20:08:541074 {"sync-standalone-invalidations", flag_descriptions::kSyncInvalidationsName,
1075 flag_descriptions::kSyncInvalidationsDescription, flags_ui::kOsIos,
1076 FEATURE_VALUE_TYPE(::syncer::kUseSyncInvalidations)},
1077 {"sync-standalone-invalidations-wallet-and-offer",
1078 flag_descriptions::kSyncInvalidationsWalletAndOfferName,
1079 flag_descriptions::kSyncInvalidationsWalletAndOfferDescription,
1080 flags_ui::kOsIos,
1081 FEATURE_VALUE_TYPE(::syncer::kUseSyncInvalidationsForWalletAndOffer)},
Christian Xub8c06cd2022-04-29 20:55:011082 {"suggestions-scrolling-ipad",
1083 flag_descriptions::kEnableSuggestionsScrollingOnIPadName,
1084 flag_descriptions::kEnableSuggestionsScrollingOnIPadDescription,
1085 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableSuggestionsScrollingOnIPad)},
David Jean7a8fa702022-05-02 15:21:221086 {"experience-kit-calendar", flag_descriptions::kCalendarExperienceKitName,
1087 flag_descriptions::kCalendarExperienceKitDescription, flags_ui::kOsIos,
1088 FEATURE_VALUE_TYPE(kCalendarExperienceKit)},
Elmehdi Rahmaoui21e87d52022-11-09 15:00:551089 {"experience-kit-apple-calendar",
1090 flag_descriptions::kAppleCalendarExperienceKitName,
1091 flag_descriptions::kAppleCalendarExperienceKitDescription,
1092 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableExpKitAppleCalendar)},
Zhixiang Teoh82d17bb2022-06-16 21:00:391093 {"enable-expkit-calendar-text-classifier",
1094 flag_descriptions::kEnableExpKitCalendarTextClassifierName,
1095 flag_descriptions::kEnableExpKitCalendarTextClassifierDescription,
1096 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableExpKitCalendarTextClassifier)},
Elmehdi Rahmaoui9d4ce40c62022-08-05 15:31:181097 {"experience-kit-maps", flag_descriptions::kMapsExperienceKitName,
1098 flag_descriptions::kMapsExperienceKitDescription, flags_ui::kOsIos,
Elmehdi Rahmaoui3d549fc2022-10-20 14:31:281099 FEATURE_WITH_PARAMS_VALUE_TYPE(kMapsExperienceKit,
1100 kEnableExperienceKitMapsVariations,
1101 "IOSExperienceKitMaps")},
Elmehdi Rahmaouic699dc12022-10-12 11:17:051102 {"enable-long-press-surrounding-text",
1103 flag_descriptions::kLongPressSurroundingTextName,
1104 flag_descriptions::kLongPressSurroundingTextDescription, flags_ui::kOsIos,
1105 FEATURE_VALUE_TYPE(web::features::kLongPressSurroundingText)},
Mustafa Emre Acer4de8863a2022-05-03 22:17:011106 {"https-only-mode", flag_descriptions::kHttpsOnlyModeName,
1107 flag_descriptions::kHttpsOnlyModeDescription, flags_ui::kOsIos,
1108 FEATURE_VALUE_TYPE(security_interstitials::features::kHttpsOnlyMode)},
Mustafa Emre Acerb8bb01f2022-07-20 19:43:251109 {"omnibox-https-upgrades", flag_descriptions::kOmniboxHttpsUpgradesName,
1110 flag_descriptions::kOmniboxHttpsUpgradesDescription, flags_ui::kOsIos,
1111 FEATURE_VALUE_TYPE(omnibox::kDefaultTypedNavigationsToHttps)},
Benjamin Williams419c81e2022-05-04 18:33:221112 {"smart-sorting-new-overflow-menu",
1113 flag_descriptions::kSmartSortingNewOverflowMenuName,
1114 flag_descriptions::kSmartSortingNewOverflowMenuDescription,
1115 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSmartSortingNewOverflowMenu)},
Scott Yoder10493562022-06-28 17:37:441116 {"new-overflow-menu-share-chrome-action",
1117 flag_descriptions::kNewOverflowMenuShareChromeActionName,
1118 flag_descriptions::kNewOverflowMenuShareChromeActionDescription,
1119 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kNewOverflowMenuShareChromeAction)},
Alexander Tekled46a36982022-05-09 20:32:421120 {"autofill-enable-ranking-formula",
1121 flag_descriptions::kAutofillEnableRankingFormulaName,
1122 flag_descriptions::kAutofillEnableRankingFormulaDescription,
1123 flags_ui::kOsIos,
1124 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableRankingFormula)},
Sergio Collazos58558712022-05-18 17:24:021125 {"enable-feed-ablation", flag_descriptions::kEnableFeedAblationName,
1126 flag_descriptions::kEnableFeedAblationDescription, flags_ui::kOsIos,
1127 FEATURE_VALUE_TYPE(kEnableFeedAblation)},
Chris Lu7f024ed2c2022-05-27 23:11:271128 {"content-suggestions-ui-module-refresh",
1129 flag_descriptions::kContentSuggestionsUIModuleRefreshName,
1130 flag_descriptions::kContentSuggestionsUIModuleRefreshDescription,
Chris Lu8e308dc2022-09-06 16:59:401131 flags_ui::kOsIos,
Chris Lu85e8cc642022-09-23 20:27:581132 FEATURE_WITH_PARAMS_VALUE_TYPE(
1133 kContentSuggestionsUIModuleRefresh,
1134 kModuleRefreshVariations,
1135 kContentSuggestionsUIModuleRefreshFlagOverrideFieldTrialName)},
Quentin Pubertd7546ae2022-05-30 14:28:571136 {"3p-intents-in-incognito", flag_descriptions::kIOS3PIntentsInIncognitoName,
1137 flag_descriptions::kIOS3PIntentsInIncognitoDescription, flags_ui::kOsIos,
1138 FEATURE_VALUE_TYPE(kIOS3PIntentsInIncognito)},
Olivier Robin058c1fad2022-05-31 18:24:061139 {"default-browser-intents-show-settings",
1140 flag_descriptions::kDefaultBrowserIntentsShowSettingsName,
1141 flag_descriptions::kDefaultBrowserIntentsShowSettingsDescription,
1142 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDefaultBrowserIntentsShowSettings)},
Ed Chin76b1b35e2022-06-08 23:01:171143 {"enable-discover-feed-ghost-cards",
1144 flag_descriptions::kEnableDiscoverFeedGhostCardsName,
1145 flag_descriptions::kEnableDiscoverFeedGhostCardsDescription,
1146 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDiscoverFeedGhostCardsEnabled)},
Igor Ruvinova43a66dc2022-06-09 21:57:451147 {"dm-token-deletion", flag_descriptions::kDmTokenDeletionName,
1148 flag_descriptions::kDmTokenDeletionDescription, flags_ui::kOsIos,
Igor Ruvinov44fed9f2022-06-10 22:51:421149 FEATURE_WITH_PARAMS_VALUE_TYPE(policy::features::kDmTokenDeletion,
1150 kDmTokenDeletionVariation,
1151 "DmTokenDeletion")},
Tommy Martinoad42be52022-06-13 11:51:191152 {"ios-password-ui-split", flag_descriptions::kIOSPasswordUISplitName,
1153 flag_descriptions::kIOSPasswordUISplitDescription, flags_ui::kOsIos,
1154 FEATURE_VALUE_TYPE(password_manager::features::kIOSPasswordUISplit)},
Theodor-Stefan Cristea6d087b82022-07-26 15:25:291155 {"ios-password-manager-cross-origin-iframe-support",
1156 flag_descriptions::kIOSPasswordManagerCrossOriginIframeSupportName,
1157 flag_descriptions::kIOSPasswordManagerCrossOriginIframeSupportDescription,
1158 flags_ui::kOsIos,
1159 FEATURE_VALUE_TYPE(password_manager::features::
1160 kIOSPasswordManagerCrossOriginIframeSupport)},
Benjamin Williamsaa8da8142022-11-14 19:51:031161 {"ios-popular-sites-improved-suggestions",
1162 flag_descriptions::kIOSPopularSitesImprovedSuggestionsName,
1163 flag_descriptions::kIOSPopularSitesImprovedSuggestionsDescription,
1164 flags_ui::kOsIos,
1165 FEATURE_WITH_PARAMS_VALUE_TYPE(
1166 ntp_tiles::kIOSPopularSitesImprovedSuggestions,
1167 kIOSPopularSitesImprovedSuggestionsVariations,
1168 field_trial_constants::
1169 kIOSPopularSitesImprovedSuggestionsFieldTrialName)},
Christian Xud105a1352022-06-17 19:54:141170 {"omnibox-adaptive-suggestions-count",
1171 flag_descriptions::kAdaptiveSuggestionsCountName,
1172 flag_descriptions::kAdaptiveSuggestionsCountDescription, flags_ui::kOsIos,
1173 FEATURE_VALUE_TYPE(omnibox::kAdaptiveSuggestionsCount)},
Chris Lu2fd473f2022-06-28 13:38:201174 {"trending-queries-module", flag_descriptions::kTrendingQueriesModuleName,
1175 flag_descriptions::kTrendingQueriesModuleDescription, flags_ui::kOsIos,
Chris Lu85e8cc642022-09-23 20:27:581176 FEATURE_WITH_PARAMS_VALUE_TYPE(
1177 kTrendingQueriesModule,
1178 kTrendingQueriesModuleVariations,
1179 kTrendingQueriesFlagOverrideFieldTrialName)},
Nakul Vaidyaddfdfbc2022-06-28 23:43:321180 {"autofill-parse-iban-fields",
Nakul Vaidya876210f2022-08-08 17:47:191181 flag_descriptions::kAutofillParseIBANFieldsName,
1182 flag_descriptions::kAutofillParseIBANFieldsDescription, flags_ui::kOsIos,
1183 FEATURE_VALUE_TYPE(autofill::features::kAutofillParseIBANFields)},
Ernesto Izquierdo Clua7f4e36e22022-07-01 09:38:361184 {"autofill-enable-new-card-unmask-prompt-view",
1185 flag_descriptions::kAutofillEnableNewCardUnmaskPromptViewName,
1186 flag_descriptions::kAutofillEnableNewCardUnmaskPromptViewDescription,
1187 flags_ui::kOsIos,
ginnnnnnny591a4972022-09-01 16:10:271188 FEATURE_VALUE_TYPE(
1189 autofill::features::kAutofillEnableNewCardUnmaskPromptView)},
Christian Xubdedabec2022-07-04 10:00:131190 {"omnibox-paste-button", flag_descriptions::kOmniboxPasteButtonName,
1191 flag_descriptions::kOmniboxPasteButtonDescription, flags_ui::kOsIos,
1192 FEATURE_WITH_PARAMS_VALUE_TYPE(kOmniboxPasteButton,
1193 kOmniboxPasteButtonVariations,
1194 "OmniboxPasteButton")},
Moe Ahmadi098519d82022-07-27 18:34:241195 {"omnibox-zero-suggest-prefetching",
1196 flag_descriptions::kOmniboxZeroSuggestPrefetchingName,
1197 flag_descriptions::kOmniboxZeroSuggestPrefetchingDescription,
1198 flags_ui::kOsIos, FEATURE_VALUE_TYPE(omnibox::kZeroSuggestPrefetching)},
Khalid Peer79df5652022-10-26 21:59:451199 {"omnibox-zero-suggest-prefetching-on-srp",
1200 flag_descriptions::kOmniboxZeroSuggestPrefetchingOnSRPName,
1201 flag_descriptions::kOmniboxZeroSuggestPrefetchingOnSRPDescription,
1202 flags_ui::kOsIos,
1203 FEATURE_VALUE_TYPE(omnibox::kZeroSuggestPrefetchingOnSRP)},
1204 {"omnibox-zero-suggest-prefetching-on-web",
1205 flag_descriptions::kOmniboxZeroSuggestPrefetchingOnWebName,
1206 flag_descriptions::kOmniboxZeroSuggestPrefetchingOnWebDescription,
1207 flags_ui::kOsIos,
1208 FEATURE_VALUE_TYPE(omnibox::kZeroSuggestPrefetchingOnWeb)},
Khalid Peer11b4b2c2022-10-12 20:53:471209 {"omnibox-zero-suggest-in-memory-caching",
1210 flag_descriptions::kOmniboxZeroSuggestInMemoryCachingName,
1211 flag_descriptions::kOmniboxZeroSuggestInMemoryCachingDescription,
1212 flags_ui::kOsIos,
1213 FEATURE_VALUE_TYPE(omnibox::kZeroSuggestInMemoryCaching)},
Ce Chenbdfaed22022-10-20 16:08:351214 {"omnibox-on-device-tail-suggestions",
1215 flag_descriptions::kOmniboxOnDeviceTailSuggestionsName,
1216 flag_descriptions::kOmniboxOnDeviceTailSuggestionsDescription,
1217 flags_ui::kOsIos, FEATURE_VALUE_TYPE(omnibox::kOnDeviceTailModel)},
Vincent Boissellead6cbe22022-07-04 19:32:391218 {"enable-user-policy", flag_descriptions::kEnableUserPolicyName,
1219 flag_descriptions::kEnableUserPolicyDescription, flags_ui::kOsIos,
Vincent Boisselle88fef222022-09-23 18:54:501220 FEATURE_VALUE_TYPE(policy::kUserPolicy)},
Marc Treibb9d8ed802022-07-05 15:15:491221 {"enable-sync-history-datatype",
1222 flag_descriptions::kSyncEnableHistoryDataTypeName,
1223 flag_descriptions::kSyncEnableHistoryDataTypeDescription, flags_ui::kOsIos,
1224 FEATURE_VALUE_TYPE(syncer::kSyncEnableHistoryDataType)},
Christian Xucf26d562022-07-06 09:28:361225 {"omnibox-max-url-matches", flag_descriptions::kOmniboxMaxURLMatchesName,
1226 flag_descriptions::kOmniboxMaxURLMatchesDescription, flags_ui::kOsIos,
1227 FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kOmniboxMaxURLMatches,
1228 kOmniboxMaxURLMatchesVariations,
1229 "OmniboxMaxURLMatches")},
Olivier Robin60d3a062022-07-06 17:34:061230 {"metrickit-non-crash-reports",
1231 flag_descriptions::kMetrickitNonCrashReportName,
1232 flag_descriptions::kMetrickitNonCrashReportDescription, flags_ui::kOsIos,
1233 FEATURE_VALUE_TYPE(kMetrickitNonCrashReport)},
Siyu An3194bda2022-07-13 19:30:371234 {"autofill-enable-remade-downstream-metrics",
1235 flag_descriptions::kAutofillEnableRemadeDownstreamMetricsName,
1236 flag_descriptions::kAutofillEnableRemadeDownstreamMetricsDescription,
1237 flags_ui::kOsIos,
1238 FEATURE_VALUE_TYPE(
1239 autofill::features::kAutofillEnableRemadeDownstreamMetrics)},
Nakul Vaidya13ca2042022-07-27 01:59:551240 {"autofill-parse-vcn-card-on-file-standalone-cvc-fields",
1241 flag_descriptions::kAutofillParseVcnCardOnFileStandaloneCvcFieldsName,
1242 flag_descriptions::
1243 kAutofillParseVcnCardOnFileStandaloneCvcFieldsDescription,
1244 flags_ui::kOsIos,
1245 FEATURE_VALUE_TYPE(
1246 autofill::features::kAutofillParseVcnCardOnFileStandaloneCvcFields)},
Ed Chin91e44992022-07-27 13:42:341247#if BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
1248 {"feed-background-refresh-ios",
1249 flag_descriptions::kFeedBackgroundRefreshName,
1250 flag_descriptions::kFeedBackgroundRefreshDescription, flags_ui::kOsIos,
1251 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFeedBackgroundRefresh,
1252 kFeedBackgroundRefreshVariations,
1253 "FeedBackgroundRefresh")},
Christian Xu164a2e512022-08-01 20:38:191254 {"omnibox-keyboard-paste-button",
1255 flag_descriptions::kOmniboxKeyboardPasteButtonName,
1256 flag_descriptions::kOmniboxKeyboardPasteButtonDescription,
1257 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kOmniboxKeyboardPasteButton)},
Ed Chin91e44992022-07-27 13:42:341258#endif // BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
Arthur Milchiorcf4877e2022-07-29 14:23:411259 {"enable-cbd-sign-out", flag_descriptions::kEnableCBDSignOutName,
1260 flag_descriptions::kEnableCBDSignOutDescription, flags_ui::kOsIos,
Arthur Milchiord36e2502022-08-11 16:10:111261 FEATURE_VALUE_TYPE(switches::kEnableCbdSignOut)},
Aliona DANGLAa5257ccc2022-08-29 14:01:491262 {"enable-open-in-download", flag_descriptions::kEnableOpenInDownloadName,
1263 flag_descriptions::kEnableOpenInDownloadDescription, flags_ui::kOsIos,
1264 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableOpenInDownload,
1265 kOpenInDownloadVariations,
1266 "EnableOpenInDownload")},
Cheick Cisse87a51cb2022-09-08 21:29:171267 {"whats-new-ios", flag_descriptions::kWhatsNewIOSName,
1268 flag_descriptions::kWhatsNewIOSDescription, flags_ui::kOsIos,
Cheick Cissef37087902022-10-07 19:01:411269 FEATURE_WITH_PARAMS_VALUE_TYPE(kWhatsNewIOS,
1270 kWhatsNewLayoutVariations,
1271 "WhatsNewLayoutVariations")},
ginnnnnnny591a4972022-09-01 16:10:271272 {"ios-autofill-branding", flag_descriptions::kAutofillBrandingIOSName,
1273 flag_descriptions::kAutofillBrandingIOSDescription, flags_ui::kOsIos,
1274 FEATURE_WITH_PARAMS_VALUE_TYPE(autofill::features::kAutofillBrandingIOS,
1275 kAutofillBrandingIOSVariations,
Hira Mahmoodb0e5f412022-09-01 19:41:051276 "AutofillBrandingIOS")},
1277 {"app-store-rating", flag_descriptions::kAppStoreRatingName,
1278 flag_descriptions::kAppStoreRatingDescription, flags_ui::kOsIos,
1279 FEATURE_VALUE_TYPE(kAppStoreRating)},
Scott Yodercb2fe632022-09-12 15:28:351280 {"ios-new-post-restore-experience",
1281 flag_descriptions::kIOSNewPostRestoreExperienceName,
1282 flag_descriptions::kIOSNewPostRestoreExperienceDescription,
1283 flags_ui::kOsIos,
Benjamin Williams3d3a2ec2022-09-13 20:01:261284 FEATURE_WITH_PARAMS_VALUE_TYPE(
1285 post_restore_signin::features::kIOSNewPostRestoreExperience,
1286 kIOSNewPostRestoreExperienceVariations,
1287 "IOSNewPostRestoreExperience")},
Christian Xu6b90c2a32022-09-13 18:17:021288 {"most-visited-tiles", flag_descriptions::kMostVisitedTilesName,
1289 flag_descriptions::kMostVisitedTilesDescription, flags_ui::kOsIos,
1290 FEATURE_VALUE_TYPE(omnibox::kMostVisitedTiles)},
Olivier ROBINf05518782022-09-14 23:55:501291 {"enable-tflite-language-detection-ignore",
1292 flag_descriptions::kTFLiteLanguageDetectionIgnoreName,
1293 flag_descriptions::kTFLiteLanguageDetectionIgnoreDescription,
1294 flags_ui::kOsIos,
1295 FEATURE_VALUE_TYPE(translate::kTFLiteLanguageDetectionIgnoreEnabled)},
Louis Romeroc18612b962022-10-07 12:08:141296 {"keyboard-shortcuts-menu", flag_descriptions::kKeyboardShortcutsMenuName,
1297 flag_descriptions::kKeyboardShortcutsMenuDescription, flags_ui::kOsIos,
1298 FEATURE_VALUE_TYPE(kKeyboardShortcutsMenu)},
Tina Wang89ae4252022-10-14 00:39:471299 {"enable-check-visibility-on-attention-log-start",
1300 flag_descriptions::kEnableCheckVisibilityOnAttentionLogStartName,
1301 flag_descriptions::kEnableCheckVisibilityOnAttentionLogStartDescription,
1302 flags_ui::kOsIos,
1303 FEATURE_VALUE_TYPE(kEnableCheckVisibilityOnAttentionLogStart)},
1304 {"enable-refine-data-source-reload-reporting",
1305 flag_descriptions::kEnableRefineDataSourceReloadReportingName,
1306 flag_descriptions::kEnableRefineDataSourceReloadReportingDescription,
1307 flags_ui::kOsIos,
1308 FEATURE_VALUE_TYPE(kEnableRefineDataSourceReloadReporting)},
Noémie St-Ongeac7a84b2022-10-14 22:32:521309 {"enable-compromised-passwords-muting",
1310 flag_descriptions::kEnableCompromisedPasswordsMutingName,
1311 flag_descriptions::kEnableCompromisedPasswordsMutingDescription,
1312 flags_ui::kOsIos,
1313 FEATURE_VALUE_TYPE(password_manager::features::kMuteCompromisedPasswords)},
Victor Hugo Vianna Silvabb878dea2022-10-18 10:19:041314 {"enable-passwords-account-storage",
1315 flag_descriptions::kEnablePasswordsAccountStorageName,
1316 flag_descriptions::kEnablePasswordsAccountStorageDescription,
1317 flags_ui::kOsIos,
1318 FEATURE_VALUE_TYPE(
1319 password_manager::features::kEnablePasswordsAccountStorage)},
adamta3811f9182022-10-24 17:49:331320 {"enable-default-following-feed-sort-type",
1321 flag_descriptions::kFollowingFeedDefaultSortTypeName,
1322 flag_descriptions::kFollowingFeedDefaultSortTypeDescription,
1323 flags_ui::kOsIos,
1324 FEATURE_WITH_PARAMS_VALUE_TYPE(kFollowingFeedDefaultSortType,
1325 kFollowingFeedDefaultSortTypeVariations,
1326 "FollowingFeedDefaultSortType")},
Christian Xu4eb28d42022-10-28 17:54:481327 {"omnibox-carousel-dynamic-spacing",
1328 flag_descriptions::kOmniboxCarouselDynamicSpacingName,
1329 flag_descriptions::kOmniboxCarouselDynamicSpacingDescription,
1330 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kOmniboxCarouselDynamicSpacing)},
Gauthier Ambardd0187592022-11-03 16:31:131331 {"use-sf-symbols-omnibox", flag_descriptions::kUseSFSymbolsInOmniboxName,
1332 flag_descriptions::kUseSFSymbolsInOmniboxDescription, flags_ui::kOsIos,
1333 FEATURE_VALUE_TYPE(kUseSFSymbolsInOmnibox)},
Gauthier Ambard9898eb882022-11-07 18:12:011334 {"tab-grid-recency-sort", flag_descriptions::kTabGridRecencySortName,
1335 flag_descriptions::kTabGridRecencySortDescription, flags_ui::kOsIos,
1336 FEATURE_VALUE_TYPE(kTabGridRecencySort)},
Hira Mahmoodb0e5f412022-09-01 19:41:051337};
sdefresne14900ee2015-11-27 14:43:211338
Rohit Raobed794c2020-04-27 15:27:451339bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
1340 return false;
1341}
1342
1343flags_ui::FlagsState& GetGlobalFlagsState() {
1344 static base::NoDestructor<flags_ui::FlagsState> flags_state(kFeatureEntries,
1345 nullptr);
1346 return *flags_state;
1347}
David Jean5ca263c2021-08-18 09:19:301348// Creates the experimental test policies map, used by AsyncPolicyLoader and
1349// PolicyLoaderIOS to locally enable policies.
Vincent Boisselleed0e6f1a2021-11-09 06:47:341350NSMutableDictionary* CreateExperimentalTestingPolicies() {
sdefresne14900ee2015-11-27 14:43:211351 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1352
Guillaume Jenkins25e9bd72020-08-27 17:39:061353 // Shared variables for all enterprise experimental flags.
Guillaume Jenkins57606d72020-08-13 17:32:551354 NSMutableDictionary* testing_policies = [[NSMutableDictionary alloc] init];
Guillaume Jenkins25e9bd72020-08-27 17:39:061355 NSMutableArray* allowed_experimental_policies = [[NSMutableArray alloc] init];
Guillaume Jenkins57606d72020-08-13 17:32:551356
Guillaume Jenkins25e9bd72020-08-27 17:39:061357 // Set some sample policy values for testing if EnableSamplePolicies is set to
1358 // true.
Guillaume Jenkinseeb7007c2020-06-25 22:55:401359 if ([defaults boolForKey:@"EnableSamplePolicies"]) {
Guillaume Jenkins57606d72020-08-13 17:32:551360 [testing_policies addEntriesFromDictionary:@{
Tina Wang59d0b7e2020-08-11 04:41:011361 base::SysUTF8ToNSString(policy::key::kAutofillAddressEnabled) : @NO,
1362
Guillaume Jenkinseeb7007c2020-06-25 22:55:401363 base::SysUTF8ToNSString(policy::key::kAutofillCreditCardEnabled) : @NO,
1364
1365 // 2 = Disable all variations
1366 base::SysUTF8ToNSString(policy::key::kChromeVariations) : @2,
1367
1368 // 2 = Do not allow any site to show popups
1369 base::SysUTF8ToNSString(policy::key::kDefaultPopupsSetting) : @2,
1370
Tina Wang5abee802020-07-29 23:09:521371 // Set default search engine.
1372 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderEnabled) :
1373 @YES,
1374 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderSearchURL) :
1375 @"http://www.google.com/search?q={searchTerms}",
1376 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderName) :
Tina Wang7cd0a062020-09-15 21:31:021377 @"TestEngine",
Tina Wang5abee802020-07-29 23:09:521378
Tina Wang89068c82020-10-29 15:51:501379 base::SysUTF8ToNSString(policy::key::kEditBookmarksEnabled) : @NO,
1380
Gauthier Ambard21b23702021-04-16 16:11:271381 base::SysUTF8ToNSString(policy::key::kNTPContentSuggestionsEnabled) : @NO,
1382
Guillaume Jenkinseeb7007c2020-06-25 22:55:401383 base::SysUTF8ToNSString(policy::key::kPasswordManagerEnabled) : @NO,
Tina Wang59d0b7e2020-08-11 04:41:011384
1385 base::SysUTF8ToNSString(policy::key::kTranslateEnabled) : @NO,
Tina Wang54dddfc22020-08-20 22:34:531386
1387 // 2 = Enhanced safe browsing protection
1388 base::SysUTF8ToNSString(policy::key::kSafeBrowsingProtectionLevel) : @2,
1389
1390 base::SysUTF8ToNSString(policy::key::kSearchSuggestEnabled) : @YES,
Guillaume Jenkins57606d72020-08-13 17:32:551391 }];
1392 }
1393
Ewann227a3c02021-04-19 12:04:541394 if ([defaults boolForKey:@"EnableSyncDisabledPolicy"]) {
Guillaume Jenkinsfe46d3a2021-04-26 19:51:041395 NSString* sync_policy_key =
1396 base::SysUTF8ToNSString(policy::key::kSyncDisabled);
David Jean5ca263c2021-08-18 09:19:301397 [testing_policies addEntriesFromDictionary:@{sync_policy_key : @YES}];
Ewann227a3c02021-04-19 12:04:541398 }
Ewann227a3c02021-04-19 12:04:541399
Ewann570a6302021-08-17 07:22:421400 // SyncTypesListDisabled policy.
1401 NSString* Sync_types_list_disabled_key =
1402 base::SysUTF8ToNSString(policy::key::kSyncTypesListDisabled);
1403 NSMutableArray* Sync_types_list_disabled_values =
1404 [[NSMutableArray alloc] init];
1405 if ([defaults boolForKey:@"SyncTypesListBookmarks"]) {
1406 [Sync_types_list_disabled_values addObject:@"bookmarks"];
1407 }
1408 if ([defaults boolForKey:@"SyncTypesListReadingList"]) {
1409 [Sync_types_list_disabled_values addObject:@"readingList"];
1410 }
1411 if ([defaults boolForKey:@"SyncTypesListPreferences"]) {
1412 [Sync_types_list_disabled_values addObject:@"preferences"];
1413 }
1414 if ([defaults boolForKey:@"SyncTypesListPasswords"]) {
1415 [Sync_types_list_disabled_values addObject:@"passwords"];
1416 }
1417 if ([defaults boolForKey:@"SyncTypesListAutofill"]) {
1418 [Sync_types_list_disabled_values addObject:@"autofill"];
1419 }
1420 if ([defaults boolForKey:@"SyncTypesListTypedUrls"]) {
1421 [Sync_types_list_disabled_values addObject:@"typedUrls"];
1422 }
1423 if ([defaults boolForKey:@"SyncTypesListTabs"]) {
1424 [Sync_types_list_disabled_values addObject:@"tabs"];
1425 }
1426 if ([Sync_types_list_disabled_values count]) {
1427 [testing_policies addEntriesFromDictionary:@{
1428 Sync_types_list_disabled_key : Sync_types_list_disabled_values
1429 }];
Ewann570a6302021-08-17 07:22:421430 }
1431
Gauthier Ambard073eaa92021-11-22 15:24:131432 // If an incognito mode availability is set, set the value.
Tina Wangc6bcf572021-01-27 18:15:521433 NSString* incognito_policy_key =
1434 base::SysUTF8ToNSString(policy::key::kIncognitoModeAvailability);
1435 NSInteger incognito_mode_availability =
1436 [defaults integerForKey:incognito_policy_key];
1437 if (incognito_mode_availability) {
Tina Wangc6bcf572021-01-27 18:15:521438 [testing_policies addEntriesFromDictionary:@{
1439 incognito_policy_key : @(incognito_mode_availability),
1440 }];
1441 }
1442
Ewann40a8f8a2021-07-29 10:01:201443 NSString* restriction_pattern =
1444 [defaults stringForKey:@"RestrictAccountsToPatterns"];
1445 if ([restriction_pattern length] > 0) {
Ewannb3bee382021-08-16 09:12:291446 NSString* restrict_key =
1447 base::SysUTF8ToNSString(policy::key::kRestrictAccountsToPatterns);
Ewann40a8f8a2021-07-29 10:01:201448 [testing_policies addEntriesFromDictionary:@{
Ewannb3bee382021-08-16 09:12:291449 restrict_key : @[ restriction_pattern ]
Ewann40a8f8a2021-07-29 10:01:201450 }];
1451 }
1452
Vincent Boisselle19200bc2021-09-01 17:58:251453 // If the sign-in policy is set (not "None"), add the policy key to the list
1454 // of enabled experimental policies, and set the value.
1455 NSString* const kSigninPolicyKey = @"BrowserSignin";
1456 NSInteger signin_policy_mode = [defaults integerForKey:kSigninPolicyKey];
1457 if (signin_policy_mode) {
1458 // Remove the mode offset that was used to represent the unset policy.
1459 --signin_policy_mode;
1460 DCHECK(signin_policy_mode >= 0);
1461
Vincent Boisselle19200bc2021-09-01 17:58:251462 [testing_policies addEntriesFromDictionary:@{
1463 kSigninPolicyKey : @(signin_policy_mode),
1464 }];
1465 }
1466
Veronique Nguyen9b1044f2022-01-11 14:41:131467 // If the New Tab Page URL is set (not empty) add the value to the list of
1468 // test policies.
1469 NSString* ntp_location = [defaults stringForKey:@"NTPLocation"];
1470 if ([ntp_location length] > 0) {
1471 NSString* ntp_location_key =
1472 base::SysUTF8ToNSString(policy::key::kNewTabPageLocation);
1473 [testing_policies
1474 addEntriesFromDictionary:@{ntp_location_key : ntp_location}];
Veronique Nguyen302d8702022-01-12 21:18:571475 [allowed_experimental_policies addObject:ntp_location_key];
Veronique Nguyen9b1044f2022-01-11 14:41:131476 }
1477
Ali Juma9ec36d2b2022-03-28 14:53:121478 if ([defaults boolForKey:@"DisallowChromeDataInBackups"]) {
1479 NSString* allow_backups_key =
1480 base::SysUTF8ToNSString(policy::key::kAllowChromeDataInBackups);
1481 [testing_policies addEntriesFromDictionary:@{allow_backups_key : @NO}];
1482 [allowed_experimental_policies addObject:allow_backups_key];
1483 }
1484
Guillaume Jenkins25e9bd72020-08-27 17:39:061485 // If any experimental policy was allowed, set the EnableExperimentalPolicies
1486 // policy.
1487 if ([allowed_experimental_policies count] > 0) {
1488 [testing_policies setValue:allowed_experimental_policies
1489 forKey:base::SysUTF8ToNSString(
1490 policy::key::kEnableExperimentalPolicies)];
1491 }
1492
jlebel2eb40222022-05-06 11:15:421493 NSString* metrics_reporting_key = @"MetricsReportingEnabled";
1494 switch ([defaults integerForKey:metrics_reporting_key]) {
1495 case 1:
1496 // Metrics reporting forced.
1497 [testing_policies setValue:@(YES) forKey:metrics_reporting_key];
1498 break;
1499 case 2:
1500 // Metrics reporting disabled.
1501 [testing_policies setValue:@(NO) forKey:metrics_reporting_key];
1502 break;
1503 default:
1504 // Metrics reporting not managed.
1505 break;
1506 }
1507
David Jean6f85d44f2021-08-19 08:08:451508 // Warning: Add new flags to TestingPoliciesHash() below.
1509
David Jean5ca263c2021-08-18 09:19:301510 return testing_policies;
1511}
David Jean6f85d44f2021-08-19 08:08:451512
1513// Generates a unique NSString based on currently monitored policies from
1514// NSUserDefaults standardUserDefaults.
1515NSString* TestingPoliciesHash() {
1516 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1517 return [NSString
jlebel2eb40222022-05-06 11:15:421518 stringWithFormat:@"%d|%d|%d|%d|%@|%d|%d|%d|%d|%d|%d|%d|%d|%@|%d",
Ali Juma9ec36d2b2022-03-28 14:53:121519 [defaults boolForKey:@"DisallowChromeDataInBackups"],
David Jean6f85d44f2021-08-19 08:08:451520 [defaults boolForKey:@"EnableSyncDisabledPolicy"],
1521 [defaults boolForKey:@"EnableSamplePolicies"],
jlebel2eb40222022-05-06 11:15:421522 static_cast<int>([defaults
1523 integerForKey:@"IncognitoModeAvailability"]),
David Jean6f85d44f2021-08-19 08:08:451524 [defaults stringForKey:@"RestrictAccountsToPatterns"],
1525 [defaults boolForKey:@"SyncTypesListBookmarks"],
1526 [defaults boolForKey:@"SyncTypesListReadingList"],
1527 [defaults boolForKey:@"SyncTypesListPreferences"],
1528 [defaults boolForKey:@"SyncTypesListPasswords"],
1529 [defaults boolForKey:@"SyncTypesListAutofill"],
1530 [defaults boolForKey:@"SyncTypesListTypedUrls"],
jlebel2eb40222022-05-06 11:15:421531 [defaults boolForKey:@"SyncTypesListTabs"],
1532 static_cast<int>(
1533 [defaults integerForKey:@"BrowserSignin"]),
1534 [defaults stringForKey:@"NTPLocation"],
1535 static_cast<int>([defaults
1536 integerForKey:@"MetricsReportingEnabled"])];
David Jean6f85d44f2021-08-19 08:08:451537}
David Jean5ca263c2021-08-18 09:19:301538} // namespace
1539
Gauthier Ambard02dbf022022-08-23 08:28:471540// Add all switches from experimental flags to `command_line`.
David Jean5ca263c2021-08-18 09:19:301541void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) {
1542 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1543
1544 // Set the UA flag if UseMobileSafariUA is enabled.
1545 if ([defaults boolForKey:@"UseMobileSafariUA"]) {
1546 // Safari uses "Vesion/", followed by the OS version excluding bugfix, where
1547 // Chrome puts its product token.
1548 int32_t major = 0;
1549 int32_t minor = 0;
1550 int32_t bugfix = 0;
1551 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix);
1552 std::string product = base::StringPrintf("Version/%d.%d", major, minor);
1553
1554 command_line->AppendSwitchASCII(switches::kUserAgent,
1555 web::BuildMobileUserAgent(product));
1556 }
1557
1558 // Shared variables for all enterprise experimental flags.
Vincent Boisselleed0e6f1a2021-11-09 06:47:341559 NSMutableDictionary* testing_policies = CreateExperimentalTestingPolicies();
David Jean5ca263c2021-08-18 09:19:301560
1561 // If a CBCM enrollment token is provided, force Chrome Browser Cloud
1562 // Management to enabled and add the token to the list of policies.
1563 NSString* token_key =
1564 base::SysUTF8ToNSString(policy::key::kCloudManagementEnrollmentToken);
1565 NSString* token = [defaults stringForKey:token_key];
1566
1567 if ([token length] > 0) {
1568 command_line->AppendSwitch(switches::kEnableChromeBrowserCloudManagement);
1569 [testing_policies setValue:token forKey:token_key];
1570 }
1571
Guillaume Jenkins57606d72020-08-13 17:32:551572 // If some policies were set, commit them to the app's registration defaults.
1573 if ([testing_policies count] > 0) {
Guillaume Jenkinseeb7007c2020-06-25 22:55:401574 NSDictionary* registration_defaults =
1575 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
1576 [defaults registerDefaults:registration_defaults];
1577 }
1578
sdefresne14900ee2015-11-27 14:43:211579 // Freeform commandline flags. These are added last, so that any flags added
1580 // earlier in this function take precedence.
1581 if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) {
1582 base::CommandLine::StringVector flags;
1583 // Append an empty "program" argument.
1584 flags.push_back("");
1585
1586 // The number of flags corresponds to the number of text fields in
1587 // Experimental.plist.
1588 const int kNumFreeformFlags = 5;
1589 for (int i = 1; i <= kNumFreeformFlags; ++i) {
1590 NSString* key =
1591 [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i];
1592 NSString* flag = [defaults stringForKey:key];
1593 if ([flag length]) {
Robbie Gibsonc91ce622019-05-20 14:44:331594 // iOS keyboard replaces -- with —, so undo that.
1595 flag = [flag stringByReplacingOccurrencesOfString:@"—"
1596 withString:@"--"
1597 options:0
1598 range:NSMakeRange(0, 1)];
1599 // To make things easier, allow flags with no dashes by prepending them
1600 // here. This also allows for flags that just have one dash if they
1601 // exist.
1602 if (![flag hasPrefix:@"-"]) {
1603 flag = [@"--" stringByAppendingString:flag];
1604 }
sdefresne14900ee2015-11-27 14:43:211605 flags.push_back(base::SysNSStringToUTF8(flag));
1606 }
1607 }
1608
1609 base::CommandLine temp_command_line(flags);
1610 command_line->AppendArguments(temp_command_line, false);
1611 }
msardafc76f662017-02-24 12:46:281612
justincohendacc85d2017-06-28 23:34:101613 // Populate command line flag for 3rd party keyboard omnibox workaround.
1614 NSString* enableThirdPartyKeyboardWorkaround =
1615 [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"];
1616 if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) {
1617 command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround);
1618 } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) {
1619 command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround);
1620 }
1621
Sylvain Defresned3cd8d92022-01-18 13:35:081622 ios::provider::AppendSwitchesFromExperimentalSettings(defaults, command_line);
sdefresne14900ee2015-11-27 14:43:211623}
1624
David Jean5ca263c2021-08-18 09:19:301625void MonitorExperimentalSettingsChanges() {
David Jean5ca263c2021-08-18 09:19:301626 // Startup values for settings to be observed.
David Jean6f85d44f2021-08-19 08:08:451627 __block NSString* hash = TestingPoliciesHash();
David Jeane83ed652021-08-25 14:52:481628 static std::atomic_bool pending_check(false);
David Jean5ca263c2021-08-18 09:19:301629
1630 auto monitor = ^(NSNotification* notification) {
David Jeane83ed652021-08-25 14:52:481631 bool has_pending_check = pending_check.exchange(true);
1632 if (has_pending_check)
1633 return;
1634
David Jeanbc0fae32021-08-25 10:31:391635 // Can be called from any thread from where the notification was sent,
1636 // but since it may change standardUserDefaults, and that has to be on main
1637 // thread, dispatch to main thread.
1638 dispatch_async(dispatch_get_main_queue(), ^{
1639 // Check if observed settings have changed. Since source and destination
1640 // are both user defaults, this is required to avoid cycling back here.
1641 NSString* newHash = TestingPoliciesHash();
1642 if (![newHash isEqualToString:hash]) {
1643 hash = newHash;
David Jean5ca263c2021-08-18 09:19:301644
David Jeanbc0fae32021-08-25 10:31:391645 // Publish update.
1646 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1647 NSMutableDictionary* testing_policies =
Vincent Boisselleed0e6f1a2021-11-09 06:47:341648 CreateExperimentalTestingPolicies();
David Jeanbc0fae32021-08-25 10:31:391649 NSDictionary* registration_defaults =
1650 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
1651 [defaults registerDefaults:registration_defaults];
1652 }
David Jeane83ed652021-08-25 14:52:481653
1654 pending_check.store(false);
David Jeanbc0fae32021-08-25 10:31:391655 });
David Jean5ca263c2021-08-18 09:19:301656 };
1657
1658 NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
1659 [center addObserverForName:NSUserDefaultsDidChangeNotification
1660 object:nil
David Jeanbc0fae32021-08-25 10:31:391661 queue:nil
David Jean5ca263c2021-08-18 09:19:301662 usingBlock:monitor];
1663}
1664
sdefresne14900ee2015-11-27 14:43:211665void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage,
1666 base::CommandLine* command_line) {
Sylvain Defresne8327a2f2019-01-17 14:19:181667 GetGlobalFlagsState().ConvertFlagsToSwitches(
sdefresnec9763902015-12-02 10:30:111668 flags_storage, command_line, flags_ui::kAddSentinels,
Gregory Chatzinofff6523722017-11-21 01:33:531669 switches::kEnableFeatures, switches::kDisableFeatures);
sdefresne14900ee2015-11-27 14:43:211670}
1671
jkrcalbf073372016-07-29 07:21:311672std::vector<std::string> RegisterAllFeatureVariationParameters(
1673 flags_ui::FlagsStorage* flags_storage,
1674 base::FeatureList* feature_list) {
Sylvain Defresne8327a2f2019-01-17 14:19:181675 return GetGlobalFlagsState().RegisterAllFeatureVariationParameters(
1676 flags_storage, feature_list);
jkrcalbf073372016-07-29 07:21:311677}
1678
sdefresne14900ee2015-11-27 14:43:211679void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage,
1680 flags_ui::FlagAccess access,
Matt Menke4d777572022-06-15 15:55:501681 base::Value::List& supported_entries,
1682 base::Value::List& unsupported_entries) {
Sylvain Defresne8327a2f2019-01-17 14:19:181683 GetGlobalFlagsState().GetFlagFeatureEntries(
sdefresne14900ee2015-11-27 14:43:211684 flags_storage, access, supported_entries, unsupported_entries,
Renjie Tang208c8192020-11-03 00:46:511685 base::BindRepeating(&SkipConditionalFeatureEntry));
sdefresne14900ee2015-11-27 14:43:211686}
1687
1688void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage,
1689 const std::string& internal_name,
1690 bool enable) {
Sylvain Defresne8327a2f2019-01-17 14:19:181691 GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name,
1692 enable);
sdefresne14900ee2015-11-27 14:43:211693}
1694
1695void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) {
Sylvain Defresne8327a2f2019-01-17 14:19:181696 GetGlobalFlagsState().ResetAllFlags(flags_storage);
sdefresne14900ee2015-11-27 14:43:211697}
1698
1699namespace testing {
1700
Elly Fong-Jones323ab1092021-08-23 22:36:311701base::span<const flags_ui::FeatureEntry> GetFeatureEntries() {
1702 return base::span<const flags_ui::FeatureEntry>(kFeatureEntries,
Daniel Cheng1f047a82022-02-26 10:04:531703 std::size(kFeatureEntries));
sdefresne14900ee2015-11-27 14:43:211704}
1705
1706} // namespace testing