blob: 9cfd85be408d799091ace24fe4a76f97bd20e6c8 [file] [log] [blame]
sdefresne14900ee2015-11-27 14:43:211// Copyright 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Implementation of about_flags for iOS that sets flags based on experimental
6// settings.
7
Nazerke9c259052019-06-26 15:30:108#include "ios/chrome/browser/flags/about_flags.h"
sdefresne14900ee2015-11-27 14:43:219
Nazerke9c259052019-06-26 15:30:1010#import <UIKit/UIKit.h>
avi571943672015-12-22 02:12:4911#include <stddef.h>
12#include <stdint.h>
sdefresne14900ee2015-11-27 14:43:2113
Gregory Chatzinofff6523722017-11-21 01:33:5314#include "base/base_switches.h"
sdefresne14900ee2015-11-27 14:43:2115#include "base/bind.h"
danakjdb9ae7942020-11-11 16:01:3516#include "base/callback_helpers.h"
Hans Wennborg3a2fb61f2020-05-11 15:51:1617#include "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"
Sylvain Defresne8327a2f2019-01-17 14:19:1820#include "base/no_destructor.h"
sdefresne14900ee2015-11-27 14:43:2121#include "base/strings/stringprintf.h"
22#include "base/strings/sys_string_conversions.h"
Sebastien Marchand75a7cdf2018-11-13 23:47:0323#include "base/system/sys_info.h"
Mohamad Ahmadic4df81f2017-12-20 04:41:5924#include "components/autofill/core/common/autofill_features.h"
Jared Sauld998539f2019-03-19 15:11:1725#include "components/autofill/core/common/autofill_payments_features.h"
Moe Ahmadid6d5d172018-06-20 17:20:2326#include "components/autofill/core/common/autofill_switches.h"
Olivier Robin3d60411622018-02-23 10:03:2227#include "components/autofill/ios/browser/autofill_switches.h"
Jesse McKenna85c1a59f2021-05-05 19:08:3028#include "components/breadcrumbs/core/features.h"
Matt Jones125dfb42022-02-11 17:23:4229#include "components/commerce/core/commerce_feature_list.h"
30#include "components/commerce/core/flag_descriptions.h"
Robbie Gibson5e3436632020-04-27 15:48:0431#include "components/content_settings/core/common/features.h"
sdefresne14900ee2015-11-27 14:43:2132#include "components/dom_distiller/core/dom_distiller_switches.h"
Guillaume Jenkins4e6ac1e2020-11-11 16:57:4033#include "components/enterprise/browser/enterprise_switches.h"
Tommy Nyquistc1d6dea12017-07-26 20:37:2334#include "components/feature_engagement/public/feature_constants.h"
35#include "components/feature_engagement/public/feature_list.h"
edchind847c0962021-03-03 18:17:0536#include "components/feed/feed_feature_list.h"
sdefresne14900ee2015-11-27 14:43:2137#include "components/flags_ui/feature_entry.h"
38#include "components/flags_ui/feature_entry_macros.h"
39#include "components/flags_ui/flags_storage.h"
40#include "components/flags_ui/flags_ui_switches.h"
Tanja Gornakb0985dd2018-10-11 17:24:4041#include "components/invalidation/impl/invalidation_switches.h"
noyau4cfb1332016-10-25 17:05:4242#include "components/ntp_tiles/switches.h"
Justin Donnelly33d712e2017-08-23 21:32:5143#include "components/omnibox/browser/omnibox_field_trial.h"
Tomasz Wiszkowskid938a1112019-03-06 18:01:5744#include "components/omnibox/common/omnibox_features.h"
Raj T3898f032021-08-19 23:51:2745#include "components/optimization_guide/core/optimization_guide_features.h"
Ioana Pandeled14ce9e2017-11-28 14:41:4646#include "components/password_manager/core/common/password_manager_features.h"
mathp9b4c11d2017-07-06 20:24:1347#include "components/payments/core/features.h"
Igor Ruvinova43a66dc2022-06-09 21:57:4548#include "components/policy/core/common/features.h"
Guillaume Jenkinseeb7007c2020-06-25 22:55:4049#import "components/policy/core/common/policy_loader_ios_constants.h"
50#include "components/policy/policy_constants.h"
Joemer Ramos34175732022-02-14 18:59:1651#include "components/safe_browsing/core/common/features.h"
Victor Hugo Vianna Silva0399402f2021-09-07 21:41:2552#import "components/send_tab_to_self/features.h"
Tommy Martino0caf3362021-01-13 20:29:5853#include "components/shared_highlighting/core/common/shared_highlighting_features.h"
Valeriya Sinevicha79dc612018-09-25 14:49:0954#include "components/signin/core/browser/account_reconcilor.h"
Jérôme Lebelc374fdd2019-09-27 10:36:4855#include "components/signin/ios/browser/features.h"
Colin Blundell3517170e2019-07-11 08:16:3456#include "components/signin/public/base/signin_switches.h"
sdefresne36579782016-02-05 11:08:2557#include "components/strings/grit/components_strings.h"
Victor Hugo Vianna Silvaa48aa01c2022-02-09 20:38:2358#include "components/sync/base/command_line_switches.h"
59#include "components/sync/base/features.h"
Ewann570a6302021-08-17 07:22:4260#include "components/sync/base/pref_names.h"
Moe Ahmadie4cce1f2018-12-18 23:48:0161#include "components/translate/core/browser/translate_prefs.h"
Olivier Robinffe767c2022-04-21 13:13:2362#include "components/translate/core/common/translate_util.h"
Ed Chin91e44992022-07-27 13:42:3463#import "ios/chrome/app/background_mode_buildflags.h"
Sylvain Defresneae6987e2018-03-01 13:21:4064#include "ios/chrome/browser/browsing_data/browsing_data_features.h"
sdefresne14900ee2015-11-27 14:43:2165#include "ios/chrome/browser/chrome_switches.h"
Eugene But2823dc7e2020-07-21 18:10:3766#include "ios/chrome/browser/crash_report/features.h"
Nazerke21bdc45a2019-07-11 09:02:0567#include "ios/chrome/browser/flags/ios_chrome_flag_descriptions.h"
Ed Chin100660bf2022-04-26 16:59:1368#import "ios/chrome/browser/ntp/features.h"
Vincent Boissellead6cbe22022-07-04 19:32:3969#import "ios/chrome/browser/policy/cloud/user_policy_switch.h"
Vincent Boisselle19200bc2021-09-01 17:58:2570#include "ios/chrome/browser/policy/policy_util.h"
Benjamin Williams14233d72022-07-26 18:32:2071#import "ios/chrome/browser/promos_manager/features.h"
Sylvain Defresne9c107082020-10-27 16:39:1372#include "ios/chrome/browser/screen_time/screen_time_buildflags.h"
Olivier Robin3a957df2021-12-21 18:04:3473#import "ios/chrome/browser/sessions/session_features.h"
Gauthier Ambard33e03302019-02-21 13:28:5874#include "ios/chrome/browser/system_flags.h"
Zhixiang Teoh40027a22022-07-28 03:24:3475#import "ios/chrome/browser/text_selection/text_selection_util.h"
Ernesto Izquierdo Clua7f4e36e22022-07-01 09:38:3676#include "ios/chrome/browser/ui/autofill/features.h"
Louis Romeroac04f786a2022-04-19 09:39:3077#include "ios/chrome/browser/ui/bubble/bubble_features.h"
adamta22a4d502020-05-21 03:12:2178#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h"
Javier Ernesto Flores Robles209b2822021-03-25 19:16:5079#import "ios/chrome/browser/ui/default_promo/default_browser_utils.h"
Ewann1a9d33d2021-06-14 11:12:2480#import "ios/chrome/browser/ui/download/features.h"
Rohit Rao5aa791a2022-08-19 17:34:5381#import "ios/chrome/browser/ui/first_run/field_trial_constants.h"
Chris Lu438e1c052022-08-17 02:57:0082#import "ios/chrome/browser/ui/first_run/trending_queries_field_trial.h"
Kurt Horimoto4da682b022018-04-12 07:43:3583#import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h"
adamta273568472020-12-04 23:53:5784#import "ios/chrome/browser/ui/ntp/new_tab_page_feature.h"
Christian Xub8c06cd2022-04-29 20:55:0185#import "ios/chrome/browser/ui/omnibox/omnibox_ui_features.h"
Robbie Gibson686c56732021-10-04 17:11:4586#import "ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.h"
Gauthier Ambard30ad9ca2022-06-09 14:15:2687#import "ios/chrome/browser/ui/popup_menu/public/features.h"
gogerald0ff29e52021-02-03 18:56:1988#import "ios/chrome/browser/ui/start_surface/start_surface_features.h"
Kurt Horimoto79d590b2018-09-12 19:09:2889#import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h"
Justin Cohen2d81c582018-01-22 14:46:4490#include "ios/chrome/browser/ui/ui_feature_flags.h"
Yi Su392b3032018-06-05 07:26:4791#include "ios/chrome/browser/web/features.h"
sdefresne14900ee2015-11-27 14:43:2192#include "ios/chrome/grit/ios_strings.h"
Mustafa Emre Acer4de8863a2022-05-03 22:17:0193#include "ios/components/security_interstitials/https_only_mode/feature.h"
Sylvain Defresne559ce5f2022-01-13 17:14:5894#include "ios/public/provider/chrome/browser/app_utils/app_utils_api.h"
Eugene But61818bc2019-04-15 21:04:0795#include "ios/web/common/features.h"
Eugene Bute79f2742019-07-26 17:07:2296#include "ios/web/common/user_agent.h"
Eugene Butb1416232019-07-22 17:31:5897#include "ios/web/common/web_view_creation_util.h"
sdefresne14900ee2015-11-27 14:43:2198
Sylvain Defresne9c107082020-10-27 16:39:1399#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
100#include "ios/chrome/browser/screen_time/features.h"
101#endif
102
sdefresne14900ee2015-11-27 14:43:21103#if !defined(OFFICIAL_BUILD)
104#include "components/variations/variations_switches.h"
vitaliii489217aa2017-01-30 14:50:22105#endif
stkhapuginc1be1792016-12-13 14:30:53106
107#if !defined(__has_feature) || !__has_feature(objc_arc)
108#error "This file requires ARC support."
109#endif
sdefresne14900ee2015-11-27 14:43:21110
elawrence816f6790e2017-06-16 18:19:28111using flags_ui::FeatureEntry;
112
sdefresne14900ee2015-11-27 14:43:21113namespace {
Emily Starkbafa9062017-12-27 15:22:46114
Olivier Robin3d60411622018-02-23 10:03:22115const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = {
116 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
117 {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"},
118 {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"},
119 {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"},
120 {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"},
121 {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"},
122 {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"},
123 {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"},
124 {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"},
125};
126
Nohemi Fernandez222d6d42020-09-30 20:35:57127const FeatureEntry::Choice kDelayThresholdMinutesToUpdateGaiaCookieChoices[] = {
128 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
129 {"0", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "0"},
130 {"10", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "10"},
131 {"60", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "60"},
132};
133
Nohemi Fernandezc00842a2021-07-26 11:47:34134const FeatureEntry::Choice
135 kWaitThresholdMillisecondsForCapabilitiesApiChoices[] = {
136 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
137 {"200", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "200"},
138 {"500", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "500"},
139 {"5000", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "5000"},
140};
141
Stepan Khapugincc4e9842019-01-23 13:38:13142const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = {
143 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}};
144const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = {
145 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}};
146const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = {
147 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}};
148const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = {
149 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}};
150const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = {
151 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}};
152const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = {
153 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}};
154const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = {
155 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}};
156
157const FeatureEntry::FeatureVariation
158 kOmniboxUIMaxAutocompleteMatchesVariations[] = {
159 {"3 matches", kOmniboxUIMaxAutocompleteMatches3,
Daniel Cheng1f047a82022-02-26 10:04:53160 std::size(kOmniboxUIMaxAutocompleteMatches3), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13161 {"4 matches", kOmniboxUIMaxAutocompleteMatches4,
Daniel Cheng1f047a82022-02-26 10:04:53162 std::size(kOmniboxUIMaxAutocompleteMatches4), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13163 {"5 matches", kOmniboxUIMaxAutocompleteMatches5,
Daniel Cheng1f047a82022-02-26 10:04:53164 std::size(kOmniboxUIMaxAutocompleteMatches5), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13165 {"6 matches", kOmniboxUIMaxAutocompleteMatches6,
Daniel Cheng1f047a82022-02-26 10:04:53166 std::size(kOmniboxUIMaxAutocompleteMatches6), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13167 {"8 matches", kOmniboxUIMaxAutocompleteMatches8,
Daniel Cheng1f047a82022-02-26 10:04:53168 std::size(kOmniboxUIMaxAutocompleteMatches8), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13169 {"10 matches", kOmniboxUIMaxAutocompleteMatches10,
Daniel Cheng1f047a82022-02-26 10:04:53170 std::size(kOmniboxUIMaxAutocompleteMatches10), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13171 {"12 matches", kOmniboxUIMaxAutocompleteMatches12,
Daniel Cheng1f047a82022-02-26 10:04:53172 std::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}};
Stepan Khapugincc4e9842019-01-23 13:38:13173
Stepan Khapuginbac467e2022-05-06 21:11:54174const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches6[] = {
175 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "6"}};
176const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches15[] = {
177 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "15"}};
178const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches20[] = {
179 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "20"}};
180
181const FeatureEntry::FeatureVariation kOmniboxMaxZPSMatchesVariations[] = {
182 {"6 matches", kOmniboxMaxZPSMatches6, std::size(kOmniboxMaxZPSMatches6),
183 nullptr},
184 {"15 matches", kOmniboxMaxZPSMatches15, std::size(kOmniboxMaxZPSMatches15),
185 nullptr},
186 {"20 matches", kOmniboxMaxZPSMatches20, std::size(kOmniboxMaxZPSMatches20),
187 nullptr},
188};
189
Christian Xucf26d562022-07-06 09:28:36190const FeatureEntry::FeatureParam kOmniboxMaxURLMatches5[] = {
191 {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "5"}};
192const FeatureEntry::FeatureParam kOmniboxMaxURLMatches6[] = {
193 {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "6"}};
194const FeatureEntry::FeatureParam kOmniboxMaxURLMatches7[] = {
195 {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "7"}};
196
197const FeatureEntry::FeatureVariation kOmniboxMaxURLMatchesVariations[] = {
198 {"5 matches", kOmniboxMaxURLMatches5, std::size(kOmniboxMaxURLMatches5),
199 nullptr},
200 {"6 matches", kOmniboxMaxURLMatches6, std::size(kOmniboxMaxURLMatches6),
201 nullptr},
202 {"7 matches", kOmniboxMaxURLMatches7, std::size(kOmniboxMaxURLMatches7),
203 nullptr},
204};
205
Caitlin Fischer37e01232019-05-24 13:05:45206const FeatureEntry::FeatureParam
207 kAutofillUseMobileLabelDisambiguationShowAll[] = {
208 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
209 autofill::features::
210 kAutofillUseMobileLabelDisambiguationParameterShowAll}};
211const FeatureEntry::FeatureParam
212 kAutofillUseMobileLabelDisambiguationShowOne[] = {
213 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
214 autofill::features::
215 kAutofillUseMobileLabelDisambiguationParameterShowOne}};
216
217const FeatureEntry::FeatureVariation
218 kAutofillUseMobileLabelDisambiguationVariations[] = {
219 {"(show all)", kAutofillUseMobileLabelDisambiguationShowAll,
Daniel Cheng1f047a82022-02-26 10:04:53220 std::size(kAutofillUseMobileLabelDisambiguationShowAll), nullptr},
Caitlin Fischer37e01232019-05-24 13:05:45221 {"(show one)", kAutofillUseMobileLabelDisambiguationShowOne,
Daniel Cheng1f047a82022-02-26 10:04:53222 std::size(kAutofillUseMobileLabelDisambiguationShowOne), nullptr}};
Caitlin Fischer37e01232019-05-24 13:05:45223
Javier Ernesto Flores Roblese85f4a12021-02-23 18:10:10224const FeatureEntry::FeatureParam
Javier Ernesto Flores Robles159414232021-06-16 14:29:59225 kDefaultBrowserFullscreenPromoExperimentRemindMeLater[] = {
226 {kDefaultBrowserFullscreenPromoExperimentRemindMeGroupParam, "true"}};
227const FeatureEntry::FeatureVariation
228 kDefaultBrowserFullscreenPromoExperimentVariations[] = {
229 {"Remind me later",
230 kDefaultBrowserFullscreenPromoExperimentRemindMeLater,
Daniel Cheng1f047a82022-02-26 10:04:53231 std::size(kDefaultBrowserFullscreenPromoExperimentRemindMeLater),
Javier Ernesto Flores Robles159414232021-06-16 14:29:59232 nullptr}};
233
gogeralddb0d8ae2020-11-13 03:56:58234const FeatureEntry::FeatureParam kDiscoverFeedInNtpEnableNativeUI[] = {
235 {kDiscoverFeedIsNativeUIEnabled, "true"}};
236const FeatureEntry::FeatureVariation kDiscoverFeedInNtpVariations[] = {
237 {"Native UI", kDiscoverFeedInNtpEnableNativeUI,
Daniel Cheng1f047a82022-02-26 10:04:53238 std::size(kDiscoverFeedInNtpEnableNativeUI), nullptr}};
gogeralddb0d8ae2020-11-13 03:56:58239
Sergio Collazos9fcc6ed2021-10-06 00:58:03240const FeatureEntry::FeatureParam kDiscoverFeedSRSReconstructedTemplates[] = {
241 {kDiscoverFeedSRSReconstructedTemplatesEnabled, "true"}};
242const FeatureEntry::FeatureParam kDiscoverFeedSRSPreloadTemplates[] = {
243 {kDiscoverFeedSRSPreloadTemplatesEnabled, "true"}};
244const FeatureEntry::FeatureVariation
245 kEnableDiscoverFeedStaticResourceServingVariations[] = {
246 {"Reconstruct Templates", kDiscoverFeedSRSReconstructedTemplates,
Daniel Cheng1f047a82022-02-26 10:04:53247 std::size(kDiscoverFeedSRSReconstructedTemplates), nullptr},
Sergio Collazos9fcc6ed2021-10-06 00:58:03248 {"Preload Templates", kDiscoverFeedSRSPreloadTemplates,
Daniel Cheng1f047a82022-02-26 10:04:53249 std::size(kDiscoverFeedSRSPreloadTemplates), nullptr},
Sergio Collazos9fcc6ed2021-10-06 00:58:03250};
251
Mohammad Refaatab6bee62022-05-16 16:31:15252const FeatureEntry::FeatureParam kDiscoverFeedTopSyncPromoFullWithTitle[] = {
adamtadb0bfc62022-08-01 17:37:47253 {kDiscoverFeedTopSyncPromoStyleFullWithTitle, "true"},
254 {kDiscoverFeedTopSyncPromoStyleCompact, "false"}};
Mohammad Refaatab6bee62022-05-16 16:31:15255const FeatureEntry::FeatureParam kDiscoverFeedTopSyncPromoCompact[] = {
adamtadb0bfc62022-08-01 17:37:47256 {kDiscoverFeedTopSyncPromoStyleFullWithTitle, "false"},
257 {kDiscoverFeedTopSyncPromoStyleCompact, "true"}};
258
Mohammad Refaatab6bee62022-05-16 16:31:15259const FeatureEntry::FeatureVariation kDiscoverFeedTopSyncPromoVariations[] = {
260 {"Full with title", kDiscoverFeedTopSyncPromoFullWithTitle,
261 std::size(kDiscoverFeedTopSyncPromoFullWithTitle), nullptr},
262 {"Compact", kDiscoverFeedTopSyncPromoCompact,
263 std::size(kDiscoverFeedTopSyncPromoCompact), nullptr}};
264
Robbie Gibson46351032022-03-31 19:46:23265const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion1[] = {
266 {kIOSOmniboxUpdatedPopupUIVariationName,
267 kIOSOmniboxUpdatedPopupUIVariation1}};
268const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion2[] = {
269 {kIOSOmniboxUpdatedPopupUIVariationName,
270 kIOSOmniboxUpdatedPopupUIVariation2}};
Stepan Khapugin0fd1869a2022-08-09 10:23:47271const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion3[] = {
272 {kIOSOmniboxUpdatedPopupUIVariationName,
273 kIOSOmniboxUpdatedPopupUIVariation1UIKit}};
274const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion4[] = {
275 {kIOSOmniboxUpdatedPopupUIVariationName,
276 kIOSOmniboxUpdatedPopupUIVariation2UIKit}};
Robbie Gibson46351032022-03-31 19:46:23277const FeatureEntry::FeatureVariation kiOSOmniboxUpdatedPopupUIVariations[] = {
Stepan Khapugin0fd1869a2022-08-09 10:23:47278 {"Version 1 - SwiftUI", kiOSOmniboxUpdatedPopupUIVersion1,
Robbie Gibson46351032022-03-31 19:46:23279 std::size(kiOSOmniboxUpdatedPopupUIVersion1), nullptr},
Stepan Khapugin0fd1869a2022-08-09 10:23:47280 {"Version 2 - SwiftUI", kiOSOmniboxUpdatedPopupUIVersion2,
281 std::size(kiOSOmniboxUpdatedPopupUIVersion2), nullptr},
282 {"Version 1 - UIKit", kiOSOmniboxUpdatedPopupUIVersion3,
283 std::size(kiOSOmniboxUpdatedPopupUIVersion3), nullptr},
284 {"Version 2 - UIKit", kiOSOmniboxUpdatedPopupUIVersion4,
285 std::size(kiOSOmniboxUpdatedPopupUIVersion4), nullptr}};
Robbie Gibson46351032022-03-31 19:46:23286
gogerald53c6e7a2021-04-15 22:07:35287const FeatureEntry::FeatureParam kStartSurfaceTenSecondsShrinkLogo[] = {
Chris Lu5470417c2021-03-03 18:43:08288 {kStartSurfaceShrinkLogoParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35289 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
290const FeatureEntry::FeatureParam kStartSurfaceTenSecondsHideShortcuts[] = {
Chris Lu5470417c2021-03-03 18:43:08291 {kStartSurfaceHideShortcutsParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35292 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
293const FeatureEntry::FeatureParam kStartSurfaceTenSecondsReturnToRecentTab[] = {
Chris Lu5470417c2021-03-03 18:43:08294 {kStartSurfaceReturnToRecentTabParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35295 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
296const FeatureEntry::FeatureParam
297 kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab[] = {
298 {kStartSurfaceShrinkLogoParam, "true"},
299 {kStartSurfaceReturnToRecentTabParam, "true"},
300 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
301const FeatureEntry::FeatureParam
302 kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab[] = {
303 {kStartSurfaceHideShortcutsParam, "true"},
304 {kStartSurfaceReturnToRecentTabParam, "true"},
305 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
306const FeatureEntry::FeatureParam kStartSurfaceOneHourShrinkLogo[] = {
Chris Lu5470417c2021-03-03 18:43:08307 {kStartSurfaceShrinkLogoParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35308 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
309const FeatureEntry::FeatureParam kStartSurfaceOneHourHideShortcuts[] = {
310 {kStartSurfaceHideShortcutsParam, "true"},
311 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
312const FeatureEntry::FeatureParam kStartSurfaceOneHourReturnToRecentTab[] = {
Chris Lu5470417c2021-03-03 18:43:08313 {kStartSurfaceReturnToRecentTabParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35314 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
315const FeatureEntry::FeatureParam
316 kStartSurfaceOneHourShrinkLogoReturnToRecentTab[] = {
317 {kStartSurfaceShrinkLogoParam, "true"},
318 {kStartSurfaceReturnToRecentTabParam, "true"},
319 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
320const FeatureEntry::FeatureParam
321 kStartSurfaceOneHourHideShortcutsReturnToRecentTab[] = {
322 {kStartSurfaceHideShortcutsParam, "true"},
323 {kStartSurfaceReturnToRecentTabParam, "true"},
324 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
Chris Lu5470417c2021-03-03 18:43:08325
gogerald0e39e3aa2021-02-10 18:41:23326const FeatureEntry::FeatureVariation kStartSurfaceVariations[] = {
gogerald53c6e7a2021-04-15 22:07:35327 {"10s:Show Return to Recent Tab tile",
328 kStartSurfaceTenSecondsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53329 std::size(kStartSurfaceTenSecondsReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35330 {"10s:Shrink Logo", kStartSurfaceTenSecondsShrinkLogo,
Daniel Cheng1f047a82022-02-26 10:04:53331 std::size(kStartSurfaceTenSecondsShrinkLogo), nullptr},
gogerald53c6e7a2021-04-15 22:07:35332 {"10s:Hide Shortcuts", kStartSurfaceTenSecondsHideShortcuts,
Daniel Cheng1f047a82022-02-26 10:04:53333 std::size(kStartSurfaceTenSecondsHideShortcuts), nullptr},
gogerald53c6e7a2021-04-15 22:07:35334 {"10s:Shrink Logo and show Return to Recent Tab tile",
335 kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53336 std::size(kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35337 {"10s:Hide Shortcuts and show Return to Recent Tab tile",
338 kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53339 std::size(kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35340 {"1h:Show Return to Recent Tab tile", kStartSurfaceOneHourReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53341 std::size(kStartSurfaceOneHourReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35342 {"1h:Shrink Logo", kStartSurfaceOneHourShrinkLogo,
Daniel Cheng1f047a82022-02-26 10:04:53343 std::size(kStartSurfaceOneHourShrinkLogo), nullptr},
gogerald53c6e7a2021-04-15 22:07:35344 {"1h:Hide Shortcuts", kStartSurfaceOneHourHideShortcuts,
Daniel Cheng1f047a82022-02-26 10:04:53345 std::size(kStartSurfaceOneHourHideShortcuts), nullptr},
gogerald53c6e7a2021-04-15 22:07:35346 {"1h:Shrink Logo and show Return to Recent Tab tile",
347 kStartSurfaceOneHourShrinkLogoReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53348 std::size(kStartSurfaceOneHourShrinkLogoReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35349 {"1h:Hide Shortcuts and show Return to Recent Tab tile",
350 kStartSurfaceOneHourHideShortcutsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53351 std::size(kStartSurfaceOneHourHideShortcutsReturnToRecentTab), nullptr},
Chris Lu5470417c2021-03-03 18:43:08352};
gogerald0e39e3aa2021-02-10 18:41:23353
Ed Chin91e44992022-07-27 13:42:34354#if BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
Ed Chin59f617b2022-07-19 22:12:04355// Feed Background Refresh Feature Params
Ed Chin321b8fe2022-08-16 07:02:01356const FeatureEntry::FeatureParam kOneHourIntervalOneHourMaxAgeOnce[] = {
Ed Chin59f617b2022-07-19 22:12:04357 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
358 {kEnableRecurringBackgroundRefreshSchedule, "false"},
Ed Chin321b8fe2022-08-16 07:02:01359 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
Ed Chin59f617b2022-07-19 22:12:04360 {kBackgroundRefreshIntervalInSeconds, /* 60*60= */ "3600"}};
Ed Chin321b8fe2022-08-16 07:02:01361const FeatureEntry::FeatureParam kFourHourIntervalSixHourMaxAgeOnce[] = {
Ed Chin59f617b2022-07-19 22:12:04362 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
363 {kEnableRecurringBackgroundRefreshSchedule, "false"},
Ed Chin321b8fe2022-08-16 07:02:01364 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
Ed Chin59f617b2022-07-19 22:12:04365 {kBackgroundRefreshIntervalInSeconds, /* 4*60*60= */ "14400"}};
Ed Chin321b8fe2022-08-16 07:02:01366const FeatureEntry::FeatureParam kOneHourIntervalOneHourMaxAgeRecurring[] = {
Ed Chin59f617b2022-07-19 22:12:04367 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
368 {kEnableRecurringBackgroundRefreshSchedule, "true"},
Ed Chin321b8fe2022-08-16 07:02:01369 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
Ed Chin59f617b2022-07-19 22:12:04370 {kBackgroundRefreshIntervalInSeconds, /* 60*60= */ "3600"}};
Ed Chin321b8fe2022-08-16 07:02:01371const FeatureEntry::FeatureParam kFourHourIntervalSixHourMaxAgeRecurring[] = {
Ed Chin59f617b2022-07-19 22:12:04372 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
373 {kEnableRecurringBackgroundRefreshSchedule, "true"},
Ed Chin321b8fe2022-08-16 07:02:01374 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
Ed Chin59f617b2022-07-19 22:12:04375 {kBackgroundRefreshIntervalInSeconds, /* 4*60*60= */ "14400"}};
Ed Chin321b8fe2022-08-16 07:02:01376const FeatureEntry::FeatureParam kServerDrivenOneHourMaxAgeOnce[] = {
Ed Chin59f617b2022-07-19 22:12:04377 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
378 {kEnableRecurringBackgroundRefreshSchedule, "false"},
Ed Chin321b8fe2022-08-16 07:02:01379 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
380 {kBackgroundRefreshIntervalInSeconds, "0"}};
381const FeatureEntry::FeatureParam kServerDrivenOneHourMaxAgeRecurring[] = {
Ed Chin59f617b2022-07-19 22:12:04382 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
383 {kEnableRecurringBackgroundRefreshSchedule, "true"},
Ed Chin321b8fe2022-08-16 07:02:01384 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
385 {kBackgroundRefreshIntervalInSeconds, "0"}};
386const FeatureEntry::FeatureParam kServerDrivenSixHourMaxAgeOnce[] = {
387 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
388 {kEnableRecurringBackgroundRefreshSchedule, "false"},
389 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
390 {kBackgroundRefreshIntervalInSeconds, "0"}};
391const FeatureEntry::FeatureParam kServerDrivenSixHourMaxAgeRecurring[] = {
392 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
393 {kEnableRecurringBackgroundRefreshSchedule, "true"},
394 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
395 {kBackgroundRefreshIntervalInSeconds, "0"}};
Ed Chin59f617b2022-07-19 22:12:04396
397// Feed Background Refresh Feature Variations
Ed Chin59f617b2022-07-19 22:12:04398const FeatureEntry::FeatureVariation kFeedBackgroundRefreshVariations[] = {
Ed Chin321b8fe2022-08-16 07:02:01399 {"1hr Interval 1hr Max Age Once", kOneHourIntervalOneHourMaxAgeOnce,
400 std::size(kOneHourIntervalOneHourMaxAgeOnce), nullptr},
401 {"4hr Interval 6hr Max Age Once", kFourHourIntervalSixHourMaxAgeOnce,
402 std::size(kFourHourIntervalSixHourMaxAgeOnce), nullptr},
403 {"1hr Interval 1hr Max Age Recurring",
404 kOneHourIntervalOneHourMaxAgeRecurring,
405 std::size(kOneHourIntervalOneHourMaxAgeRecurring), nullptr},
406 {"4hr Interval 6hr Max Age Recurring",
407 kFourHourIntervalSixHourMaxAgeRecurring,
408 std::size(kFourHourIntervalSixHourMaxAgeRecurring), nullptr},
409 {"Server Driven 1hr Max Age Once", kServerDrivenOneHourMaxAgeOnce,
410 std::size(kServerDrivenOneHourMaxAgeOnce), nullptr},
411 {"Server Driven 1hr Max Age Recurring", kServerDrivenOneHourMaxAgeRecurring,
412 std::size(kServerDrivenOneHourMaxAgeRecurring), nullptr},
413 {"Server Driven 6hr Max Age Once", kServerDrivenSixHourMaxAgeOnce,
414 std::size(kServerDrivenSixHourMaxAgeOnce), nullptr},
415 {"Server Driven 6hr Max Age Recurring", kServerDrivenSixHourMaxAgeRecurring,
416 std::size(kServerDrivenSixHourMaxAgeRecurring), nullptr},
Ed Chin59f617b2022-07-19 22:12:04417};
Ed Chin91e44992022-07-27 13:42:34418#endif // BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
Ed Chin59f617b2022-07-19 22:12:04419
ginnnnnnny46435132022-06-01 16:06:04420const FeatureEntry::FeatureParam kFREDefaultBrowserPromoDefaultDelay[] = {
421 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoDefaultDelayParam}};
422const FeatureEntry::FeatureParam kFREDefaultBrowserPromoFirstRunOnly[] = {
423 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoFirstRunOnlyParam}};
424const FeatureEntry::FeatureParam kFREDefaultBrowserPromoShortDelay[] = {
425 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoShortDelayParam}};
426const FeatureEntry::FeatureVariation kFREDefaultBrowserPromoVariations[] = {
Aliona DANGLA8fae66f02021-10-06 15:47:11427 {"Wait 14 days after FRE default browser promo",
ginnnnnnny46435132022-06-01 16:06:04428 kFREDefaultBrowserPromoDefaultDelay,
429 std::size(kFREDefaultBrowserPromoDefaultDelay), nullptr},
430 {"FRE default browser promo only", kFREDefaultBrowserPromoFirstRunOnly,
431 std::size(kFREDefaultBrowserPromoFirstRunOnly), nullptr},
Aliona DANGLA8fae66f02021-10-06 15:47:11432 {"Wait 3 days after FRE default browser promo",
ginnnnnnny46435132022-06-01 16:06:04433 kFREDefaultBrowserPromoShortDelay,
434 std::size(kFREDefaultBrowserPromoShortDelay), nullptr},
Aliona DANGLA8fae66f02021-10-06 15:47:11435};
436
Chris Luc9a5cb12022-07-20 16:11:39437const FeatureEntry::FeatureParam kTrendingQueriesEnableAllUsers[] = {
438 {kTrendingQueriesHideShortcutsParam, "false"},
439 {kTrendingQueriesDisabledFeedParam, "false"},
440 {kTrendingQueriesSignedOutParam, "false"}};
441const FeatureEntry::FeatureParam kTrendingQueriesEnableAllUsersHideShortcuts[] =
442 {{kTrendingQueriesHideShortcutsParam, "true"},
443 {kTrendingQueriesDisabledFeedParam, "false"},
444 {kTrendingQueriesSignedOutParam, "false"}};
445const FeatureEntry::FeatureParam kTrendingQueriesEnableFeedDisabled[] = {
446 {kTrendingQueriesHideShortcutsParam, "false"},
447 {kTrendingQueriesDisabledFeedParam, "true"},
448 {kTrendingQueriesSignedOutParam, "false"}};
449const FeatureEntry::FeatureParam kTrendingQueriesEnableSignedOut[] = {
450 {kTrendingQueriesHideShortcutsParam, "true"},
451 {kTrendingQueriesDisabledFeedParam, "false"},
452 {kTrendingQueriesSignedOutParam, "true"}};
Chris Luecd575f2022-08-05 23:23:06453const FeatureEntry::FeatureParam
454 kTrendingQueriesEnableNeverShowHideShortcuts[] = {
455 {kTrendingQueriesHideShortcutsParam, "true"},
456 {kTrendingQueriesDisabledFeedParam, "false"},
457 {kTrendingQueriesSignedOutParam, "false"},
458 {kTrendingQueriesNeverShowModuleParam, "true"}};
Chris Luc9a5cb12022-07-20 16:11:39459
460const FeatureEntry::FeatureVariation kTrendingQueriesModuleVariations[] = {
461 {"Enabled All Users", kTrendingQueriesEnableAllUsers,
462 std::size(kTrendingQueriesEnableAllUsers), nullptr},
463 {"Enabled All Users Hide Shortcuts",
464 kTrendingQueriesEnableAllUsersHideShortcuts,
465 std::size(kTrendingQueriesEnableAllUsersHideShortcuts), nullptr},
466 {"Enabled Disabled Feed", kTrendingQueriesEnableFeedDisabled,
467 std::size(kTrendingQueriesEnableFeedDisabled), nullptr},
468 {"Enabled Signed Out", kTrendingQueriesEnableSignedOut,
469 std::size(kTrendingQueriesEnableSignedOut), nullptr},
Chris Luecd575f2022-08-05 23:23:06470 {"Enabled Never Show and Hide Shortcuts",
471 kTrendingQueriesEnableNeverShowHideShortcuts,
472 std::size(kTrendingQueriesEnableNeverShowHideShortcuts), nullptr},
473
Chris Luc9a5cb12022-07-20 16:11:39474};
475
jlebel041fc1c2022-03-04 12:53:30476const FeatureEntry::FeatureParam kNewMICEFREWithUMADialog[] = {
477 {kNewMobileIdentityConsistencyFREParam,
478 kNewMobileIdentityConsistencyFREParamUMADialog}};
479const FeatureEntry::FeatureParam kNewMICEFREWithThreeSteps[] = {
480 {kNewMobileIdentityConsistencyFREParam,
481 kNewMobileIdentityConsistencyFREParamThreeSteps}};
482const FeatureEntry::FeatureParam kNewMICEFREWithTwoSteps[] = {
483 {kNewMobileIdentityConsistencyFREParam,
484 kNewMobileIdentityConsistencyFREParamTwoSteps}};
485const FeatureEntry::FeatureVariation
486 kNewMobileIdentityConsistencyFREVariations[] = {
487 {"New FRE with UMA dialog", kNewMICEFREWithUMADialog,
488 std::size(kNewMICEFREWithUMADialog), nullptr},
489 {"new FRE with 3 steps", kNewMICEFREWithThreeSteps,
490 std::size(kNewMICEFREWithThreeSteps), nullptr},
491 {"new FRE with 2 steps", kNewMICEFREWithTwoSteps,
492 std::size(kNewMICEFREWithTwoSteps), nullptr}};
493
Louis Romero023cc5052022-04-08 23:29:39494const FeatureEntry::FeatureParam kBubbleRichIPHTargetHighlight[] = {
495 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterTargetHighlight}};
Christian Xubd60c4b72022-03-22 15:25:01496const FeatureEntry::FeatureParam kBubbleRichIPHExplicitDismissal[] = {
497 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterExplicitDismissal}};
498const FeatureEntry::FeatureParam kBubbleRichIPHRich[] = {
499 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRich}};
500const FeatureEntry::FeatureParam kBubbleRichIPHRichWithSnooze[] = {
501 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRichWithSnooze}};
502const FeatureEntry::FeatureVariation kBubbleRichIPHVariations[] = {
Louis Romero023cc5052022-04-08 23:29:39503 {"Target Highlight", kBubbleRichIPHTargetHighlight,
504 std::size(kBubbleRichIPHTargetHighlight), nullptr},
Christian Xubd60c4b72022-03-22 15:25:01505 {"Explicit dismissal", kBubbleRichIPHExplicitDismissal,
506 std::size(kBubbleRichIPHExplicitDismissal), nullptr},
507 {"Dismissal and rich content", kBubbleRichIPHRich,
508 std::size(kBubbleRichIPHRich), nullptr},
Louis Romero023cc5052022-04-08 23:29:39509 {"Dismissal, rich content, and snooze", kBubbleRichIPHRichWithSnooze,
Christian Xubd60c4b72022-03-22 15:25:01510 std::size(kBubbleRichIPHRichWithSnooze), nullptr},
511};
512
Christian Xubdedabec2022-07-04 10:00:13513const FeatureEntry::FeatureParam kOmniboxPasteButtonBlueIconCapsule[] = {
514 {kOmniboxPasteButtonParameterName,
515 kOmniboxPasteButtonParameterBlueIconCapsule}};
516const FeatureEntry::FeatureParam kOmniboxPasteButtonBlueFullCapsule[] = {
517 {kOmniboxPasteButtonParameterName,
518 kOmniboxPasteButtonParameterBlueFullCapsule}};
519const FeatureEntry::FeatureVariation kOmniboxPasteButtonVariations[] = {
520 {"Icon only", kOmniboxPasteButtonBlueIconCapsule,
521 std::size(kOmniboxPasteButtonBlueIconCapsule), nullptr},
522 {"Icon and text", kOmniboxPasteButtonBlueFullCapsule,
523 std::size(kOmniboxPasteButtonBlueFullCapsule), nullptr},
524};
525
Gauthier Ambard30ad9ca2022-06-09 14:15:26526const FeatureEntry::FeatureParam kPopupMenuBookmarkStringAddABookmark[] = {
527 {kPopupMenuBookmarkStringParamName,
528 kPopupMenuBookmarkStringParamAddABookmark}};
529const FeatureEntry::FeatureParam kPopupMenuBookmarkStringAddToBookmarks[] = {
530 {kPopupMenuBookmarkStringParamName,
531 kPopupMenuBookmarkStringParamAddToBookmarks}};
532const FeatureEntry::FeatureParam kPopupMenuBookmarkStringBookmarkThisPage[] = {
533 {kPopupMenuBookmarkStringParamName,
534 kPopupMenuBookmarkStringParamBookmarkThisPage}};
535
536const FeatureEntry::FeatureVariation kPopupMenuBookmarkStringVarations[] = {
537 {"(Add A Bookmark)", kPopupMenuBookmarkStringAddABookmark,
538 std::size(kPopupMenuBookmarkStringAddABookmark), nullptr},
539 {"(Add To Bookmarks)", kPopupMenuBookmarkStringAddToBookmarks,
540 std::size(kPopupMenuBookmarkStringAddToBookmarks), nullptr},
541 {"(Bookmark This Page)", kPopupMenuBookmarkStringBookmarkThisPage,
542 std::size(kPopupMenuBookmarkStringBookmarkThisPage), nullptr}};
543
Igor Ruvinov44fed9f2022-06-10 22:51:42544const FeatureEntry::FeatureParam kDmTokenDeletionParam[] = {{"forced", "true"}};
545const FeatureEntry::FeatureVariation kDmTokenDeletionVariation[] = {
546 {"(Forced)", kDmTokenDeletionParam, std::size(kDmTokenDeletionParam),
547 nullptr}};
548
Cooper Knaak1e026562017-07-26 05:22:28549// To add a new entry, add to the end of kFeatureEntries. There are four
sdefresne14900ee2015-11-27 14:43:21550// distinct types of entries:
Cooper Knaak1e026562017-07-26 05:22:28551// . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the
552// default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE
sdefresne14900ee2015-11-27 14:43:21553// macro for this type supplying the command line to the macro.
554// . MULTI_VALUE: a list of choices, the first of which should correspond to a
555// deactivated state for this lab (i.e. no command line option). To specify
556// this type of entry use the macro MULTI_VALUE_TYPE supplying it the
557// array of choices.
Cooper Knaak1e026562017-07-26 05:22:28558// . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is
559// either enabled, disabled, or uses the default value of the associated
560// base::Feature instance. To specify this type of entry use the macro
561// FEATURE_VALUE_TYPE supplying it the base::Feature instance.
562// . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a
563// base::Feature instance. Choices corresponding to the default state, a
564// universally enabled state, and a universally disabled state are
565// automatically included. To specify this type of entry use the macro
566// FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and
567// the array of choices.
568//
sdefresne14900ee2015-11-27 14:43:21569// See the documentation of FeatureEntry for details on the fields.
570//
571// When adding a new choice, add it to the end of the list.
572const flags_ui::FeatureEntry kFeatureEntries[] = {
Cooper Knaak1e026562017-07-26 05:22:28573 {"in-product-help-demo-mode-choice",
574 flag_descriptions::kInProductHelpDemoModeName,
575 flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos,
576 FEATURE_WITH_PARAMS_VALUE_TYPE(
Tommy Nyquistc1d6dea12017-07-26 20:37:23577 feature_engagement::kIPHDemoMode,
578 feature_engagement::kIPHDemoModeChoiceVariations,
Marc Treib2752e8b2017-08-04 14:12:09579 "IPH_DemoMode")},
Moe Ahmadic3fd7cd2018-05-11 21:40:22580 {"enable-autofill-credit-card-upload",
581 flag_descriptions::kAutofillCreditCardUploadName,
582 flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos,
Anne Lim579b5732018-08-30 18:24:24583 FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)},
Tina Wang41d431c2021-06-21 21:04:13584 {"enable-discover-feed-preview",
585 flag_descriptions::kEnableDiscoverFeedPreviewName,
586 flag_descriptions::kEnableDiscoverFeedPreviewDescription, flags_ui::kOsIos,
587 FEATURE_VALUE_TYPE(kEnableDiscoverFeedPreview)},
Moe Ahmadid6d5d172018-06-20 17:20:23588 {"use-sync-sandbox", flag_descriptions::kSyncSandboxName,
589 flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos,
590 SINGLE_VALUE_TYPE_AND_VALUE(
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51591 syncer::kSyncServiceURL,
Moe Ahmadid6d5d172018-06-20 17:20:23592 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")},
593 {"wallet-service-use-sandbox",
594 flag_descriptions::kWalletServiceUseSandboxName,
595 flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos,
596 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
597 autofill::switches::kWalletServiceUseSandbox,
598 "1",
599 autofill::switches::kWalletServiceUseSandbox,
600 "0")},
Mohamad Ahmadic4df81f2017-12-20 04:41:59601 {"show-autofill-type-predictions",
602 flag_descriptions::kShowAutofillTypePredictionsName,
603 flag_descriptions::kShowAutofillTypePredictionsDescription,
604 flags_ui::kOsIos,
Gauthier Ambardcfd85182018-01-05 10:37:46605 FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)},
Olivier Robin3d60411622018-02-23 10:03:22606 {"autofill-ios-delay-between-fields",
607 flag_descriptions::kAutofillIOSDelayBetweenFieldsName,
608 flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription,
609 flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)},
Benjamin Williams14233d72022-07-26 18:32:20610 {"fullscreen-promos-manager",
611 flag_descriptions::kFullscreenPromosManagerName,
612 flag_descriptions::kFullscreenPromosManagerDescription, flags_ui::kOsIos,
613 FEATURE_VALUE_TYPE(kFullscreenPromosManager)},
Kurt Horimotodc33af32018-05-01 01:39:14614 {"fullscreen-viewport-adjustment-experiment",
Chris Lu481a9322019-09-25 22:16:53615 flag_descriptions::kFullscreenSmoothScrollingName,
616 flag_descriptions::kFullscreenSmoothScrollingDescription, flags_ui::kOsIos,
617 FEATURE_VALUE_TYPE(fullscreen::features::kSmoothScrollingDefault)},
Robbie Gibson1f37a5e2020-08-06 17:03:06618 {"webpage-default-zoom-from-dynamic-type",
619 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeName,
620 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeDescription,
621 flags_ui::kOsIos,
622 FEATURE_VALUE_TYPE(web::kWebPageDefaultZoomFromDynamicType)},
Robbie Gibson88f23962020-09-28 14:35:56623 {"webpage-alternative-text-zoom",
624 flag_descriptions::kWebPageAlternativeTextZoomName,
625 flag_descriptions::kWebPageAlternativeTextZoomDescription,
626 flags_ui::kOsIos, FEATURE_VALUE_TYPE(web::kWebPageAlternativeTextZoom)},
Robbie Gibson1095b72c2022-06-06 17:03:34627 {"webpage-text-zoom-ipad", flag_descriptions::kWebPageTextZoomIPadName,
628 flag_descriptions::kWebPageTextZoomIPadDescription, flags_ui::kOsIos,
629 FEATURE_VALUE_TYPE(web::kWebPageTextZoomIPad)},
Kurt Horimoto79d590b2018-09-12 19:09:28630 {"toolbar-container", flag_descriptions::kToolbarContainerName,
631 flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos,
632 FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)},
Stepan Khapugincc4e9842019-01-23 13:38:13633 {"omnibox-ui-max-autocomplete-matches",
634 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName,
635 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription,
636 flags_ui::kOsIos,
637 FEATURE_WITH_PARAMS_VALUE_TYPE(
638 omnibox::kUIExperimentMaxAutocompleteMatches,
639 kOmniboxUIMaxAutocompleteMatchesVariations,
640 "OmniboxUIMaxAutocompleteVariations")},
Moe Ahmadi01028f22022-08-06 17:57:35641 {"omnibox-local-history-zero-suggest-beyond-ntp",
642 flag_descriptions::kOmniboxLocalHistoryZeroSuggestBeyondNTPName,
643 flag_descriptions::kOmniboxLocalHistoryZeroSuggestBeyondNTPDescription,
644 flags_ui::kOsIos,
645 FEATURE_VALUE_TYPE(omnibox::kLocalHistoryZeroSuggestBeyondNTP)},
Stepan Khapuginbac467e2022-05-06 21:11:54646 {"omnibox-max-zps-matches", flag_descriptions::kOmniboxMaxZPSMatchesName,
647 flag_descriptions::kOmniboxMaxZPSMatchesDescription, flags_ui::kOsIos,
648 FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kMaxZeroSuggestMatches,
649 kOmniboxMaxZPSMatchesVariations,
650 "OmniboxMaxZPSVariations")},
Peter Boström3f798572022-07-26 23:44:36651#if BUILDFLAG(DCHECK_IS_CONFIGURABLE)
Justin Cohen20b6f072019-01-16 01:38:50652 {"dcheck-is-fatal", flag_descriptions::kDcheckIsFatalName,
653 flag_descriptions::kDcheckIsFatalDescription, flags_ui::kOsIos,
654 FEATURE_VALUE_TYPE(base::kDCheckIsFatalFeature)},
Peter Boström3f798572022-07-26 23:44:36655#endif // BUILDFLAG(DCHECK_IS_CONFIGURABLE)
Caitlin Fischer43edd90a2019-05-01 13:24:30656 {"autofill-use-mobile-label-disambiguation",
657 flag_descriptions::kAutofillUseMobileLabelDisambiguationName,
658 flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription,
659 flags_ui::kOsIos,
Caitlin Fischer37e01232019-05-24 13:05:45660 FEATURE_WITH_PARAMS_VALUE_TYPE(
661 autofill::features::kAutofillUseMobileLabelDisambiguation,
662 kAutofillUseMobileLabelDisambiguationVariations,
663 "AutofillUseMobileLabelDisambiguation")},
Olivier Robin43814bb2021-06-22 15:25:45664 {"metrickit-crash-reports", flag_descriptions::kMetrickitCrashReportName,
665 flag_descriptions::kMetrickitCrashReportDescription, flags_ui::kOsIos,
666 FEATURE_VALUE_TYPE(kMetrickitCrashReport)},
Mike Doughertyb6c770d2019-09-13 22:56:46667 {"ios-breadcrumbs", flag_descriptions::kLogBreadcrumbsName,
668 flag_descriptions::kLogBreadcrumbsDescription, flags_ui::kOsIos,
Jesse McKenna85c1a59f2021-05-05 19:08:30669 FEATURE_VALUE_TYPE(breadcrumbs::kLogBreadcrumbs)},
Eugene But2823dc7e2020-07-21 18:10:37670 {"ios-synthetic-crash-reports",
671 flag_descriptions::kSyntheticCrashReportsForUteName,
672 flag_descriptions::kSyntheticCrashReportsForUteDescription,
673 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSyntheticCrashReportsForUte)},
Jérôme Lebelc374fdd2019-09-27 10:36:48674 {"force-startup-signin-promo",
675 flag_descriptions::kForceStartupSigninPromoName,
676 flag_descriptions::kForceStartupSigninPromoDescription, flags_ui::kOsIos,
Alice Wang345e09442021-07-05 09:03:29677 FEATURE_VALUE_TYPE(switches::kForceStartupSigninPromo)},
Yoichi Osato7ae11752021-03-16 03:27:22678 {"restore-session-from-cache",
679 flag_descriptions::kRestoreSessionFromCacheName,
680 flag_descriptions::kRestoreSessionFromCacheDescription, flags_ui::kOsIos,
Justin Cohen3ec2522c2021-04-23 18:23:49681 FEATURE_VALUE_TYPE(web::kRestoreSessionFromCache)},
sczs4622e6e2019-11-06 01:17:59682 {"autofill-save-card-dismiss-on-navigation",
683 flag_descriptions::kAutofillSaveCardDismissOnNavigationName,
684 flag_descriptions::kAutofillSaveCardDismissOnNavigationDescription,
685 flags_ui::kOsIos,
686 FEATURE_VALUE_TYPE(
687 autofill::features::kAutofillSaveCardDismissOnNavigation)},
sczs37d9c132020-07-18 06:06:33688 {"new-content-suggestions-feed", flag_descriptions::kDiscoverFeedInNtpName,
adamta22a4d502020-05-21 03:12:21689 flag_descriptions::kDiscoverFeedInNtpDescription, flags_ui::kOsIos,
gogeralddb0d8ae2020-11-13 03:56:58690 FEATURE_WITH_PARAMS_VALUE_TYPE(kDiscoverFeedInNtp,
691 kDiscoverFeedInNtpVariations,
692 "IOSDiscoverFeed")},
Roberto Mourab87b9722020-06-17 17:12:09693 {"expanded-tab-strip", flag_descriptions::kExpandedTabStripName,
694 flag_descriptions::kExpandedTabStripDescription, flags_ui::kOsIos,
695 FEATURE_VALUE_TYPE(kExpandedTabStrip)},
Tommy Martino6b4eb7e2020-06-25 18:25:41696 {"shared-highlighting-ios", flag_descriptions::kSharedHighlightingIOSName,
697 flag_descriptions::kSharedHighlightingIOSDescription, flags_ui::kOsIos,
698 FEATURE_VALUE_TYPE(kSharedHighlightingIOS)},
Veronique Nguyen6593c762021-11-30 17:28:56699 {"enable-fre-ui-module-ios-with-options",
700 flag_descriptions::kEnableFREUIModuleIOSName,
Tina Wanga252ca42021-04-01 17:14:23701 flag_descriptions::kEnableFREUIModuleIOSDescription, flags_ui::kOsIos,
ginnnnnnny429b5522022-05-05 03:50:06702 FEATURE_VALUE_TYPE(kEnableFREUIModuleIOS)},
jlebel041fc1c2022-03-04 12:53:30703 {"new-mobile-identity-consistency-fre",
704 flag_descriptions::kNewMobileIdentityConsistencyFREName,
705 flag_descriptions::kNewMobileIdentityConsistencyFREDescription,
706 flags_ui::kOsIos,
707 FEATURE_WITH_PARAMS_VALUE_TYPE(signin::kNewMobileIdentityConsistencyFRE,
708 kNewMobileIdentityConsistencyFREVariations,
ginnnnnnny46435132022-06-01 16:06:04709 kIOSMICeAndDefaultBrowserTrialName)},
Sylvain Defresne9c107082020-10-27 16:39:13710#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
edchin81467b82020-09-03 19:31:45711 {"screen-time-integration-ios",
712 flag_descriptions::kScreenTimeIntegrationName,
713 flag_descriptions::kScreenTimeIntegrationDescription, flags_ui::kOsIos,
714 FEATURE_VALUE_TYPE(kScreenTimeIntegration)},
Sylvain Defresne9c107082020-10-27 16:39:13715#endif
Nazerke3e993f72020-09-21 13:00:06716 {"modern-tab-strip", flag_descriptions::kModernTabStripName,
717 flag_descriptions::kModernTabStripDescription, flags_ui::kOsIos,
718 FEATURE_VALUE_TYPE(kModernTabStrip)},
Nohemi Fernandez222d6d42020-09-30 20:35:57719 {"minutes-delay-to-restore-gaia-cookies-if-deleted",
720 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieName,
721 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieDescription,
722 flags_ui::kOsIos,
723 MULTI_VALUE_TYPE(kDelayThresholdMinutesToUpdateGaiaCookieChoices)},
Eugene Butf869bff2020-12-10 01:16:55724 {"record-snapshot-size", flag_descriptions::kRecordSnapshotSizeName,
725 flag_descriptions::kRecordSnapshotSizeDescription, flags_ui::kOsIos,
726 FEATURE_VALUE_TYPE(web::features::kRecordSnapshotSize)},
Chris Lub17195f2020-12-10 20:49:14727 {"default-browser-fullscreen-promo-experiment",
728 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentName,
729 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentDescription,
730 flags_ui::kOsIos,
Javier Ernesto Flores Robles159414232021-06-16 14:29:59731 FEATURE_WITH_PARAMS_VALUE_TYPE(
732 kDefaultBrowserFullscreenPromoExperiment,
733 kDefaultBrowserFullscreenPromoExperimentVariations,
734 "IOSDefaultBrowserFullscreenPromoExperiment")},
Cheick Cisse76ade3d2020-12-16 00:15:11735 {"ios-shared-highlighting-color-change",
736 flag_descriptions::kIOSSharedHighlightingColorChangeName,
737 flag_descriptions::kIOSSharedHighlightingColorChangeDescription,
Cheick Cissed0b5bfe2021-02-11 14:23:07738 flags_ui::kOsIos,
739 FEATURE_VALUE_TYPE(web::features::kIOSSharedHighlightingColorChange)},
Cheick Cissefe994862021-12-15 16:01:34740 {"ios-shared-highlighting-v2",
741 flag_descriptions::kIOSSharedHighlightingV2Name,
742 flag_descriptions::kIOSSharedHighlightingV2Description, flags_ui::kOsIos,
743 FEATURE_VALUE_TYPE(shared_highlighting::kIOSSharedHighlightingV2)},
Stepan Khapugin04341202021-01-07 12:22:45744 {"omnibox-new-textfield-implementation",
745 flag_descriptions::kOmniboxNewImplementationName,
746 flag_descriptions::kOmniboxNewImplementationDescription, flags_ui::kOsIos,
747 FEATURE_VALUE_TYPE(kIOSNewOmniboxImplementation)},
Stepan Khapugin422f08d2022-02-18 16:19:44748 {"omnibox-new-popup-ui", flag_descriptions::kIOSOmniboxUpdatedPopupUIName,
749 flag_descriptions::kIOSOmniboxUpdatedPopupUIDescription, flags_ui::kOsIos,
Robbie Gibson46351032022-03-31 19:46:23750 FEATURE_WITH_PARAMS_VALUE_TYPE(kIOSOmniboxUpdatedPopupUI,
751 kiOSOmniboxUpdatedPopupUIVariations,
Stepan Khapugina45baed2022-05-13 19:15:43752 "IOSOmniboxUpdatedPopupUI")},
gogerald0ff29e52021-02-03 18:56:19753 {"start-surface", flag_descriptions::kStartSurfaceName,
754 flag_descriptions::kStartSurfaceDescription, flags_ui::kOsIos,
gogerald0e39e3aa2021-02-10 18:41:23755 FEATURE_WITH_PARAMS_VALUE_TYPE(kStartSurface,
756 kStartSurfaceVariations,
757 "StartSurface")},
Justin Cohen13ac7a202021-02-04 18:27:28758 {"ios-crashpad", flag_descriptions::kCrashpadIOSName,
759 flag_descriptions::kCrashpadIOSDescription, flags_ui::kOsIos,
760 FEATURE_VALUE_TYPE(kCrashpadIOS)},
Vidhan Jain451b4752021-07-15 10:16:42761 {"autofill-address-verification-in-save-prompt",
762 flag_descriptions::kEnableAutofillAddressSavePromptAddressVerificationName,
763 flag_descriptions::
764 kEnableAutofillAddressSavePromptAddressVerificationDescription,
765 flags_ui::kOsIos,
766 FEATURE_VALUE_TYPE(
767 autofill::features::
768 kAutofillAddressProfileSavePromptAddressVerificationSupport)},
Vidhan Jaina65741552021-03-09 17:18:27769 {"autofill-address-save-prompt",
770 flag_descriptions::kEnableAutofillAddressSavePromptName,
771 flag_descriptions::kEnableAutofillAddressSavePromptDescription,
772 flags_ui::kOsIos,
773 FEATURE_VALUE_TYPE(autofill::features::kAutofillAddressProfileSavePrompt)},
Viktor Semeniuk68e794a2021-03-24 10:23:25774 {"filling-across-affiliated-websites",
775 flag_descriptions::kFillingAcrossAffiliatedWebsitesName,
776 flag_descriptions::kFillingAcrossAffiliatedWebsitesDescription,
777 flags_ui::kOsIos,
778 FEATURE_VALUE_TYPE(
779 password_manager::features::kFillingAcrossAffiliatedWebsites)},
Jared Sauld47c2b72021-03-25 22:47:31780 {"autofill-parse-merchant-promo-code-fields",
781 flag_descriptions::kAutofillParseMerchantPromoCodeFieldsName,
782 flag_descriptions::kAutofillParseMerchantPromoCodeFieldsDescription,
783 flags_ui::kOsIos,
784 FEATURE_VALUE_TYPE(
785 autofill::features::kAutofillParseMerchantPromoCodeFields)},
edchin257cea2f2021-04-07 13:07:13786 {"interest-feed-v2-clicks-and-views-cond-upload",
787 flag_descriptions::kInterestFeedV2ClickAndViewActionsConditionalUploadName,
788 flag_descriptions::
789 kInterestFeedV2ClickAndViewActionsConditionalUploadDescription,
790 flags_ui::kOsIos,
791 FEATURE_VALUE_TYPE(feed::kInterestFeedV2ClicksAndViewsConditionalUpload)},
Side Yilmaz6c53f7102021-09-07 13:26:19792 {"incognito-ntp-revamp", flag_descriptions::kIncognitoNtpRevampName,
793 flag_descriptions::kIncognitoNtpRevampDescription, flags_ui::kOsIos,
794 FEATURE_VALUE_TYPE(kIncognitoNtpRevamp)},
Side YILMAZ4b40a3082022-04-11 10:13:33795 {"update-history-entry-points-in-incognito",
796 flag_descriptions::kUpdateHistoryEntryPointsInIncognitoName,
797 flag_descriptions::kUpdateHistoryEntryPointsInIncognitoDescription,
798 flags_ui::kOsIos,
799 FEATURE_VALUE_TYPE(kUpdateHistoryEntryPointsInIncognito)},
jlebeld95434d652021-06-22 10:32:48800 {"sync-trusted-vault-passphrase-ios-rpc",
801 flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCName,
802 flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCDescription,
803 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51804 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseiOSRPC)},
Mikel Astiz850b0fe2021-06-16 09:47:27805 {"sync-trusted-vault-passphrase-promo",
806 flag_descriptions::kSyncTrustedVaultPassphrasePromoName,
807 flag_descriptions::kSyncTrustedVaultPassphrasePromoDescription,
808 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51809 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphrasePromo)},
Mikel Astiz850b0fe2021-06-16 09:47:27810 {"sync-trusted-vault-passphrase-recovery",
811 flag_descriptions::kSyncTrustedVaultPassphraseRecoveryName,
812 flag_descriptions::kSyncTrustedVaultPassphraseRecoveryDescription,
813 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51814 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseRecovery)},
Nohemi Fernandezc00842a2021-07-26 11:47:34815 {"wait-threshold-seconds-for-capabilities-api",
816 flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiName,
817 flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiDescription,
818 flags_ui::kOsIos,
819 MULTI_VALUE_TYPE(kWaitThresholdMillisecondsForCapabilitiesApiChoices)},
Jared Saul2188f762021-08-02 21:22:23820 {"autofill-fill-merchant-promo-code-fields",
821 flag_descriptions::kAutofillFillMerchantPromoCodeFieldsName,
822 flag_descriptions::kAutofillFillMerchantPromoCodeFieldsDescription,
823 flags_ui::kOsIos,
824 FEATURE_VALUE_TYPE(
825 autofill::features::kAutofillFillMerchantPromoCodeFields)},
Sylvain Defresnedff67e42021-09-24 09:43:03826 {"new-overflow-menu", flag_descriptions::kNewOverflowMenuName,
827 flag_descriptions::kNewOverflowMenuDescription, flags_ui::kOsIos,
828 FEATURE_VALUE_TYPE(kNewOverflowMenu)},
Robbie Gibsonfe748e52022-05-09 18:20:46829 {"new-overflow-menu-settings-action",
830 flag_descriptions::kNewOverflowMenuSettingsActionName,
Robbie Gibsone2ad5632022-05-16 20:46:10831 flag_descriptions::kNewOverflowMenuSettingsActionDescription,
832 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kNewOverflowMenuSettingsAction)},
833 {"new-overflow-menu-simple-destination-icons",
834 flag_descriptions::kNewOverflowMenuSimpleDestinationIconsName,
835 flag_descriptions::kNewOverflowMenuSimpleDestinationIconsDescription,
836 flags_ui::kOsIos,
837 FEATURE_VALUE_TYPE(kNewOverflowMenuSimpleDestinationIcons)},
Robbie Gibson640bccb32022-05-10 18:43:35838 {"new-overflow-menu-cbd-action",
839 flag_descriptions::kNewOverflowMenuCBDActionName,
840 flag_descriptions::kNewOverflowMenuCBDActionDescription, flags_ui::kOsIos,
841 FEATURE_VALUE_TYPE(kNewOverflowMenuCBDAction)},
Evan Bernstein0a85f332021-09-29 19:07:24842 {"use-lens-to-search-for-image",
843 flag_descriptions::kUseLensToSearchForImageName,
844 flag_descriptions::kUseLensToSearchForImageDescription, flags_ui::kOsIos,
Ali Juma02a9b7b2021-10-01 13:44:44845 FEATURE_VALUE_TYPE(kUseLensToSearchForImage)},
Jason Hu3830a072022-08-19 20:56:22846 {"enable-lens-in-home-screen-widget",
847 flag_descriptions::kEnableLensInHomeScreenWidgetName,
848 flag_descriptions::kEnableLensInHomeScreenWidgetDescription,
849 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableLensInHomeScreenWidget)},
850 {"enable-lens-in-keyboard", flag_descriptions::kEnableLensInKeyboardName,
851 flag_descriptions::kEnableLensInKeyboardDescription, flags_ui::kOsIos,
852 FEATURE_VALUE_TYPE(kEnableLensInKeyboard)},
853 {"enable-lens-in-ntp", flag_descriptions::kEnableLensInNTPName,
854 flag_descriptions::kEnableLensInNTPDescription, flags_ui::kOsIos,
855 FEATURE_VALUE_TYPE(kEnableLensInNTP)},
Benjamin Williamsbee6ab62022-02-28 18:09:40856 {"use-load-simulated-request-for-error-page-navigation",
Gauthier Ambard33cceaf2022-05-05 14:00:23857 flag_descriptions::kUseLoadSimulatedRequestForOfflinePageName,
858 flag_descriptions::kUseLoadSimulatedRequestForOfflinePageDescription,
Benjamin Williamsbee6ab62022-02-28 18:09:40859 flags_ui::kOsIos,
Gauthier Ambard33cceaf2022-05-05 14:00:23860 FEATURE_VALUE_TYPE(web::features::kUseLoadSimulatedRequestForOfflinePage)},
Sergio Collazos9fcc6ed2021-10-06 00:58:03861 {"enable-discover-feed-static-resource-serving",
862 flag_descriptions::kEnableDiscoverFeedStaticResourceServingName,
863 flag_descriptions::kEnableDiscoverFeedStaticResourceServingDescription,
864 flags_ui::kOsIos,
865 FEATURE_WITH_PARAMS_VALUE_TYPE(
866 kEnableDiscoverFeedStaticResourceServing,
867 kEnableDiscoverFeedStaticResourceServingVariations,
868 "IOSDiscoverFeedStaticResourceServing")},
869 {"enable-disco-feed-endpoint",
870 flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointName,
871 flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointDescription,
872 flags_ui::kOsIos,
Aliona DANGLA8fae66f02021-10-06 15:47:11873 FEATURE_VALUE_TYPE(kEnableDiscoverFeedDiscoFeedEndpoint)},
Mohammad Refaatab6bee62022-05-16 16:31:15874 {"enable-discover-feed-top-sync-promo",
875 flag_descriptions::kEnableDiscoverFeedTopSyncPromoName,
876 flag_descriptions::kEnableDiscoverFeedTopSyncPromoDescription,
877 flags_ui::kOsIos,
878 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableDiscoverFeedTopSyncPromo,
879 kDiscoverFeedTopSyncPromoVariations,
880 "EnableDiscoverFeedTopSyncPromo")},
Aliona DANGLA8fae66f02021-10-06 15:47:11881 {"enable-fre-default-browser-screen-testing",
ginnnnnnny46435132022-06-01 16:06:04882 flag_descriptions::kEnableFREDefaultBrowserPromoScreenName,
883 flag_descriptions::kEnableFREDefaultBrowserPromoScreenDescription,
Aliona DANGLA8fae66f02021-10-06 15:47:11884 flags_ui::kOsIos,
ginnnnnnny46435132022-06-01 16:06:04885 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFREDefaultBrowserPromoScreen,
886 kFREDefaultBrowserPromoVariations,
887 kIOSMICeAndDefaultBrowserTrialName)},
Tommy Martino7393d762021-10-12 17:59:28888 {"shared-highlighting-amp",
889 flag_descriptions::kIOSSharedHighlightingAmpName,
890 flag_descriptions::kIOSSharedHighlightingAmpDescription, flags_ui::kOsIos,
891 FEATURE_VALUE_TYPE(shared_highlighting::kSharedHighlightingAmp)},
David Maunderf4a5e1e2021-10-18 17:24:28892 {"enable-commerce-price-tracking",
Matt Jones125dfb42022-02-11 17:23:42893 commerce::flag_descriptions::kCommercePriceTrackingName,
894 commerce::flag_descriptions::kCommercePriceTrackingDescription,
895 flags_ui::kOsIos,
896 FEATURE_WITH_PARAMS_VALUE_TYPE(commerce::kCommercePriceTracking,
897 commerce::kCommercePriceTrackingVariations,
adamta67b6c5812021-10-19 17:02:15898 "CommercePriceTracking")},
Tina Wang8058d5f2021-11-04 20:06:06899 {"web-feed-ios", flag_descriptions::kEnableWebChannelsName,
900 flag_descriptions::kEnableWebChannelsDescription, flags_ui::kOsIos,
901 FEATURE_VALUE_TYPE(kEnableWebChannels)},
adamta39331592021-11-01 20:18:54902 {"ntp-view-hierarchy-repair",
903 flag_descriptions::kNTPViewHierarchyRepairName,
904 flag_descriptions::kNTPViewHierarchyRepairDescription, flags_ui::kOsIos,
905 FEATURE_VALUE_TYPE(kNTPViewHierarchyRepair)},
Justin Cohen69cec682021-11-04 20:10:26906 {"synthesized-restore-session",
907 flag_descriptions::kSynthesizedRestoreSessionName,
908 flag_descriptions::kSynthesizedRestoreSessionDescription, flags_ui::kOsIos,
909 FEATURE_VALUE_TYPE(web::features::kSynthesizedRestoreSession)},
Chris Lu4723b822021-11-05 21:47:44910 {"remove-extra-ntps", flag_descriptions::kRemoveExcessNTPsExperimentName,
911 flag_descriptions::kRemoveExcessNTPsExperimentDescription,
Sylvain Defresne1619dd002021-11-06 10:09:48912 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kRemoveExcessNTPs)},
Benjamin Williams0e7e2fb2021-11-17 03:03:41913 {"enable-password-manager-branding-update",
914 flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateName,
915 flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateDescription,
916 flags_ui::kOsIos,
Aliona DANGLAe5b0b6e52021-11-30 11:58:19917 FEATURE_VALUE_TYPE(
918 password_manager::features::kIOSEnablePasswordManagerBrandingUpdate)},
Gauthier Ambard1d326e22021-12-16 10:57:53919 {"default-mode-ua", flag_descriptions::kAddSettingForDefaultPageModeName,
920 flag_descriptions::kAddSettingForDefaultPageModeDescription,
921 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kAddSettingForDefaultPageMode)},
ginnnnnnnyee3036e2022-08-12 18:01:18922 {"ios-media-permissions-control",
923 flag_descriptions::kMediaPermissionsControlName,
924 flag_descriptions::kMediaPermissionsControlDescription, flags_ui::kOsIos,
925 FEATURE_VALUE_TYPE(web::features::kMediaPermissionsControl)},
Olivier Robin3a957df2021-12-21 18:04:34926 {"enable-save-session-tabs-in-separate-files",
927 flag_descriptions::kSaveSessionTabsToSeparateFilesName,
928 flag_descriptions::kSaveSessionTabsToSeparateFilesDescription,
929 flags_ui::kOsIos,
930 FEATURE_VALUE_TYPE(sessions::kSaveSessionTabsToSeparateFiles)},
Ewann8c7aadc2022-05-19 15:41:05931 {"use-sf-symbols", flag_descriptions::kUseSFSymbolsName,
932 flag_descriptions::kUseSFSymbolsDescription, flags_ui::kOsIos,
933 FEATURE_VALUE_TYPE(kUseSFSymbols)},
Nohemi Fernandez76f54802022-01-10 18:23:32934 {"enable-unicorn-account-support",
935 flag_descriptions::kEnableUnicornAccountSupportName,
936 flag_descriptions::kEnableUnicornAccountSupportDescription,
937 flags_ui::kOsIos,
938 FEATURE_VALUE_TYPE(signin::kEnableUnicornAccountSupport)},
David Jeanc2b88ab602022-08-08 14:52:51939 {"ios-webpage-intent-annotations",
940 flag_descriptions::kEnableWebPageAnnotationsName,
941 flag_descriptions::kEnableWebPageAnnotationsDescription, flags_ui::kOsIos,
942 FEATURE_VALUE_TYPE(web::features::kEnableWebPageAnnotations)},
rgod90cca8b2022-02-04 12:38:27943 {"leak-detection-unauthenticated",
944 flag_descriptions::kLeakDetectionUnauthenticatedName,
945 flag_descriptions::kLeakDetectionUnauthenticatedDescription,
946 flags_ui::kOsIos,
947 FEATURE_VALUE_TYPE(
948 password_manager::features::kLeakDetectionUnauthenticated)},
Veronique Nguyen00ba26ea2022-02-25 14:57:17949 {"enable-favicon-passwords",
950 flag_descriptions::kEnableFaviconForPasswordsName,
951 flag_descriptions::kEnableFaviconForPasswordsDescription, flags_ui::kOsIos,
952 FEATURE_VALUE_TYPE(
953 password_manager::features::kEnableFaviconForPasswords)},
Shivani Chauhanbf97b0d2022-02-08 22:21:28954 {"autofill-enable-sending-bcn-in-get-upload-details",
955 flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsName,
956 flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsDescription,
957 flags_ui::kOsIos,
958 FEATURE_VALUE_TYPE(
959 autofill::features::kAutofillEnableSendingBcnInGetUploadDetails)},
Ali Juma1429cf8a2022-02-09 15:31:01960 {"enable-fullscreen-api", flag_descriptions::kEnableFullscreenAPIName,
961 flag_descriptions::kEnableFullscreenAPIDescription, flags_ui::kOsIos,
962 FEATURE_VALUE_TYPE(web::features::kEnableFullscreenAPI)},
Joemer Ramos34175732022-02-14 18:59:16963 {"enable-enhanced-safe-browsing",
964 flag_descriptions::kEnhancedProtectionName,
965 flag_descriptions::kEnhancedProtectionDescription, flags_ui::kOsIos,
966 FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtection)},
Joemer Ramos26e2b512022-05-24 17:26:41967 {"enable-enhanced-safe-browsing-phase-2",
968 flag_descriptions::kEnhancedProtectionPhase2Name,
969 flag_descriptions::kEnhancedProtectionPhase2Description, flags_ui::kOsIos,
970 FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtectionPhase2IOS)},
Shivani Chauhanaf1eb74d2022-02-11 21:13:19971 {"autofill-enable-unmask-card-request-set-instrument-id",
972 flag_descriptions::kAutofillEnableUnmaskCardRequestSetInstrumentIdName,
973 flag_descriptions::
974 kAutofillEnableUnmaskCardRequestSetInstrumentIdDescription,
975 flags_ui::kOsIos,
976 FEATURE_VALUE_TYPE(
977 autofill::features::kAutofillEnableUnmaskCardRequestSetInstrumentId)},
Vishwas Uppoor89303a92022-08-03 00:56:26978 {"autofill-enable-card-product-name",
979 flag_descriptions::kAutofillEnableCardProductNameName,
980 flag_descriptions::kAutofillEnableCardProductNameDescription,
981 flags_ui::kOsIos,
982 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableCardProductName)},
Victor Hugo Vianna Silvaf0a44002022-02-16 10:38:00983 {"send-tab-to-self-signin-promo",
984 flag_descriptions::kSendTabToSelfSigninPromoName,
985 flag_descriptions::kSendTabToSelfSigninPromoDescription, flags_ui::kOsIos,
986 FEATURE_VALUE_TYPE(send_tab_to_self::kSendTabToSelfSigninPromo)},
Christian Xubd60c4b72022-03-22 15:25:01987 {"bubble-rich-iph", flag_descriptions::kBubbleRichIPHName,
988 flag_descriptions::kBubbleRichIPHDescription, flags_ui::kOsIos,
989 FEATURE_WITH_PARAMS_VALUE_TYPE(kBubbleRichIPH,
990 kBubbleRichIPHVariations,
991 "BubbleRichIPH")},
Siyu Anff02e742022-04-07 19:08:22992 {"autofill-enforce-delays-in-strike-database",
993 flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseName,
994 flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseDescription,
995 flags_ui::kOsIos,
996 FEATURE_VALUE_TYPE(
997 autofill::features::kAutofillEnforceDelaysInStrikeDatabase)},
Ewann4f260562022-04-11 13:37:19998 {"download-calendar", flag_descriptions::kDownloadCalendarName,
999 flag_descriptions::kDownloadCalendarDescription, flags_ui::kOsIos,
1000 FEATURE_VALUE_TYPE(kDownloadCalendar)},
Jared Saulb0473bd2022-04-20 00:03:411001 {"autofill-upstream-allow-additional-email-domains",
1002 flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsName,
1003 flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsDescription,
1004 flags_ui::kOsIos,
1005 FEATURE_VALUE_TYPE(
1006 autofill::features::kAutofillUpstreamAllowAdditionalEmailDomains)},
1007 {"autofill-upstream-allow-all-email-domains",
1008 flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsName,
1009 flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsDescription,
1010 flags_ui::kOsIos,
1011 FEATURE_VALUE_TYPE(
1012 autofill::features::kAutofillUpstreamAllowAllEmailDomains)},
Olivier Robinffe767c2022-04-21 13:13:231013 {"enable-tflite-language-detection",
1014 flag_descriptions::kTFLiteLanguageDetectionName,
1015 flag_descriptions::kTFLiteLanguageDetectionDescription, flags_ui::kOsIos,
1016 FEATURE_VALUE_TYPE(translate::kTFLiteLanguageDetectionEnabled)},
1017 {"optimization-guide-model-downloading",
1018 flag_descriptions::kOptimizationGuideModelDownloadingName,
1019 flag_descriptions::kOptimizationGuideModelDownloadingDescription,
1020 flags_ui::kOsIos,
1021 FEATURE_VALUE_TYPE(
1022 optimization_guide::features::kOptimizationGuideModelDownloading)},
1023 {"optimization-target-prediction",
1024 flag_descriptions::kOptimizationTargetPredictionName,
1025 flag_descriptions::kOptimizationTargetPredictionDescription,
1026 flags_ui::kOsIos,
1027 FEATURE_VALUE_TYPE(
1028 optimization_guide::features::kOptimizationTargetPrediction)},
Rushan Suleymanov727309602022-04-28 20:08:541029 {"sync-standalone-invalidations", flag_descriptions::kSyncInvalidationsName,
1030 flag_descriptions::kSyncInvalidationsDescription, flags_ui::kOsIos,
1031 FEATURE_VALUE_TYPE(::syncer::kUseSyncInvalidations)},
1032 {"sync-standalone-invalidations-wallet-and-offer",
1033 flag_descriptions::kSyncInvalidationsWalletAndOfferName,
1034 flag_descriptions::kSyncInvalidationsWalletAndOfferDescription,
1035 flags_ui::kOsIos,
1036 FEATURE_VALUE_TYPE(::syncer::kUseSyncInvalidationsForWalletAndOffer)},
Christian Xub8c06cd2022-04-29 20:55:011037 {"suggestions-scrolling-ipad",
1038 flag_descriptions::kEnableSuggestionsScrollingOnIPadName,
1039 flag_descriptions::kEnableSuggestionsScrollingOnIPadDescription,
1040 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableSuggestionsScrollingOnIPad)},
David Jean7a8fa702022-05-02 15:21:221041 {"experience-kit-calendar", flag_descriptions::kCalendarExperienceKitName,
1042 flag_descriptions::kCalendarExperienceKitDescription, flags_ui::kOsIos,
1043 FEATURE_VALUE_TYPE(kCalendarExperienceKit)},
Zhixiang Teoh82d17bb2022-06-16 21:00:391044 {"enable-expkit-calendar-text-classifier",
1045 flag_descriptions::kEnableExpKitCalendarTextClassifierName,
1046 flag_descriptions::kEnableExpKitCalendarTextClassifierDescription,
1047 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableExpKitCalendarTextClassifier)},
Elmehdi Rahmaoui9d4ce40c62022-08-05 15:31:181048 {"experience-kit-maps", flag_descriptions::kMapsExperienceKitName,
1049 flag_descriptions::kMapsExperienceKitDescription, flags_ui::kOsIos,
1050 FEATURE_VALUE_TYPE(kMapsExperienceKit)},
Mustafa Emre Acer4de8863a2022-05-03 22:17:011051 {"https-only-mode", flag_descriptions::kHttpsOnlyModeName,
1052 flag_descriptions::kHttpsOnlyModeDescription, flags_ui::kOsIos,
1053 FEATURE_VALUE_TYPE(security_interstitials::features::kHttpsOnlyMode)},
Mustafa Emre Acerb8bb01f2022-07-20 19:43:251054 {"omnibox-https-upgrades", flag_descriptions::kOmniboxHttpsUpgradesName,
1055 flag_descriptions::kOmniboxHttpsUpgradesDescription, flags_ui::kOsIos,
1056 FEATURE_VALUE_TYPE(omnibox::kDefaultTypedNavigationsToHttps)},
Benjamin Williams419c81e2022-05-04 18:33:221057 {"smart-sorting-new-overflow-menu",
1058 flag_descriptions::kSmartSortingNewOverflowMenuName,
1059 flag_descriptions::kSmartSortingNewOverflowMenuDescription,
1060 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSmartSortingNewOverflowMenu)},
Scott Yoder10493562022-06-28 17:37:441061 {"new-overflow-menu-share-chrome-action",
1062 flag_descriptions::kNewOverflowMenuShareChromeActionName,
1063 flag_descriptions::kNewOverflowMenuShareChromeActionDescription,
1064 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kNewOverflowMenuShareChromeAction)},
Alexander Tekled46a36982022-05-09 20:32:421065 {"autofill-enable-ranking-formula",
1066 flag_descriptions::kAutofillEnableRankingFormulaName,
1067 flag_descriptions::kAutofillEnableRankingFormulaDescription,
1068 flags_ui::kOsIos,
1069 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableRankingFormula)},
Siyu An4f658a92022-05-13 22:59:021070 {"autofill-remove-card-expiry-from-downstream-suggestion",
1071 flag_descriptions::kAutofillRemoveCardExpiryFromDownstreamSuggestionName,
1072 flag_descriptions::
1073 kAutofillRemoveCardExpiryFromDownstreamSuggestionDescription,
1074 flags_ui::kOsIos,
1075 FEATURE_VALUE_TYPE(autofill::features::
1076 kAutofillRemoveCardExpiryFromDownstreamSuggestion)},
Sergio Collazos58558712022-05-18 17:24:021077 {"enable-feed-ablation", flag_descriptions::kEnableFeedAblationName,
1078 flag_descriptions::kEnableFeedAblationDescription, flags_ui::kOsIos,
1079 FEATURE_VALUE_TYPE(kEnableFeedAblation)},
Chris Lu7f024ed2c2022-05-27 23:11:271080 {"content-suggestions-ui-module-refresh",
1081 flag_descriptions::kContentSuggestionsUIModuleRefreshName,
1082 flag_descriptions::kContentSuggestionsUIModuleRefreshDescription,
1083 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kContentSuggestionsUIModuleRefresh)},
Quentin Pubertd7546ae2022-05-30 14:28:571084 {"3p-intents-in-incognito", flag_descriptions::kIOS3PIntentsInIncognitoName,
1085 flag_descriptions::kIOS3PIntentsInIncognitoDescription, flags_ui::kOsIos,
1086 FEATURE_VALUE_TYPE(kIOS3PIntentsInIncognito)},
Olivier Robin058c1fad2022-05-31 18:24:061087 {"default-browser-intents-show-settings",
1088 flag_descriptions::kDefaultBrowserIntentsShowSettingsName,
1089 flag_descriptions::kDefaultBrowserIntentsShowSettingsDescription,
1090 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDefaultBrowserIntentsShowSettings)},
Ed Chin76b1b35e2022-06-08 23:01:171091 {"enable-discover-feed-ghost-cards",
1092 flag_descriptions::kEnableDiscoverFeedGhostCardsName,
1093 flag_descriptions::kEnableDiscoverFeedGhostCardsDescription,
1094 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDiscoverFeedGhostCardsEnabled)},
Gauthier Ambard30ad9ca2022-06-09 14:15:261095 {"bookmark-string-menu", flag_descriptions::kBookmarkStringName,
1096 flag_descriptions::kBookmarkStringDescription, flags_ui::kOsIos,
1097 FEATURE_WITH_PARAMS_VALUE_TYPE(kBookmarkString,
1098 kPopupMenuBookmarkStringVarations,
1099 "BookmarkString")},
Igor Ruvinova43a66dc2022-06-09 21:57:451100 {"dm-token-deletion", flag_descriptions::kDmTokenDeletionName,
1101 flag_descriptions::kDmTokenDeletionDescription, flags_ui::kOsIos,
Igor Ruvinov44fed9f2022-06-10 22:51:421102 FEATURE_WITH_PARAMS_VALUE_TYPE(policy::features::kDmTokenDeletion,
1103 kDmTokenDeletionVariation,
1104 "DmTokenDeletion")},
Tommy Martinoad42be52022-06-13 11:51:191105 {"ios-password-ui-split", flag_descriptions::kIOSPasswordUISplitName,
1106 flag_descriptions::kIOSPasswordUISplitDescription, flags_ui::kOsIos,
1107 FEATURE_VALUE_TYPE(password_manager::features::kIOSPasswordUISplit)},
Theodor-Stefan Cristea6d087b82022-07-26 15:25:291108 {"ios-password-manager-cross-origin-iframe-support",
1109 flag_descriptions::kIOSPasswordManagerCrossOriginIframeSupportName,
1110 flag_descriptions::kIOSPasswordManagerCrossOriginIframeSupportDescription,
1111 flags_ui::kOsIos,
1112 FEATURE_VALUE_TYPE(password_manager::features::
1113 kIOSPasswordManagerCrossOriginIframeSupport)},
Christian Xud105a1352022-06-17 19:54:141114 {"omnibox-adaptive-suggestions-count",
1115 flag_descriptions::kAdaptiveSuggestionsCountName,
1116 flag_descriptions::kAdaptiveSuggestionsCountDescription, flags_ui::kOsIos,
1117 FEATURE_VALUE_TYPE(omnibox::kAdaptiveSuggestionsCount)},
Chris Lu2fd473f2022-06-28 13:38:201118 {"trending-queries-module", flag_descriptions::kTrendingQueriesModuleName,
1119 flag_descriptions::kTrendingQueriesModuleDescription, flags_ui::kOsIos,
Chris Luc9a5cb12022-07-20 16:11:391120 FEATURE_WITH_PARAMS_VALUE_TYPE(kTrendingQueriesModule,
1121 kTrendingQueriesModuleVariations,
Chris Lu438e1c052022-08-17 02:57:001122 kTrendingQueriesFieldTrialName)},
Nakul Vaidyaddfdfbc2022-06-28 23:43:321123 {"autofill-parse-iban-fields",
Nakul Vaidya876210f2022-08-08 17:47:191124 flag_descriptions::kAutofillParseIBANFieldsName,
1125 flag_descriptions::kAutofillParseIBANFieldsDescription, flags_ui::kOsIos,
1126 FEATURE_VALUE_TYPE(autofill::features::kAutofillParseIBANFields)},
Ernesto Izquierdo Clua7f4e36e22022-07-01 09:38:361127 {"autofill-enable-new-card-unmask-prompt-view",
1128 flag_descriptions::kAutofillEnableNewCardUnmaskPromptViewName,
1129 flag_descriptions::kAutofillEnableNewCardUnmaskPromptViewDescription,
1130 flags_ui::kOsIos,
1131 FEATURE_VALUE_TYPE(kAutofillEnableNewCardUnmaskPromptView)},
Christian Xubdedabec2022-07-04 10:00:131132 {"omnibox-paste-button", flag_descriptions::kOmniboxPasteButtonName,
1133 flag_descriptions::kOmniboxPasteButtonDescription, flags_ui::kOsIos,
1134 FEATURE_WITH_PARAMS_VALUE_TYPE(kOmniboxPasteButton,
1135 kOmniboxPasteButtonVariations,
1136 "OmniboxPasteButton")},
Moe Ahmadi098519d82022-07-27 18:34:241137 {"omnibox-zero-suggest-prefetching",
1138 flag_descriptions::kOmniboxZeroSuggestPrefetchingName,
1139 flag_descriptions::kOmniboxZeroSuggestPrefetchingDescription,
1140 flags_ui::kOsIos, FEATURE_VALUE_TYPE(omnibox::kZeroSuggestPrefetching)},
Vincent Boissellead6cbe22022-07-04 19:32:391141 {"enable-user-policy", flag_descriptions::kEnableUserPolicyName,
1142 flag_descriptions::kEnableUserPolicyDescription, flags_ui::kOsIos,
1143 SINGLE_VALUE_TYPE(policy::kEnableUserPolicy)},
Marc Treibb9d8ed802022-07-05 15:15:491144 {"enable-sync-history-datatype",
1145 flag_descriptions::kSyncEnableHistoryDataTypeName,
1146 flag_descriptions::kSyncEnableHistoryDataTypeDescription, flags_ui::kOsIos,
1147 FEATURE_VALUE_TYPE(syncer::kSyncEnableHistoryDataType)},
Christian Xucf26d562022-07-06 09:28:361148 {"omnibox-max-url-matches", flag_descriptions::kOmniboxMaxURLMatchesName,
1149 flag_descriptions::kOmniboxMaxURLMatchesDescription, flags_ui::kOsIos,
1150 FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kOmniboxMaxURLMatches,
1151 kOmniboxMaxURLMatchesVariations,
1152 "OmniboxMaxURLMatches")},
Olivier Robin60d3a062022-07-06 17:34:061153 {"metrickit-non-crash-reports",
1154 flag_descriptions::kMetrickitNonCrashReportName,
1155 flag_descriptions::kMetrickitNonCrashReportDescription, flags_ui::kOsIos,
1156 FEATURE_VALUE_TYPE(kMetrickitNonCrashReport)},
Siyu An3194bda2022-07-13 19:30:371157 {"autofill-enable-remade-downstream-metrics",
1158 flag_descriptions::kAutofillEnableRemadeDownstreamMetricsName,
1159 flag_descriptions::kAutofillEnableRemadeDownstreamMetricsDescription,
1160 flags_ui::kOsIos,
1161 FEATURE_VALUE_TYPE(
1162 autofill::features::kAutofillEnableRemadeDownstreamMetrics)},
Nakul Vaidya13ca2042022-07-27 01:59:551163 {"autofill-parse-vcn-card-on-file-standalone-cvc-fields",
1164 flag_descriptions::kAutofillParseVcnCardOnFileStandaloneCvcFieldsName,
1165 flag_descriptions::
1166 kAutofillParseVcnCardOnFileStandaloneCvcFieldsDescription,
1167 flags_ui::kOsIos,
1168 FEATURE_VALUE_TYPE(
1169 autofill::features::kAutofillParseVcnCardOnFileStandaloneCvcFields)},
Ed Chin91e44992022-07-27 13:42:341170#if BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
1171 {"feed-background-refresh-ios",
1172 flag_descriptions::kFeedBackgroundRefreshName,
1173 flag_descriptions::kFeedBackgroundRefreshDescription, flags_ui::kOsIos,
1174 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFeedBackgroundRefresh,
1175 kFeedBackgroundRefreshVariations,
1176 "FeedBackgroundRefresh")},
Christian Xu164a2e512022-08-01 20:38:191177 {"omnibox-keyboard-paste-button",
1178 flag_descriptions::kOmniboxKeyboardPasteButtonName,
1179 flag_descriptions::kOmniboxKeyboardPasteButtonDescription,
1180 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kOmniboxKeyboardPasteButton)},
Ed Chin91e44992022-07-27 13:42:341181#endif // BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
Arthur Milchiorcf4877e2022-07-29 14:23:411182 {"enable-cbd-sign-out", flag_descriptions::kEnableCBDSignOutName,
1183 flag_descriptions::kEnableCBDSignOutDescription, flags_ui::kOsIos,
Arthur Milchiord36e2502022-08-11 16:10:111184 FEATURE_VALUE_TYPE(switches::kEnableCbdSignOut)},
Sylvain Defresne1619dd002021-11-06 10:09:481185};
sdefresne14900ee2015-11-27 14:43:211186
Rohit Raobed794c2020-04-27 15:27:451187bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
1188 return false;
1189}
1190
1191flags_ui::FlagsState& GetGlobalFlagsState() {
1192 static base::NoDestructor<flags_ui::FlagsState> flags_state(kFeatureEntries,
1193 nullptr);
1194 return *flags_state;
1195}
David Jean5ca263c2021-08-18 09:19:301196// Creates the experimental test policies map, used by AsyncPolicyLoader and
1197// PolicyLoaderIOS to locally enable policies.
Vincent Boisselleed0e6f1a2021-11-09 06:47:341198NSMutableDictionary* CreateExperimentalTestingPolicies() {
sdefresne14900ee2015-11-27 14:43:211199 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1200
Guillaume Jenkins25e9bd72020-08-27 17:39:061201 // Shared variables for all enterprise experimental flags.
Guillaume Jenkins57606d72020-08-13 17:32:551202 NSMutableDictionary* testing_policies = [[NSMutableDictionary alloc] init];
Guillaume Jenkins25e9bd72020-08-27 17:39:061203 NSMutableArray* allowed_experimental_policies = [[NSMutableArray alloc] init];
Guillaume Jenkins57606d72020-08-13 17:32:551204
Guillaume Jenkins25e9bd72020-08-27 17:39:061205 // Set some sample policy values for testing if EnableSamplePolicies is set to
1206 // true.
Guillaume Jenkinseeb7007c2020-06-25 22:55:401207 if ([defaults boolForKey:@"EnableSamplePolicies"]) {
Guillaume Jenkins57606d72020-08-13 17:32:551208 [testing_policies addEntriesFromDictionary:@{
Tina Wang59d0b7e2020-08-11 04:41:011209 base::SysUTF8ToNSString(policy::key::kAutofillAddressEnabled) : @NO,
1210
Guillaume Jenkinseeb7007c2020-06-25 22:55:401211 base::SysUTF8ToNSString(policy::key::kAutofillCreditCardEnabled) : @NO,
1212
1213 // 2 = Disable all variations
1214 base::SysUTF8ToNSString(policy::key::kChromeVariations) : @2,
1215
1216 // 2 = Do not allow any site to show popups
1217 base::SysUTF8ToNSString(policy::key::kDefaultPopupsSetting) : @2,
1218
Tina Wang5abee802020-07-29 23:09:521219 // Set default search engine.
1220 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderEnabled) :
1221 @YES,
1222 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderSearchURL) :
1223 @"http://www.google.com/search?q={searchTerms}",
1224 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderName) :
Tina Wang7cd0a062020-09-15 21:31:021225 @"TestEngine",
Tina Wang5abee802020-07-29 23:09:521226
Tina Wang89068c82020-10-29 15:51:501227 base::SysUTF8ToNSString(policy::key::kEditBookmarksEnabled) : @NO,
1228
Gauthier Ambard21b23702021-04-16 16:11:271229 base::SysUTF8ToNSString(policy::key::kNTPContentSuggestionsEnabled) : @NO,
1230
Guillaume Jenkinseeb7007c2020-06-25 22:55:401231 base::SysUTF8ToNSString(policy::key::kPasswordManagerEnabled) : @NO,
Tina Wang59d0b7e2020-08-11 04:41:011232
1233 base::SysUTF8ToNSString(policy::key::kTranslateEnabled) : @NO,
Tina Wang54dddfc22020-08-20 22:34:531234
1235 // 2 = Enhanced safe browsing protection
1236 base::SysUTF8ToNSString(policy::key::kSafeBrowsingProtectionLevel) : @2,
1237
1238 base::SysUTF8ToNSString(policy::key::kSearchSuggestEnabled) : @YES,
Guillaume Jenkins57606d72020-08-13 17:32:551239 }];
1240 }
1241
Ewann227a3c02021-04-19 12:04:541242 if ([defaults boolForKey:@"EnableSyncDisabledPolicy"]) {
Guillaume Jenkinsfe46d3a2021-04-26 19:51:041243 NSString* sync_policy_key =
1244 base::SysUTF8ToNSString(policy::key::kSyncDisabled);
David Jean5ca263c2021-08-18 09:19:301245 [testing_policies addEntriesFromDictionary:@{sync_policy_key : @YES}];
Ewann227a3c02021-04-19 12:04:541246 }
Ewann227a3c02021-04-19 12:04:541247
Ewann570a6302021-08-17 07:22:421248 // SyncTypesListDisabled policy.
1249 NSString* Sync_types_list_disabled_key =
1250 base::SysUTF8ToNSString(policy::key::kSyncTypesListDisabled);
1251 NSMutableArray* Sync_types_list_disabled_values =
1252 [[NSMutableArray alloc] init];
1253 if ([defaults boolForKey:@"SyncTypesListBookmarks"]) {
1254 [Sync_types_list_disabled_values addObject:@"bookmarks"];
1255 }
1256 if ([defaults boolForKey:@"SyncTypesListReadingList"]) {
1257 [Sync_types_list_disabled_values addObject:@"readingList"];
1258 }
1259 if ([defaults boolForKey:@"SyncTypesListPreferences"]) {
1260 [Sync_types_list_disabled_values addObject:@"preferences"];
1261 }
1262 if ([defaults boolForKey:@"SyncTypesListPasswords"]) {
1263 [Sync_types_list_disabled_values addObject:@"passwords"];
1264 }
1265 if ([defaults boolForKey:@"SyncTypesListAutofill"]) {
1266 [Sync_types_list_disabled_values addObject:@"autofill"];
1267 }
1268 if ([defaults boolForKey:@"SyncTypesListTypedUrls"]) {
1269 [Sync_types_list_disabled_values addObject:@"typedUrls"];
1270 }
1271 if ([defaults boolForKey:@"SyncTypesListTabs"]) {
1272 [Sync_types_list_disabled_values addObject:@"tabs"];
1273 }
1274 if ([Sync_types_list_disabled_values count]) {
1275 [testing_policies addEntriesFromDictionary:@{
1276 Sync_types_list_disabled_key : Sync_types_list_disabled_values
1277 }];
Ewann570a6302021-08-17 07:22:421278 }
1279
Gauthier Ambard073eaa92021-11-22 15:24:131280 // If an incognito mode availability is set, set the value.
Tina Wangc6bcf572021-01-27 18:15:521281 NSString* incognito_policy_key =
1282 base::SysUTF8ToNSString(policy::key::kIncognitoModeAvailability);
1283 NSInteger incognito_mode_availability =
1284 [defaults integerForKey:incognito_policy_key];
1285 if (incognito_mode_availability) {
Tina Wangc6bcf572021-01-27 18:15:521286 [testing_policies addEntriesFromDictionary:@{
1287 incognito_policy_key : @(incognito_mode_availability),
1288 }];
1289 }
1290
Ewann40a8f8a2021-07-29 10:01:201291 NSString* restriction_pattern =
1292 [defaults stringForKey:@"RestrictAccountsToPatterns"];
1293 if ([restriction_pattern length] > 0) {
Ewannb3bee382021-08-16 09:12:291294 NSString* restrict_key =
1295 base::SysUTF8ToNSString(policy::key::kRestrictAccountsToPatterns);
Ewann40a8f8a2021-07-29 10:01:201296 [testing_policies addEntriesFromDictionary:@{
Ewannb3bee382021-08-16 09:12:291297 restrict_key : @[ restriction_pattern ]
Ewann40a8f8a2021-07-29 10:01:201298 }];
1299 }
1300
Vincent Boisselle19200bc2021-09-01 17:58:251301 // If the sign-in policy is set (not "None"), add the policy key to the list
1302 // of enabled experimental policies, and set the value.
1303 NSString* const kSigninPolicyKey = @"BrowserSignin";
1304 NSInteger signin_policy_mode = [defaults integerForKey:kSigninPolicyKey];
1305 if (signin_policy_mode) {
1306 // Remove the mode offset that was used to represent the unset policy.
1307 --signin_policy_mode;
1308 DCHECK(signin_policy_mode >= 0);
1309
Vincent Boisselle19200bc2021-09-01 17:58:251310 [testing_policies addEntriesFromDictionary:@{
1311 kSigninPolicyKey : @(signin_policy_mode),
1312 }];
1313 }
1314
Veronique Nguyen9b1044f2022-01-11 14:41:131315 // If the New Tab Page URL is set (not empty) add the value to the list of
1316 // test policies.
1317 NSString* ntp_location = [defaults stringForKey:@"NTPLocation"];
1318 if ([ntp_location length] > 0) {
1319 NSString* ntp_location_key =
1320 base::SysUTF8ToNSString(policy::key::kNewTabPageLocation);
1321 [testing_policies
1322 addEntriesFromDictionary:@{ntp_location_key : ntp_location}];
Veronique Nguyen302d8702022-01-12 21:18:571323 [allowed_experimental_policies addObject:ntp_location_key];
Veronique Nguyen9b1044f2022-01-11 14:41:131324 }
1325
Ali Juma9ec36d22022-03-28 14:53:121326 if ([defaults boolForKey:@"DisallowChromeDataInBackups"]) {
1327 NSString* allow_backups_key =
1328 base::SysUTF8ToNSString(policy::key::kAllowChromeDataInBackups);
1329 [testing_policies addEntriesFromDictionary:@{allow_backups_key : @NO}];
1330 [allowed_experimental_policies addObject:allow_backups_key];
1331 }
1332
Guillaume Jenkins25e9bd72020-08-27 17:39:061333 // If any experimental policy was allowed, set the EnableExperimentalPolicies
1334 // policy.
1335 if ([allowed_experimental_policies count] > 0) {
1336 [testing_policies setValue:allowed_experimental_policies
1337 forKey:base::SysUTF8ToNSString(
1338 policy::key::kEnableExperimentalPolicies)];
1339 }
1340
jlebel2eb40222022-05-06 11:15:421341 NSString* metrics_reporting_key = @"MetricsReportingEnabled";
1342 switch ([defaults integerForKey:metrics_reporting_key]) {
1343 case 1:
1344 // Metrics reporting forced.
1345 [testing_policies setValue:@(YES) forKey:metrics_reporting_key];
1346 break;
1347 case 2:
1348 // Metrics reporting disabled.
1349 [testing_policies setValue:@(NO) forKey:metrics_reporting_key];
1350 break;
1351 default:
1352 // Metrics reporting not managed.
1353 break;
1354 }
1355
David Jean6f85d44f2021-08-19 08:08:451356 // Warning: Add new flags to TestingPoliciesHash() below.
1357
David Jean5ca263c2021-08-18 09:19:301358 return testing_policies;
1359}
David Jean6f85d44f2021-08-19 08:08:451360
1361// Generates a unique NSString based on currently monitored policies from
1362// NSUserDefaults standardUserDefaults.
1363NSString* TestingPoliciesHash() {
1364 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1365 return [NSString
jlebel2eb40222022-05-06 11:15:421366 stringWithFormat:@"%d|%d|%d|%d|%@|%d|%d|%d|%d|%d|%d|%d|%d|%@|%d",
Ali Juma9ec36d22022-03-28 14:53:121367 [defaults boolForKey:@"DisallowChromeDataInBackups"],
David Jean6f85d44f2021-08-19 08:08:451368 [defaults boolForKey:@"EnableSyncDisabledPolicy"],
1369 [defaults boolForKey:@"EnableSamplePolicies"],
jlebel2eb40222022-05-06 11:15:421370 static_cast<int>([defaults
1371 integerForKey:@"IncognitoModeAvailability"]),
David Jean6f85d44f2021-08-19 08:08:451372 [defaults stringForKey:@"RestrictAccountsToPatterns"],
1373 [defaults boolForKey:@"SyncTypesListBookmarks"],
1374 [defaults boolForKey:@"SyncTypesListReadingList"],
1375 [defaults boolForKey:@"SyncTypesListPreferences"],
1376 [defaults boolForKey:@"SyncTypesListPasswords"],
1377 [defaults boolForKey:@"SyncTypesListAutofill"],
1378 [defaults boolForKey:@"SyncTypesListTypedUrls"],
jlebel2eb40222022-05-06 11:15:421379 [defaults boolForKey:@"SyncTypesListTabs"],
1380 static_cast<int>(
1381 [defaults integerForKey:@"BrowserSignin"]),
1382 [defaults stringForKey:@"NTPLocation"],
1383 static_cast<int>([defaults
1384 integerForKey:@"MetricsReportingEnabled"])];
David Jean6f85d44f2021-08-19 08:08:451385}
David Jean5ca263c2021-08-18 09:19:301386} // namespace
1387
1388// Add all switches from experimental flags to |command_line|.
1389void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) {
1390 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1391
1392 // Set the UA flag if UseMobileSafariUA is enabled.
1393 if ([defaults boolForKey:@"UseMobileSafariUA"]) {
1394 // Safari uses "Vesion/", followed by the OS version excluding bugfix, where
1395 // Chrome puts its product token.
1396 int32_t major = 0;
1397 int32_t minor = 0;
1398 int32_t bugfix = 0;
1399 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix);
1400 std::string product = base::StringPrintf("Version/%d.%d", major, minor);
1401
1402 command_line->AppendSwitchASCII(switches::kUserAgent,
1403 web::BuildMobileUserAgent(product));
1404 }
1405
1406 // Shared variables for all enterprise experimental flags.
Vincent Boisselleed0e6f1a2021-11-09 06:47:341407 NSMutableDictionary* testing_policies = CreateExperimentalTestingPolicies();
David Jean5ca263c2021-08-18 09:19:301408
1409 // If a CBCM enrollment token is provided, force Chrome Browser Cloud
1410 // Management to enabled and add the token to the list of policies.
1411 NSString* token_key =
1412 base::SysUTF8ToNSString(policy::key::kCloudManagementEnrollmentToken);
1413 NSString* token = [defaults stringForKey:token_key];
1414
1415 if ([token length] > 0) {
1416 command_line->AppendSwitch(switches::kEnableChromeBrowserCloudManagement);
1417 [testing_policies setValue:token forKey:token_key];
1418 }
1419
Vincent Boisselled042d552022-04-09 01:22:591420 if ([defaults boolForKey:@"EnableUserPolicy"]) {
1421 policy::EnableUserPolicy();
1422 }
1423
Guillaume Jenkins57606d72020-08-13 17:32:551424 // If some policies were set, commit them to the app's registration defaults.
1425 if ([testing_policies count] > 0) {
Guillaume Jenkinseeb7007c2020-06-25 22:55:401426 NSDictionary* registration_defaults =
1427 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
1428 [defaults registerDefaults:registration_defaults];
1429 }
1430
sdefresne14900ee2015-11-27 14:43:211431 // Freeform commandline flags. These are added last, so that any flags added
1432 // earlier in this function take precedence.
1433 if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) {
1434 base::CommandLine::StringVector flags;
1435 // Append an empty "program" argument.
1436 flags.push_back("");
1437
1438 // The number of flags corresponds to the number of text fields in
1439 // Experimental.plist.
1440 const int kNumFreeformFlags = 5;
1441 for (int i = 1; i <= kNumFreeformFlags; ++i) {
1442 NSString* key =
1443 [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i];
1444 NSString* flag = [defaults stringForKey:key];
1445 if ([flag length]) {
Robbie Gibsonc91ce622019-05-20 14:44:331446 // iOS keyboard replaces -- with —, so undo that.
1447 flag = [flag stringByReplacingOccurrencesOfString:@"—"
1448 withString:@"--"
1449 options:0
1450 range:NSMakeRange(0, 1)];
1451 // To make things easier, allow flags with no dashes by prepending them
1452 // here. This also allows for flags that just have one dash if they
1453 // exist.
1454 if (![flag hasPrefix:@"-"]) {
1455 flag = [@"--" stringByAppendingString:flag];
1456 }
sdefresne14900ee2015-11-27 14:43:211457 flags.push_back(base::SysNSStringToUTF8(flag));
1458 }
1459 }
1460
1461 base::CommandLine temp_command_line(flags);
1462 command_line->AppendArguments(temp_command_line, false);
1463 }
msardafc76f662017-02-24 12:46:281464
justincohendacc85d2017-06-28 23:34:101465 // Populate command line flag for 3rd party keyboard omnibox workaround.
1466 NSString* enableThirdPartyKeyboardWorkaround =
1467 [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"];
1468 if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) {
1469 command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround);
1470 } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) {
1471 command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround);
1472 }
1473
Sylvain Defresned3cd8d92022-01-18 13:35:081474 ios::provider::AppendSwitchesFromExperimentalSettings(defaults, command_line);
sdefresne14900ee2015-11-27 14:43:211475}
1476
David Jean5ca263c2021-08-18 09:19:301477void MonitorExperimentalSettingsChanges() {
David Jean5ca263c2021-08-18 09:19:301478 // Startup values for settings to be observed.
David Jean6f85d44f2021-08-19 08:08:451479 __block NSString* hash = TestingPoliciesHash();
David Jeane83ed652021-08-25 14:52:481480 static std::atomic_bool pending_check(false);
David Jean5ca263c2021-08-18 09:19:301481
1482 auto monitor = ^(NSNotification* notification) {
David Jeane83ed652021-08-25 14:52:481483 bool has_pending_check = pending_check.exchange(true);
1484 if (has_pending_check)
1485 return;
1486
David Jeanbc0fae32021-08-25 10:31:391487 // Can be called from any thread from where the notification was sent,
1488 // but since it may change standardUserDefaults, and that has to be on main
1489 // thread, dispatch to main thread.
1490 dispatch_async(dispatch_get_main_queue(), ^{
1491 // Check if observed settings have changed. Since source and destination
1492 // are both user defaults, this is required to avoid cycling back here.
1493 NSString* newHash = TestingPoliciesHash();
1494 if (![newHash isEqualToString:hash]) {
1495 hash = newHash;
David Jean5ca263c2021-08-18 09:19:301496
David Jeanbc0fae32021-08-25 10:31:391497 // Publish update.
1498 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1499 NSMutableDictionary* testing_policies =
Vincent Boisselleed0e6f1a2021-11-09 06:47:341500 CreateExperimentalTestingPolicies();
David Jeanbc0fae32021-08-25 10:31:391501 NSDictionary* registration_defaults =
1502 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
1503 [defaults registerDefaults:registration_defaults];
1504 }
David Jeane83ed652021-08-25 14:52:481505
1506 pending_check.store(false);
David Jeanbc0fae32021-08-25 10:31:391507 });
David Jean5ca263c2021-08-18 09:19:301508 };
1509
1510 NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
1511 [center addObserverForName:NSUserDefaultsDidChangeNotification
1512 object:nil
David Jeanbc0fae32021-08-25 10:31:391513 queue:nil
David Jean5ca263c2021-08-18 09:19:301514 usingBlock:monitor];
1515}
1516
sdefresne14900ee2015-11-27 14:43:211517void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage,
1518 base::CommandLine* command_line) {
Sylvain Defresne8327a2f2019-01-17 14:19:181519 GetGlobalFlagsState().ConvertFlagsToSwitches(
sdefresnec9763902015-12-02 10:30:111520 flags_storage, command_line, flags_ui::kAddSentinels,
Gregory Chatzinofff6523722017-11-21 01:33:531521 switches::kEnableFeatures, switches::kDisableFeatures);
sdefresne14900ee2015-11-27 14:43:211522}
1523
jkrcalbf073372016-07-29 07:21:311524std::vector<std::string> RegisterAllFeatureVariationParameters(
1525 flags_ui::FlagsStorage* flags_storage,
1526 base::FeatureList* feature_list) {
Justin Cohen2e2adb52019-10-25 17:00:021527 // Occasionally DCHECK crashes on canary can be very distuptive. An
1528 // experimental flag was added to aid in temporarily disabling this for
1529 // canary testers.
Peter Boström3f798572022-07-26 23:44:361530#if BUILDFLAG(DCHECK_IS_CONFIGURABLE)
Justin Cohen2e2adb52019-10-25 17:00:021531 if (experimental_flags::AreDCHECKCrashesDisabled()) {
1532 std::vector<base::FeatureList::FeatureOverrideInfo> overrides;
1533 overrides.push_back(
1534 {std::cref(base::kDCheckIsFatalFeature),
1535 base::FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE});
1536 feature_list->RegisterExtraFeatureOverrides(std::move(overrides));
1537 }
Peter Boström3f798572022-07-26 23:44:361538#endif // BUILDFLAG(DCHECK_IS_CONFIGURABLE)
Justin Cohen2e2adb52019-10-25 17:00:021539
Sylvain Defresne8327a2f2019-01-17 14:19:181540 return GetGlobalFlagsState().RegisterAllFeatureVariationParameters(
1541 flags_storage, feature_list);
jkrcalbf073372016-07-29 07:21:311542}
1543
sdefresne14900ee2015-11-27 14:43:211544void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage,
1545 flags_ui::FlagAccess access,
Matt Menke4d777572022-06-15 15:55:501546 base::Value::List& supported_entries,
1547 base::Value::List& unsupported_entries) {
Sylvain Defresne8327a2f2019-01-17 14:19:181548 GetGlobalFlagsState().GetFlagFeatureEntries(
sdefresne14900ee2015-11-27 14:43:211549 flags_storage, access, supported_entries, unsupported_entries,
Renjie Tang208c8192020-11-03 00:46:511550 base::BindRepeating(&SkipConditionalFeatureEntry));
sdefresne14900ee2015-11-27 14:43:211551}
1552
1553void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage,
1554 const std::string& internal_name,
1555 bool enable) {
Sylvain Defresne8327a2f2019-01-17 14:19:181556 GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name,
1557 enable);
sdefresne14900ee2015-11-27 14:43:211558}
1559
1560void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) {
Sylvain Defresne8327a2f2019-01-17 14:19:181561 GetGlobalFlagsState().ResetAllFlags(flags_storage);
sdefresne14900ee2015-11-27 14:43:211562}
1563
1564namespace testing {
1565
Elly Fong-Jones323ab1092021-08-23 22:36:311566base::span<const flags_ui::FeatureEntry> GetFeatureEntries() {
1567 return base::span<const flags_ui::FeatureEntry>(kFeatureEntries,
Daniel Cheng1f047a82022-02-26 10:04:531568 std::size(kFeatureEntries));
sdefresne14900ee2015-11-27 14:43:211569}
1570
1571} // namespace testing