blob: c1ae8b639573bfb6f1728384431d2391bc11d3ac [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"
sdefresne14900ee2015-11-27 14:43:2118#include "base/command_line.h"
Sylvain Defresne8327a2f2019-01-17 14:19:1819#include "base/no_destructor.h"
kokihoon189a4022018-10-13 02:43:4420#include "base/stl_util.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"
Robbie Gibson5e3436632020-04-27 15:48:0428#include "components/content_settings/core/common/features.h"
sdefresne14900ee2015-11-27 14:43:2129#include "components/dom_distiller/core/dom_distiller_switches.h"
Guillaume Jenkins4e6ac1e2020-11-11 16:57:4030#include "components/enterprise/browser/enterprise_switches.h"
Tommy Nyquistc1d6dea12017-07-26 20:37:2331#include "components/feature_engagement/public/feature_constants.h"
32#include "components/feature_engagement/public/feature_list.h"
sdefresne14900ee2015-11-27 14:43:2133#include "components/flags_ui/feature_entry.h"
34#include "components/flags_ui/feature_entry_macros.h"
35#include "components/flags_ui/flags_storage.h"
36#include "components/flags_ui/flags_ui_switches.h"
sczs27e389e2020-01-15 15:19:1837#include "components/infobars/core/infobar_feature.h"
Tanja Gornakb0985dd2018-10-11 17:24:4038#include "components/invalidation/impl/invalidation_switches.h"
noyau4cfb1332016-10-25 17:05:4239#include "components/ntp_tiles/switches.h"
Justin Donnelly33d712e2017-08-23 21:32:5140#include "components/omnibox/browser/omnibox_field_trial.h"
Tomasz Wiszkowskid938a1112019-03-06 18:01:5741#include "components/omnibox/common/omnibox_features.h"
Ioana Pandeled14ce9e2017-11-28 14:41:4642#include "components/password_manager/core/common/password_manager_features.h"
mathp9b4c11d2017-07-06 20:24:1343#include "components/payments/core/features.h"
Guillaume Jenkinseeb7007c2020-06-25 22:55:4044#import "components/policy/core/common/policy_loader_ios_constants.h"
45#include "components/policy/policy_constants.h"
Emily Starkbafa9062017-12-27 15:22:4646#include "components/security_state/core/features.h"
Sébastien Séguin-Gagnondcb854b2019-04-10 16:36:4447#include "components/send_tab_to_self/features.h"
Tommy Martino0caf3362021-01-13 20:29:5848#include "components/shared_highlighting/core/common/shared_highlighting_features.h"
Valeriya Sinevicha79dc612018-09-25 14:49:0949#include "components/signin/core/browser/account_reconcilor.h"
Jérôme Lebelc374fdd2019-09-27 10:36:4850#include "components/signin/ios/browser/features.h"
Nohemi Fernandez983d6d52020-09-09 09:46:1951#include "components/signin/public/base/account_consistency_method.h"
Colin Blundell3517170e2019-07-11 08:16:3452#include "components/signin/public/base/signin_switches.h"
sdefresne36579782016-02-05 11:08:2553#include "components/strings/grit/components_strings.h"
Rushan Suleymanov988ad372020-07-26 19:10:0854#include "components/sync/base/sync_base_switches.h"
Moe Ahmadid6d5d172018-06-20 17:20:2355#include "components/sync/driver/sync_driver_switches.h"
Moe Ahmadie4cce1f2018-12-18 23:48:0156#include "components/translate/core/browser/translate_prefs.h"
Chris Lu0683adf2019-02-26 15:56:4557#include "components/ukm/ios/features.h"
Sylvain Defresneae6987e2018-03-01 13:21:4058#include "ios/chrome/browser/browsing_data/browsing_data_features.h"
sdefresne14900ee2015-11-27 14:43:2159#include "ios/chrome/browser/chrome_switches.h"
Mike Doughertyb6c770d2019-09-13 22:56:4660#include "ios/chrome/browser/crash_report/breadcrumbs/features.h"
Eugene But2823dc7e2020-07-21 18:10:3761#include "ios/chrome/browser/crash_report/features.h"
Nazerke21bdc45a2019-07-11 09:02:0562#include "ios/chrome/browser/flags/ios_chrome_flag_descriptions.h"
Ewann163e3952020-08-21 12:34:4963#import "ios/chrome/browser/open_in/features.h"
edchin68696842020-04-09 17:19:3164#include "ios/chrome/browser/policy/policy_features.h"
Sylvain Defresne9c107082020-10-27 16:39:1365#include "ios/chrome/browser/screen_time/screen_time_buildflags.h"
Gauthier Ambard33e03302019-02-21 13:28:5866#include "ios/chrome/browser/system_flags.h"
adamta22a4d502020-05-21 03:12:2167#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h"
Kurt Horimoto4da682b022018-04-12 07:43:3568#import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h"
sczs80a6f462018-12-05 20:37:1869#import "ios/chrome/browser/ui/infobars/infobar_feature.h"
adamta273568472020-12-04 23:53:5770#import "ios/chrome/browser/ui/ntp/new_tab_page_feature.h"
gogerald0ff29e52021-02-03 18:56:1971#import "ios/chrome/browser/ui/start_surface/start_surface_features.h"
Nazerke0bf10c42020-11-12 11:17:3272#import "ios/chrome/browser/ui/tab_switcher/tab_grid/features.h"
sczs76b9ba02019-07-23 23:34:3073#import "ios/chrome/browser/ui/table_view/feature_flags.h"
Kurt Horimoto79d590b2018-09-12 19:09:2874#import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h"
Justin Cohen2d81c582018-01-22 14:46:4475#include "ios/chrome/browser/ui/ui_feature_flags.h"
Yi Su392b3032018-06-05 07:26:4776#include "ios/chrome/browser/web/features.h"
sdefresne14900ee2015-11-27 14:43:2177#include "ios/chrome/grit/ios_strings.h"
msardafc76f662017-02-24 12:46:2878#include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
Eugene But61818bc2019-04-15 21:04:0779#include "ios/web/common/features.h"
Eugene Bute79f2742019-07-26 17:07:2280#include "ios/web/common/user_agent.h"
Eugene Butb1416232019-07-22 17:31:5881#include "ios/web/common/web_view_creation_util.h"
sdefresne14900ee2015-11-27 14:43:2182
Sylvain Defresne9c107082020-10-27 16:39:1383#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
84#include "ios/chrome/browser/screen_time/features.h"
85#endif
86
sdefresne14900ee2015-11-27 14:43:2187#if !defined(OFFICIAL_BUILD)
88#include "components/variations/variations_switches.h"
vitaliii489217aa2017-01-30 14:50:2289#endif
stkhapuginc1be1792016-12-13 14:30:5390
91#if !defined(__has_feature) || !__has_feature(objc_arc)
92#error "This file requires ARC support."
93#endif
sdefresne14900ee2015-11-27 14:43:2194
elawrence816f6790e2017-06-16 18:19:2895using flags_ui::FeatureEntry;
96
sdefresne14900ee2015-11-27 14:43:2197namespace {
Emily Starkbafa9062017-12-27 15:22:4698
Olivier Robin3d60411622018-02-23 10:03:2299const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = {
100 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
101 {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"},
102 {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"},
103 {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"},
104 {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"},
105 {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"},
106 {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"},
107 {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"},
108 {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"},
109};
110
Nohemi Fernandez222d6d42020-09-30 20:35:57111const FeatureEntry::Choice kDelayThresholdMinutesToUpdateGaiaCookieChoices[] = {
112 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
113 {"0", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "0"},
114 {"10", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "10"},
115 {"60", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "60"},
116};
117
Ce Chenc8d803a2020-04-27 09:31:33118const FeatureEntry::FeatureVariation
Ce Chenc8d803a2020-04-27 09:31:33119 kOmniboxOnDeviceHeadSuggestNonIncognitoExperimentVariations[] = {
120 {
121 "relevance-1000",
122 (FeatureEntry::FeatureParam[]){
123 {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput,
124 "1000"},
125 {OmniboxFieldTrial::kOnDeviceHeadSuggestDemoteMode,
126 "decrease-relevances"}},
127 2,
128 nullptr,
129 },
130 {
131 "request-delay-100ms",
132 (FeatureEntry::FeatureParam[]){
133 {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs,
134 "100"}},
135 1,
136 nullptr,
137 },
138 {
139 "delay-100ms-relevance-1000",
140 (FeatureEntry::FeatureParam[]){
141 {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs,
142 "100"},
143 {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput,
144 "1000"},
145 {OmniboxFieldTrial::kOnDeviceHeadSuggestDemoteMode,
146 "decrease-relevances"}},
147 3,
148 nullptr,
149 },
150 {
151 "request-delay-200ms",
152 (FeatureEntry::FeatureParam[]){
153 {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs,
154 "200"}},
155 1,
156 nullptr,
157 },
158 {
159 "delay-200ms-relevance-1000",
160 (FeatureEntry::FeatureParam[]){
161 {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs,
162 "200"},
163 {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput,
164 "1000"},
165 {OmniboxFieldTrial::kOnDeviceHeadSuggestDemoteMode,
166 "decrease-relevances"}},
167 3,
168 nullptr,
169 }};
Ce Chen104a5382019-12-10 01:09:05170
Stepan Khapugincc4e9842019-01-23 13:38:13171const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = {
172 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}};
173const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = {
174 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}};
175const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = {
176 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}};
177const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = {
178 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}};
179const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = {
180 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}};
181const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = {
182 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}};
183const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = {
184 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}};
185
186const FeatureEntry::FeatureVariation
187 kOmniboxUIMaxAutocompleteMatchesVariations[] = {
188 {"3 matches", kOmniboxUIMaxAutocompleteMatches3,
189 base::size(kOmniboxUIMaxAutocompleteMatches3), nullptr},
190 {"4 matches", kOmniboxUIMaxAutocompleteMatches4,
191 base::size(kOmniboxUIMaxAutocompleteMatches4), nullptr},
192 {"5 matches", kOmniboxUIMaxAutocompleteMatches5,
193 base::size(kOmniboxUIMaxAutocompleteMatches5), nullptr},
194 {"6 matches", kOmniboxUIMaxAutocompleteMatches6,
195 base::size(kOmniboxUIMaxAutocompleteMatches6), nullptr},
196 {"8 matches", kOmniboxUIMaxAutocompleteMatches8,
197 base::size(kOmniboxUIMaxAutocompleteMatches8), nullptr},
198 {"10 matches", kOmniboxUIMaxAutocompleteMatches10,
199 base::size(kOmniboxUIMaxAutocompleteMatches10), nullptr},
200 {"12 matches", kOmniboxUIMaxAutocompleteMatches12,
201 base::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}};
202
Caitlin Fischer37e01232019-05-24 13:05:45203const FeatureEntry::FeatureParam
204 kAutofillUseMobileLabelDisambiguationShowAll[] = {
205 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
206 autofill::features::
207 kAutofillUseMobileLabelDisambiguationParameterShowAll}};
208const FeatureEntry::FeatureParam
209 kAutofillUseMobileLabelDisambiguationShowOne[] = {
210 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
211 autofill::features::
212 kAutofillUseMobileLabelDisambiguationParameterShowOne}};
213
214const FeatureEntry::FeatureVariation
215 kAutofillUseMobileLabelDisambiguationVariations[] = {
216 {"(show all)", kAutofillUseMobileLabelDisambiguationShowAll,
217 base::size(kAutofillUseMobileLabelDisambiguationShowAll), nullptr},
218 {"(show one)", kAutofillUseMobileLabelDisambiguationShowOne,
219 base::size(kAutofillUseMobileLabelDisambiguationShowOne), nullptr}};
220
gogeralddb0d8ae2020-11-13 03:56:58221const FeatureEntry::FeatureParam kDiscoverFeedInNtpEnableNativeUI[] = {
222 {kDiscoverFeedIsNativeUIEnabled, "true"}};
223const FeatureEntry::FeatureVariation kDiscoverFeedInNtpVariations[] = {
224 {"Native UI", kDiscoverFeedInNtpEnableNativeUI,
225 base::size(kDiscoverFeedInNtpEnableNativeUI), nullptr}};
226
Gauthier Ambard58bd32a42021-01-08 16:56:53227const FeatureEntry::FeatureParam kWebViewNativeContextMenuWeb[] = {
228 {web::features::kWebViewNativeContextMenuName,
229 web::features::kWebViewNativeContextMenuParameterWeb}};
230const FeatureEntry::FeatureParam kWebViewNativeContextMenuSystem[] = {
231 {web::features::kWebViewNativeContextMenuName,
232 web::features::kWebViewNativeContextMenuParameterSystem}};
233
234const FeatureEntry::FeatureVariation kWebViewNativeContextMenuVariations[] = {
235 {"Web", kWebViewNativeContextMenuWeb,
236 base::size(kWebViewNativeContextMenuWeb), nullptr},
237 {"System", kWebViewNativeContextMenuSystem,
238 base::size(kWebViewNativeContextMenuSystem), nullptr}};
239
Cooper Knaak1e026562017-07-26 05:22:28240// To add a new entry, add to the end of kFeatureEntries. There are four
sdefresne14900ee2015-11-27 14:43:21241// distinct types of entries:
Cooper Knaak1e026562017-07-26 05:22:28242// . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the
243// default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE
sdefresne14900ee2015-11-27 14:43:21244// macro for this type supplying the command line to the macro.
245// . MULTI_VALUE: a list of choices, the first of which should correspond to a
246// deactivated state for this lab (i.e. no command line option). To specify
247// this type of entry use the macro MULTI_VALUE_TYPE supplying it the
248// array of choices.
Cooper Knaak1e026562017-07-26 05:22:28249// . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is
250// either enabled, disabled, or uses the default value of the associated
251// base::Feature instance. To specify this type of entry use the macro
252// FEATURE_VALUE_TYPE supplying it the base::Feature instance.
253// . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a
254// base::Feature instance. Choices corresponding to the default state, a
255// universally enabled state, and a universally disabled state are
256// automatically included. To specify this type of entry use the macro
257// FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and
258// the array of choices.
259//
sdefresne14900ee2015-11-27 14:43:21260// See the documentation of FeatureEntry for details on the fields.
261//
262// When adding a new choice, add it to the end of the list.
263const flags_ui::FeatureEntry kFeatureEntries[] = {
Cooper Knaak1e026562017-07-26 05:22:28264 {"in-product-help-demo-mode-choice",
265 flag_descriptions::kInProductHelpDemoModeName,
266 flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos,
267 FEATURE_WITH_PARAMS_VALUE_TYPE(
Tommy Nyquistc1d6dea12017-07-26 20:37:23268 feature_engagement::kIPHDemoMode,
269 feature_engagement::kIPHDemoModeChoiceVariations,
Marc Treib2752e8b2017-08-04 14:12:09270 "IPH_DemoMode")},
Moe Ahmadic3fd7cd2018-05-11 21:40:22271 {"enable-autofill-credit-card-upload",
272 flag_descriptions::kAutofillCreditCardUploadName,
273 flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos,
Anne Lim579b5732018-08-30 18:24:24274 FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)},
Moe Ahmadid6d5d172018-06-20 17:20:23275 {"use-sync-sandbox", flag_descriptions::kSyncSandboxName,
276 flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos,
277 SINGLE_VALUE_TYPE_AND_VALUE(
278 switches::kSyncServiceURL,
279 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")},
280 {"wallet-service-use-sandbox",
281 flag_descriptions::kWalletServiceUseSandboxName,
282 flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos,
283 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
284 autofill::switches::kWalletServiceUseSandbox,
285 "1",
286 autofill::switches::kWalletServiceUseSandbox,
287 "0")},
Mohamad Ahmadic4df81f2017-12-20 04:41:59288 {"show-autofill-type-predictions",
289 flag_descriptions::kShowAutofillTypePredictionsName,
290 flag_descriptions::kShowAutofillTypePredictionsDescription,
291 flags_ui::kOsIos,
Gauthier Ambardcfd85182018-01-05 10:37:46292 FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)},
Olivier Robin3d60411622018-02-23 10:03:22293 {"autofill-ios-delay-between-fields",
294 flag_descriptions::kAutofillIOSDelayBetweenFieldsName,
295 flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription,
296 flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)},
Moe Ahmadid3ddfcb2018-04-20 19:51:08297 {"autofill-restrict-formless-form-extraction",
298 flag_descriptions::kAutofillRestrictUnownedFieldsToFormlessCheckoutName,
299 flag_descriptions::
300 kAutofillRestrictUnownedFieldsToFormlessCheckoutDescription,
301 flags_ui::kOsIos,
302 FEATURE_VALUE_TYPE(
303 autofill::features::kAutofillRestrictUnownedFieldsToFormlessCheckout)},
Roger McFarlanee193ab122018-11-22 20:55:07304 {"autofill-rich-metadata-queries",
305 flag_descriptions::kAutofillRichMetadataQueriesName,
306 flag_descriptions::kAutofillRichMetadataQueriesDescription,
307 flags_ui::kOsIos,
308 FEATURE_VALUE_TYPE(autofill::features::kAutofillRichMetadataQueries)},
Kurt Horimotodc33af32018-05-01 01:39:14309 {"fullscreen-viewport-adjustment-experiment",
Chris Lu481a9322019-09-25 22:16:53310 flag_descriptions::kFullscreenSmoothScrollingName,
311 flag_descriptions::kFullscreenSmoothScrollingDescription, flags_ui::kOsIos,
312 FEATURE_VALUE_TYPE(fullscreen::features::kSmoothScrollingDefault)},
Roger McFarlane2eceba982018-05-18 01:37:11313 {"autofill-cache-query-responses",
314 flag_descriptions::kAutofillCacheQueryResponsesName,
315 flag_descriptions::kAutofillCacheQueryResponsesDescription,
316 flags_ui::kOsIos,
317 FEATURE_VALUE_TYPE(autofill::features::kAutofillCacheQueryResponses)},
Robbie Gibson1f37a5e2020-08-06 17:03:06318 {"webpage-default-zoom-from-dynamic-type",
319 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeName,
320 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeDescription,
321 flags_ui::kOsIos,
322 FEATURE_VALUE_TYPE(web::kWebPageDefaultZoomFromDynamicType)},
Yi Su392b3032018-06-05 07:26:47323 {"webpage-text-accessibility",
324 flag_descriptions::kWebPageTextAccessibilityName,
325 flag_descriptions::kWebPageTextAccessibilityDescription, flags_ui::kOsIos,
326 FEATURE_VALUE_TYPE(web::kWebPageTextAccessibility)},
Robbie Gibson88f23962020-09-28 14:35:56327 {"webpage-alternative-text-zoom",
328 flag_descriptions::kWebPageAlternativeTextZoomName,
329 flag_descriptions::kWebPageAlternativeTextZoomDescription,
330 flags_ui::kOsIos, FEATURE_VALUE_TYPE(web::kWebPageAlternativeTextZoom)},
Kurt Horimoto79d590b2018-09-12 19:09:28331 {"toolbar-container", flag_descriptions::kToolbarContainerName,
332 flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos,
333 FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)},
Ce Chenc8d803a2020-04-27 09:31:33334 {"omnibox-on-device-head-suggestions-incognito",
335 flag_descriptions::kOmniboxOnDeviceHeadSuggestionsIncognitoName,
336 flag_descriptions::kOmniboxOnDeviceHeadSuggestionsIncognitoDescription,
Ce Chen104a5382019-12-10 01:09:05337 flags_ui::kOsIos,
Ce Chend565f71f2020-08-12 01:15:53338 FEATURE_VALUE_TYPE(omnibox::kOnDeviceHeadProviderIncognito)},
Ce Chenc8d803a2020-04-27 09:31:33339 {"omnibox-on-device-head-suggestions-non-incognito",
340 flag_descriptions::kOmniboxOnDeviceHeadSuggestionsNonIncognitoName,
341 flag_descriptions::kOmniboxOnDeviceHeadSuggestionsNonIncognitoDescription,
342 flags_ui::kOsIos,
343 FEATURE_WITH_PARAMS_VALUE_TYPE(
344 omnibox::kOnDeviceHeadProviderNonIncognito,
345 kOmniboxOnDeviceHeadSuggestNonIncognitoExperimentVariations,
346 "OmniboxOnDeviceHeadSuggestNonIncognitoIOS")},
Stepan Khapugincc4e9842019-01-23 13:38:13347 {"omnibox-ui-max-autocomplete-matches",
348 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName,
349 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription,
350 flags_ui::kOsIos,
351 FEATURE_WITH_PARAMS_VALUE_TYPE(
352 omnibox::kUIExperimentMaxAutocompleteMatches,
353 kOmniboxUIMaxAutocompleteMatchesVariations,
354 "OmniboxUIMaxAutocompleteVariations")},
Robbie Gibson84f1ddc2020-12-10 21:41:28355 {"omnibox-local-history-zero-suggest",
356 flag_descriptions::kOmniboxLocalHistoryZeroSuggestName,
357 flag_descriptions::kOmniboxLocalHistoryZeroSuggestDescription,
358 flags_ui::kOsIos, FEATURE_VALUE_TYPE(omnibox::kLocalHistoryZeroSuggest)},
sczs80a6f462018-12-05 20:37:18359 {"infobar-ui-reboot", flag_descriptions::kInfobarUIRebootName,
360 flag_descriptions::kInfobarUIRebootDescription, flags_ui::kOsIos,
sczs27e389e2020-01-15 15:19:18361 FEATURE_VALUE_TYPE(kIOSInfobarUIReboot)},
edchin5ae0b4c2019-01-06 06:52:28362 {"snapshot-draw-view", flag_descriptions::kSnapshotDrawViewName,
363 flag_descriptions::kSnapshotDrawViewDescription, flags_ui::kOsIos,
364 FEATURE_VALUE_TYPE(kSnapshotDrawView)},
Justin Cohen20b6f072019-01-16 01:38:50365#if defined(DCHECK_IS_CONFIGURABLE)
366 {"dcheck-is-fatal", flag_descriptions::kDcheckIsFatalName,
367 flag_descriptions::kDcheckIsFatalDescription, flags_ui::kOsIos,
368 FEATURE_VALUE_TYPE(base::kDCheckIsFatalFeature)},
369#endif // defined(DCHECK_IS_CONFIGURABLE)
Gauthier Ambard5f610862019-01-17 11:43:55370 {"settings-refresh", flag_descriptions::kSettingsRefreshName,
371 flag_descriptions::kSettingsRefreshDescription, flags_ui::kOsIos,
372 FEATURE_VALUE_TYPE(kSettingsRefresh)},
Chris Lu8153e6e2019-03-26 16:28:21373 {"send-uma-cellular", flag_descriptions::kSendUmaOverAnyNetwork,
374 flag_descriptions::kSendUmaOverAnyNetworkDescription, flags_ui::kOsIos,
Chris Lu0683adf2019-02-26 15:56:45375 FEATURE_VALUE_TYPE(kUmaCellular)},
Caitlin Fischer43edd90a2019-05-01 13:24:30376 {"autofill-use-mobile-label-disambiguation",
377 flag_descriptions::kAutofillUseMobileLabelDisambiguationName,
378 flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription,
379 flags_ui::kOsIos,
Caitlin Fischer37e01232019-05-24 13:05:45380 FEATURE_WITH_PARAMS_VALUE_TYPE(
381 autofill::features::kAutofillUseMobileLabelDisambiguation,
382 kAutofillUseMobileLabelDisambiguationVariations,
383 "AutofillUseMobileLabelDisambiguation")},
edchinb5d92582020-03-11 15:26:11384 {"autofill-prune-suggestions",
Caitlin Fischer6d609542019-05-01 21:59:21385 flag_descriptions::kAutofillPruneSuggestionsName,
386 flag_descriptions::kAutofillPruneSuggestionsDescription, flags_ui::kOsIos,
387 FEATURE_VALUE_TYPE(autofill::features::kAutofillPruneSuggestions)},
sczs76b9ba02019-07-23 23:34:30388 {"collections-card-presentation-style",
389 flag_descriptions::kCollectionsCardPresentationStyleName,
390 flag_descriptions::kCollectionsCardPresentationStyleDescription,
391 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kCollectionsCardPresentationStyle)},
Mike Doughertyb6c770d2019-09-13 22:56:46392 {"ios-breadcrumbs", flag_descriptions::kLogBreadcrumbsName,
393 flag_descriptions::kLogBreadcrumbsDescription, flags_ui::kOsIos,
394 FEATURE_VALUE_TYPE(kLogBreadcrumbs)},
Eugene But2823dc7e2020-07-21 18:10:37395 {"ios-synthetic-crash-reports",
396 flag_descriptions::kSyntheticCrashReportsForUteName,
397 flag_descriptions::kSyntheticCrashReportsForUteDescription,
398 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSyntheticCrashReportsForUte)},
Jérôme Lebelc374fdd2019-09-27 10:36:48399 {"force-startup-signin-promo",
400 flag_descriptions::kForceStartupSigninPromoName,
401 flag_descriptions::kForceStartupSigninPromoDescription, flags_ui::kOsIos,
402 FEATURE_VALUE_TYPE(signin::kForceStartupSigninPromo)},
Justin Cohenc57413a2019-09-30 19:42:29403 {"embedder-block-restore-url",
404 flag_descriptions::kEmbedderBlockRestoreUrlName,
405 flag_descriptions::kEmbedderBlockRestoreUrlDescription, flags_ui::kOsIos,
406 FEATURE_VALUE_TYPE(kEmbedderBlockRestoreUrl)},
sczs004fa6c2019-10-18 17:22:52407 {"messages-save-card-infobar",
408 flag_descriptions::kSaveCardInfobarMessagesUIName,
409 flag_descriptions::kSaveCardInfobarMessagesUIDescription, flags_ui::kOsIos,
410 FEATURE_VALUE_TYPE(kSaveCardInfobarMessagesUI)},
Chris Lu4cc111b452019-10-18 22:18:48411 {"messages-translate-infobar",
412 flag_descriptions::kTranslateInfobarMessagesUIName,
413 flag_descriptions::kTranslateInfobarMessagesUIDescription,
414 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kTranslateInfobarMessagesUI)},
sczs4622e6e2019-11-06 01:17:59415 {"autofill-save-card-dismiss-on-navigation",
416 flag_descriptions::kAutofillSaveCardDismissOnNavigationName,
417 flag_descriptions::kAutofillSaveCardDismissOnNavigationDescription,
418 flags_ui::kOsIos,
419 FEATURE_VALUE_TYPE(
420 autofill::features::kAutofillSaveCardDismissOnNavigation)},
Rohit Raoe7b489312019-11-12 12:28:55421 {"force-unstacked-tabstrip", flag_descriptions::kForceUnstackedTabstripName,
422 flag_descriptions::kForceUnstackedTabstripDescription, flags_ui::kOsIos,
423 FEATURE_VALUE_TYPE(kForceUnstackedTabstrip)},
Gauthier Ambard93914002019-11-14 12:56:12424 {"use-js-error-page", flag_descriptions::kUseJSForErrorPageName,
425 flag_descriptions::kUseJSForErrorPageDescription, flags_ui::kOsIos,
426 FEATURE_VALUE_TYPE(web::features::kUseJSForErrorPage)},
Gauthier Ambardbde9def2019-11-19 18:04:33427 {"desktop-version-default", flag_descriptions::kDefaultToDesktopOnIPadName,
428 flag_descriptions::kDefaultToDesktopOnIPadDescription, flags_ui::kOsIos,
Gauthier Ambard054175f2019-12-16 11:54:09429 FEATURE_VALUE_TYPE(web::features::kUseDefaultUserAgentInWebClient)},
Gauthier Ambardbde9def2019-11-19 18:04:33430 {"mobile-google-srp", flag_descriptions::kMobileGoogleSRPName,
431 flag_descriptions::kMobileGoogleSRPDescription, flags_ui::kOsIos,
432 FEATURE_VALUE_TYPE(web::kMobileGoogleSRP)},
Kurt Horimotod754e8ec2019-12-03 20:54:02433 {"infobar-overlay-ui", flag_descriptions::kInfobarOverlayUIName,
434 flag_descriptions::kInfobarOverlayUIDescription, flags_ui::kOsIos,
435 FEATURE_VALUE_TYPE(kInfobarOverlayUI)},
sczs391ebba2019-12-05 06:59:30436 {"autofill-save-card-infobar-edit-support",
437 flag_descriptions::kAutofillSaveCardInfobarEditSupportName,
438 flag_descriptions::kAutofillSaveCardInfobarEditSupportDescription,
439 flags_ui::kOsIos,
440 FEATURE_VALUE_TYPE(
441 autofill::features::kAutofillSaveCardInfobarEditSupport)},
edchin68696842020-04-09 17:19:31442 {"managed-bookmarks-ios", flag_descriptions::kManagedBookmarksIOSName,
443 flag_descriptions::kManagedBookmarksIOSDescription, flags_ui::kOsIos,
444 FEATURE_VALUE_TYPE(kManagedBookmarksIOS)},
sczs5b8ac5f2020-04-17 16:23:20445 {"infobar-ui-reboot-only-ios13",
446 flag_descriptions::kInfobarUIRebootOnlyiOS13Name,
447 flag_descriptions::kInfobarUIRebootOnlyiOS13Description, flags_ui::kOsIos,
448 FEATURE_VALUE_TYPE(kInfobarUIRebootOnlyiOS13)},
edchin39d08d62020-04-20 13:11:24449 {"edit-bookmarks-ios", flag_descriptions::kEditBookmarksIOSName,
450 flag_descriptions::kEditBookmarksIOSDescription, flags_ui::kOsIos,
451 FEATURE_VALUE_TYPE(kEditBookmarksIOS)},
Mike Dougherty768389502020-04-21 08:28:35452 {"url-blocklist-ios", flag_descriptions::kURLBlocklistIOSName,
453 flag_descriptions::kURLBlocklistIOSDescription, flags_ui::kOsIos,
454 FEATURE_VALUE_TYPE(kURLBlocklistIOS)},
siashah0a386222020-04-23 03:31:35455 {"autofill-enable-google-issued-card",
456 flag_descriptions::kAutofillEnableGoogleIssuedCardName,
457 flag_descriptions::kAutofillEnableGoogleIssuedCardDescription,
458 flags_ui::kOsIos,
459 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableGoogleIssuedCard)},
Tina Wang52aea19d2020-05-15 16:47:33460 {"enable-ios-managed-settings-ui",
461 flag_descriptions::kEnableIOSManagedSettingsUIName,
462 flag_descriptions::kEnableIOSManagedSettingsUIDescription,
463 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableIOSManagedSettingsUI)},
Sean Harrison0ada3b082020-05-18 19:07:51464 {"safety-check-ios", flag_descriptions::kSafetyCheckIOSName,
465 flag_descriptions::kSafetyCheckIOSDescription, flags_ui::kOsIos,
466 FEATURE_VALUE_TYPE(kSafetyCheckIOS)},
sczs37d9c132020-07-18 06:06:33467 {"new-content-suggestions-feed", flag_descriptions::kDiscoverFeedInNtpName,
adamta22a4d502020-05-21 03:12:21468 flag_descriptions::kDiscoverFeedInNtpDescription, flags_ui::kOsIos,
gogeralddb0d8ae2020-11-13 03:56:58469 FEATURE_WITH_PARAMS_VALUE_TYPE(kDiscoverFeedInNtp,
470 kDiscoverFeedInNtpVariations,
471 "IOSDiscoverFeed")},
adamta273568472020-12-04 23:53:57472 {"refactored-ntp", flag_descriptions::kRefactoredNTPName,
473 flag_descriptions::kRefactoredNTPDescription, flags_ui::kOsIos,
474 FEATURE_VALUE_TYPE(kRefactoredNTP)},
Maxime Charland425d9b42020-06-01 19:47:21475 {"illustrated-empty-states", flag_descriptions::kIllustratedEmptyStatesName,
476 flag_descriptions::kIllustratedEmptyStatesDescription, flags_ui::kOsIos,
477 FEATURE_VALUE_TYPE(kIllustratedEmptyStates)},
Roberto Mourab87b9722020-06-17 17:12:09478 {"expanded-tab-strip", flag_descriptions::kExpandedTabStripName,
479 flag_descriptions::kExpandedTabStripDescription, flags_ui::kOsIos,
480 FEATURE_VALUE_TYPE(kExpandedTabStrip)},
Ben Blake14592fe2020-06-16 15:34:38481 {"autofill-enable-offers-in-downstream",
482 flag_descriptions::kAutofillEnableOffersInDownstreamName,
483 flag_descriptions::kAutofillEnableOffersInDownstreamDescription,
484 flags_ui::kOsIos,
485 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableOffersInDownstream)},
Tommy Martino6b4eb7e2020-06-25 18:25:41486 {"shared-highlighting-ios", flag_descriptions::kSharedHighlightingIOSName,
487 flag_descriptions::kSharedHighlightingIOSDescription, flags_ui::kOsIos,
488 FEATURE_VALUE_TYPE(kSharedHighlightingIOS)},
Julian Mentasti-Meza4c0a4162020-07-20 18:51:41489 {"enable-fullpage-screenshot",
490 flag_descriptions::kEnableFullPageScreenshotName,
491 flag_descriptions::kEnableFullPageScreenshotDescription, flags_ui::kOsIos,
492 FEATURE_VALUE_TYPE(kEnableFullPageScreenshot)},
Tommy Martino40124672020-07-31 17:29:44493 {"scroll-to-text-ios", flag_descriptions::kScrollToTextIOSName,
494 flag_descriptions::kScrollToTextIOSDescription, flags_ui::kOsIos,
495 FEATURE_VALUE_TYPE(web::features::kScrollToTextIOS)},
Chris Thompson40cbb162020-08-04 23:22:15496 {"legacy-tls-interstitial",
497 flag_descriptions::kIOSLegacyTLSInterstitialsName,
498 flag_descriptions::kIOSLegacyTLSInterstitialsDescription, flags_ui::kOsIos,
499 FEATURE_VALUE_TYPE(web::features::kIOSLegacyTLSInterstitial)},
Ewann163e3952020-08-21 12:34:49500 {"extend-open-in-files-support",
501 flag_descriptions::kExtendOpenInFilesSupportName,
502 flag_descriptions::kExtendOpenInFilesSupportDescription, flags_ui::kOsIos,
503 FEATURE_VALUE_TYPE(kExtendOpenInFilesSupport)},
Ewanne1ffc6d2020-09-01 07:56:13504 {"enable-close-all-tabs-confirmation",
505 flag_descriptions::kEnableCloseAllTabsConfirmationName,
506 flag_descriptions::kEnableCloseAllTabsConfirmationDescription,
507 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableCloseAllTabsConfirmation)},
Sylvain Defresne9c107082020-10-27 16:39:13508#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
edchin81467b82020-09-03 19:31:45509 {"screen-time-integration-ios",
510 flag_descriptions::kScreenTimeIntegrationName,
511 flag_descriptions::kScreenTimeIntegrationDescription, flags_ui::kOsIos,
512 FEATURE_VALUE_TYPE(kScreenTimeIntegration)},
Sylvain Defresne9c107082020-10-27 16:39:13513#endif
Nohemi Fernandez983d6d52020-09-09 09:46:19514 {"mobile-identity-consistency",
515 flag_descriptions::kMobileIdentityConsistencyName,
516 flag_descriptions::kMobileIdentityConsistencyDescription, flags_ui::kOsIos,
517 FEATURE_VALUE_TYPE(signin::kMobileIdentityConsistency)},
Jérôme Lebel1d4b0fa2021-01-28 01:01:43518 {"simplify-sign-out-ios", flag_descriptions::kSimplifySignOutIOSName,
519 flag_descriptions::kSimplifySignOutIOSDescription, flags_ui::kOsIos,
520 FEATURE_VALUE_TYPE(signin::kSimplifySignOutIOS)},
Gauthier Ambarda1d88a02020-09-14 11:46:37521 {"default-browser-setting", flag_descriptions::kDefaultBrowserSettingsName,
522 flag_descriptions::kDefaultBrowserSettingsDescription, flags_ui::kOsIos,
523 FEATURE_VALUE_TYPE(kDefaultBrowserSettings)},
Nazerke3e993f72020-09-21 13:00:06524 {"modern-tab-strip", flag_descriptions::kModernTabStripName,
525 flag_descriptions::kModernTabStripDescription, flags_ui::kOsIos,
526 FEATURE_VALUE_TYPE(kModernTabStrip)},
Maria Kazinovad4e2ed72020-09-22 17:40:50527 {"autofill-use-renderer-ids",
528 flag_descriptions::kAutofillUseRendererIDsName,
529 flag_descriptions::kAutofillUseRendererIDsDescription, flags_ui::kOsIos,
530 FEATURE_VALUE_TYPE(
531 autofill::features::kAutofillUseUniqueRendererIDsOnIOS)},
Nohemi Fernandez704527492020-09-23 14:00:08532 {"restore-gaia-cookies-if-deleted",
533 flag_descriptions::kRestoreGaiaCookiesIfDeletedName,
534 flag_descriptions::kRestoreGaiaCookiesIfDeletedDescription,
535 flags_ui::kOsIos,
536 FEATURE_VALUE_TYPE(signin::kRestoreGaiaCookiesIfDeleted)},
Nohemi Fernandez7af63ca22020-12-11 13:06:40537 {"restore-gaia-cookies-on-user-action",
538 flag_descriptions::kRestoreGaiaCookiesOnUserActionName,
539 flag_descriptions::kRestoreGaiaCookiesOnUserActionDescription,
540 flags_ui::kOsIos,
541 FEATURE_VALUE_TYPE(signin::kRestoreGaiaCookiesOnUserAction)},
Nohemi Fernandez14a80f72020-11-09 13:01:04542 {"use-username-for-signin-notification-infobar-title",
543 flag_descriptions::kSigninNotificationInfobarUsernameInTitleName,
544 flag_descriptions::kSigninNotificationInfobarUsernameInTitleDescription,
545 flags_ui::kOsIos,
546 FEATURE_VALUE_TYPE(signin::kSigninNotificationInfobarUsernameInTitle)},
Nohemi Fernandez222d6d42020-09-30 20:35:57547 {"minutes-delay-to-restore-gaia-cookies-if-deleted",
548 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieName,
549 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieDescription,
550 flags_ui::kOsIos,
551 MULTI_VALUE_TYPE(kDelayThresholdMinutesToUpdateGaiaCookieChoices)},
Viktor Semeniukd932ff52020-10-13 13:10:17552 {"edit-passwords-in-settings",
553 flag_descriptions::kEditPasswordsInSettingsName,
554 flag_descriptions::kEditPasswordsInSettingsDescription, flags_ui::kOsIos,
555 FEATURE_VALUE_TYPE(password_manager::features::kEditPasswordsInSettings)},
Stepan Khapuginddb85962020-10-21 11:49:58556 {"enable-incognito-authentication-ios",
557 flag_descriptions::kIncognitoAuthenticationName,
558 flag_descriptions::kIncognitoAuthenticationDescription, flags_ui::kOsIos,
559 FEATURE_VALUE_TYPE(kIncognitoAuthentication)},
Tina Wangff4ac852020-11-24 18:46:46560 {"enable-incognito-mode-availability-ios",
561 flag_descriptions::kEnableIncognitoModeAvailabilityIOSName,
562 flag_descriptions::kEnableIncognitoModeAvailabilityIOSDescription,
563 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableIncognitoModeAvailabilityIOS)},
Gauthier Ambardcb6a0ccc2020-10-30 13:12:00564 {"web-view-native-context-menu",
565 flag_descriptions::kWebViewNativeContextMenuName,
566 flag_descriptions::kWebViewNativeContextMenuDescription, flags_ui::kOsIos,
Gauthier Ambard58bd32a42021-01-08 16:56:53567 FEATURE_WITH_PARAMS_VALUE_TYPE(web::features::kWebViewNativeContextMenu,
568 kWebViewNativeContextMenuVariations,
569 "WebViewNativeContextMenu")},
Chris Lu4b15abc2020-11-09 20:19:19570 {"location-permissions-prompt",
571 flag_descriptions::kLocationPermissionsPromptName,
572 flag_descriptions::kLocationPermissionsPromptDescription, flags_ui::kOsIos,
573 FEATURE_VALUE_TYPE(kLocationPermissionsPrompt)},
Eugene Butf869bff2020-12-10 01:16:55574 {"record-snapshot-size", flag_descriptions::kRecordSnapshotSizeName,
575 flag_descriptions::kRecordSnapshotSizeDescription, flags_ui::kOsIos,
576 FEATURE_VALUE_TYPE(web::features::kRecordSnapshotSize)},
Chris Lub17195f2020-12-10 20:49:14577 {"default-browser-fullscreen-promo-experiment",
578 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentName,
579 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentDescription,
580 flags_ui::kOsIos,
581 FEATURE_VALUE_TYPE(kDefaultBrowserFullscreenPromoExperiment)},
Cheick Cisse76ade3d2020-12-16 00:15:11582 {"ios-shared-highlighting-color-change",
583 flag_descriptions::kIOSSharedHighlightingColorChangeName,
584 flag_descriptions::kIOSSharedHighlightingColorChangeDescription,
585 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kIOSSharedHighlightingColorChange)},
Chris Lu07e32772020-12-30 01:54:44586 {"ios-persist-crash-restore-infobar",
587 flag_descriptions::kIOSPersistCrashRestoreName,
588 flag_descriptions::kIOSPersistCrashRestoreDescription, flags_ui::kOsIos,
589 FEATURE_VALUE_TYPE(kIOSPersistCrashRestore)},
Viktor Semeniuk61177b332021-01-05 12:48:19590 {"change-password-affiliation",
591 flag_descriptions::kChangePasswordAffiliationInfoName,
592 flag_descriptions::kChangePasswordAffiliationInfoDescription,
593 flags_ui::kOsIos,
594 FEATURE_VALUE_TYPE(
595 password_manager::features::kChangePasswordAffiliationInfo)},
596 {"use-of-hash-affiliation-fetcher",
597 flag_descriptions::kUseOfHashAffiliationFetcherName,
598 flag_descriptions::kUseOfHashAffiliationFetcherDescription,
599 flags_ui::kOsIos,
600 FEATURE_VALUE_TYPE(
601 password_manager::features::kUseOfHashAffiliationFetcher)},
Stepan Khapugin04341202021-01-07 12:22:45602 {"omnibox-new-textfield-implementation",
603 flag_descriptions::kOmniboxNewImplementationName,
604 flag_descriptions::kOmniboxNewImplementationDescription, flags_ui::kOsIos,
605 FEATURE_VALUE_TYPE(kIOSNewOmniboxImplementation)},
Tommy Martino0caf3362021-01-13 20:29:58606 {"shared-highlighting-use-blocklist",
607 flag_descriptions::kSharedHighlightingUseBlocklistIOSName,
608 flag_descriptions::kSharedHighlightingUseBlocklistIOSDescription,
609 flags_ui::kOsIos,
610 FEATURE_VALUE_TYPE(shared_highlighting::kSharedHighlightingUseBlocklist)},
gogerald0ff29e52021-02-03 18:56:19611 {"start-surface", flag_descriptions::kStartSurfaceName,
612 flag_descriptions::kStartSurfaceDescription, flags_ui::kOsIos,
613 FEATURE_VALUE_TYPE(kStartSurface)},
Gauthier Ambarde813c07f2020-01-09 10:18:49614};
sdefresne14900ee2015-11-27 14:43:21615
Rohit Raobed794c2020-04-27 15:27:45616bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
617 return false;
618}
619
620flags_ui::FlagsState& GetGlobalFlagsState() {
621 static base::NoDestructor<flags_ui::FlagsState> flags_state(kFeatureEntries,
622 nullptr);
623 return *flags_state;
624}
625} // namespace
626
sdefresne14900ee2015-11-27 14:43:21627// Add all switches from experimental flags to |command_line|.
628void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) {
629 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
630
sdefresne14900ee2015-11-27 14:43:21631 // Set the UA flag if UseMobileSafariUA is enabled.
632 if ([defaults boolForKey:@"UseMobileSafariUA"]) {
633 // Safari uses "Vesion/", followed by the OS version excluding bugfix, where
634 // Chrome puts its product token.
avi571943672015-12-22 02:12:49635 int32_t major = 0;
636 int32_t minor = 0;
637 int32_t bugfix = 0;
sdefresne14900ee2015-11-27 14:43:21638 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix);
639 std::string product = base::StringPrintf("Version/%d.%d", major, minor);
640
Gauthier Ambardba163d42020-05-27 14:48:17641 command_line->AppendSwitchASCII(switches::kUserAgent,
642 web::BuildMobileUserAgent(product));
sdefresne14900ee2015-11-27 14:43:21643 }
644
Guillaume Jenkins25e9bd72020-08-27 17:39:06645 // Shared variables for all enterprise experimental flags.
Guillaume Jenkins57606d72020-08-13 17:32:55646 NSMutableDictionary* testing_policies = [[NSMutableDictionary alloc] init];
Guillaume Jenkins25e9bd72020-08-27 17:39:06647 NSMutableArray* allowed_experimental_policies = [[NSMutableArray alloc] init];
Guillaume Jenkins57606d72020-08-13 17:32:55648
Guillaume Jenkins25e9bd72020-08-27 17:39:06649 // Set some sample policy values for testing if EnableSamplePolicies is set to
650 // true.
Guillaume Jenkinseeb7007c2020-06-25 22:55:40651 if ([defaults boolForKey:@"EnableSamplePolicies"]) {
Guillaume Jenkins25e9bd72020-08-27 17:39:06652 // Some of the sample policies are still marked as experimental and must be
653 // explicitly allowed, otherwise they will be ignored in Beta and Stable.
654 [allowed_experimental_policies addObjectsFromArray:@[
Tina Wang59d0b7e2020-08-11 04:41:01655 base::SysUTF8ToNSString(policy::key::kAutofillAddressEnabled),
Sébastien Séguin-Gagnonc107b1f2020-07-02 21:43:58656 base::SysUTF8ToNSString(policy::key::kAutofillCreditCardEnabled),
657 base::SysUTF8ToNSString(policy::key::kChromeVariations),
658 base::SysUTF8ToNSString(policy::key::kDefaultPopupsSetting),
Tina Wang5abee802020-07-29 23:09:52659 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderEnabled),
660 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderName),
661 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderSearchURL),
Tina Wang89068c82020-10-29 15:51:50662 base::SysUTF8ToNSString(policy::key::kEditBookmarksEnabled),
Tina Wang59d0b7e2020-08-11 04:41:01663 base::SysUTF8ToNSString(policy::key::kPasswordManagerEnabled),
Tina Wang54dddfc22020-08-20 22:34:53664 base::SysUTF8ToNSString(policy::key::kSafeBrowsingProtectionLevel),
665 base::SysUTF8ToNSString(policy::key::kSearchSuggestEnabled),
Tina Wang59d0b7e2020-08-11 04:41:01666 base::SysUTF8ToNSString(policy::key::kTranslateEnabled)
Guillaume Jenkins25e9bd72020-08-27 17:39:06667 ]];
Sébastien Séguin-Gagnonc107b1f2020-07-02 21:43:58668
669 // Define sample policies to enable.
Guillaume Jenkins57606d72020-08-13 17:32:55670 [testing_policies addEntriesFromDictionary:@{
Tina Wang59d0b7e2020-08-11 04:41:01671 base::SysUTF8ToNSString(policy::key::kAutofillAddressEnabled) : @NO,
672
Guillaume Jenkinseeb7007c2020-06-25 22:55:40673 base::SysUTF8ToNSString(policy::key::kAutofillCreditCardEnabled) : @NO,
674
675 // 2 = Disable all variations
676 base::SysUTF8ToNSString(policy::key::kChromeVariations) : @2,
677
678 // 2 = Do not allow any site to show popups
679 base::SysUTF8ToNSString(policy::key::kDefaultPopupsSetting) : @2,
680
Tina Wang5abee802020-07-29 23:09:52681 // Set default search engine.
682 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderEnabled) :
683 @YES,
684 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderSearchURL) :
685 @"http://www.google.com/search?q={searchTerms}",
686 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderName) :
Tina Wang7cd0a062020-09-15 21:31:02687 @"TestEngine",
Tina Wang5abee802020-07-29 23:09:52688
Tina Wang89068c82020-10-29 15:51:50689 base::SysUTF8ToNSString(policy::key::kEditBookmarksEnabled) : @NO,
690
Guillaume Jenkinseeb7007c2020-06-25 22:55:40691 base::SysUTF8ToNSString(policy::key::kPasswordManagerEnabled) : @NO,
Tina Wang59d0b7e2020-08-11 04:41:01692
693 base::SysUTF8ToNSString(policy::key::kTranslateEnabled) : @NO,
Tina Wang54dddfc22020-08-20 22:34:53694
695 // 2 = Enhanced safe browsing protection
696 base::SysUTF8ToNSString(policy::key::kSafeBrowsingProtectionLevel) : @2,
697
698 base::SysUTF8ToNSString(policy::key::kSearchSuggestEnabled) : @YES,
Guillaume Jenkins57606d72020-08-13 17:32:55699 }];
700 }
701
Tina Wangc6bcf572021-01-27 18:15:52702 // If an incognito mode availability is set, add the policy key to the list of
703 // allowed experimental policies, and set the value.
704 NSString* incognito_policy_key =
705 base::SysUTF8ToNSString(policy::key::kIncognitoModeAvailability);
706 NSInteger incognito_mode_availability =
707 [defaults integerForKey:incognito_policy_key];
708 if (incognito_mode_availability) {
709 [allowed_experimental_policies addObject:incognito_policy_key];
710 [testing_policies addEntriesFromDictionary:@{
711 incognito_policy_key : @(incognito_mode_availability),
712 }];
713 }
714
Guillaume Jenkins57606d72020-08-13 17:32:55715 // If a CBCM enrollment token is provided, force Chrome Browser Cloud
Guillaume Jenkins25e9bd72020-08-27 17:39:06716 // Management to enabled, add the token to the list of policies, and allow
717 // the CloudReportingEnabled experimental policy.
Guillaume Jenkins57606d72020-08-13 17:32:55718 NSString* token_key =
719 base::SysUTF8ToNSString(policy::key::kCloudManagementEnrollmentToken);
720 NSString* token = [defaults stringForKey:token_key];
721
722 if ([token length] > 0) {
723 command_line->AppendSwitch(switches::kEnableChromeBrowserCloudManagement);
Guillaume Jenkins25e9bd72020-08-27 17:39:06724 [allowed_experimental_policies
725 addObject:base::SysUTF8ToNSString(policy::key::kCloudReportingEnabled)];
Guillaume Jenkins57606d72020-08-13 17:32:55726 [testing_policies setValue:token forKey:token_key];
727 }
728
Guillaume Jenkins25e9bd72020-08-27 17:39:06729 // If any experimental policy was allowed, set the EnableExperimentalPolicies
730 // policy.
731 if ([allowed_experimental_policies count] > 0) {
732 [testing_policies setValue:allowed_experimental_policies
733 forKey:base::SysUTF8ToNSString(
734 policy::key::kEnableExperimentalPolicies)];
735 }
736
Guillaume Jenkins57606d72020-08-13 17:32:55737 // If some policies were set, commit them to the app's registration defaults.
738 if ([testing_policies count] > 0) {
Guillaume Jenkinseeb7007c2020-06-25 22:55:40739 NSDictionary* registration_defaults =
740 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
741 [defaults registerDefaults:registration_defaults];
742 }
743
sdefresne14900ee2015-11-27 14:43:21744 // Freeform commandline flags. These are added last, so that any flags added
745 // earlier in this function take precedence.
746 if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) {
747 base::CommandLine::StringVector flags;
748 // Append an empty "program" argument.
749 flags.push_back("");
750
751 // The number of flags corresponds to the number of text fields in
752 // Experimental.plist.
753 const int kNumFreeformFlags = 5;
754 for (int i = 1; i <= kNumFreeformFlags; ++i) {
755 NSString* key =
756 [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i];
757 NSString* flag = [defaults stringForKey:key];
758 if ([flag length]) {
Robbie Gibsonc91ce622019-05-20 14:44:33759 // iOS keyboard replaces -- with —, so undo that.
760 flag = [flag stringByReplacingOccurrencesOfString:@"—"
761 withString:@"--"
762 options:0
763 range:NSMakeRange(0, 1)];
764 // To make things easier, allow flags with no dashes by prepending them
765 // here. This also allows for flags that just have one dash if they
766 // exist.
767 if (![flag hasPrefix:@"-"]) {
768 flag = [@"--" stringByAppendingString:flag];
769 }
sdefresne14900ee2015-11-27 14:43:21770 flags.push_back(base::SysNSStringToUTF8(flag));
771 }
772 }
773
774 base::CommandLine temp_command_line(flags);
775 command_line->AppendArguments(temp_command_line, false);
776 }
msardafc76f662017-02-24 12:46:28777
justincohendacc85d2017-06-28 23:34:10778 // Populate command line flag for 3rd party keyboard omnibox workaround.
779 NSString* enableThirdPartyKeyboardWorkaround =
780 [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"];
781 if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) {
782 command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround);
783 } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) {
784 command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround);
785 }
786
msardafc76f662017-02-24 12:46:28787 ios::GetChromeBrowserProvider()->AppendSwitchesFromExperimentalSettings(
788 defaults, command_line);
sdefresne14900ee2015-11-27 14:43:21789}
790
sdefresne14900ee2015-11-27 14:43:21791void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage,
792 base::CommandLine* command_line) {
Sylvain Defresne8327a2f2019-01-17 14:19:18793 GetGlobalFlagsState().ConvertFlagsToSwitches(
sdefresnec9763902015-12-02 10:30:11794 flags_storage, command_line, flags_ui::kAddSentinels,
Gregory Chatzinofff6523722017-11-21 01:33:53795 switches::kEnableFeatures, switches::kDisableFeatures);
sdefresne14900ee2015-11-27 14:43:21796}
797
jkrcalbf073372016-07-29 07:21:31798std::vector<std::string> RegisterAllFeatureVariationParameters(
799 flags_ui::FlagsStorage* flags_storage,
800 base::FeatureList* feature_list) {
Justin Cohen2e2adb52019-10-25 17:00:02801 // Occasionally DCHECK crashes on canary can be very distuptive. An
802 // experimental flag was added to aid in temporarily disabling this for
803 // canary testers.
804#if defined(DCHECK_IS_CONFIGURABLE)
805 if (experimental_flags::AreDCHECKCrashesDisabled()) {
806 std::vector<base::FeatureList::FeatureOverrideInfo> overrides;
807 overrides.push_back(
808 {std::cref(base::kDCheckIsFatalFeature),
809 base::FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE});
810 feature_list->RegisterExtraFeatureOverrides(std::move(overrides));
811 }
812#endif // defined(DCHECK_IS_CONFIGURABLE)
813
Sylvain Defresne8327a2f2019-01-17 14:19:18814 return GetGlobalFlagsState().RegisterAllFeatureVariationParameters(
815 flags_storage, feature_list);
jkrcalbf073372016-07-29 07:21:31816}
817
sdefresne14900ee2015-11-27 14:43:21818void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage,
819 flags_ui::FlagAccess access,
820 base::ListValue* supported_entries,
821 base::ListValue* unsupported_entries) {
Sylvain Defresne8327a2f2019-01-17 14:19:18822 GetGlobalFlagsState().GetFlagFeatureEntries(
sdefresne14900ee2015-11-27 14:43:21823 flags_storage, access, supported_entries, unsupported_entries,
Renjie Tang208c8192020-11-03 00:46:51824 base::BindRepeating(&SkipConditionalFeatureEntry));
sdefresne14900ee2015-11-27 14:43:21825}
826
827void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage,
828 const std::string& internal_name,
829 bool enable) {
Sylvain Defresne8327a2f2019-01-17 14:19:18830 GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name,
831 enable);
sdefresne14900ee2015-11-27 14:43:21832}
833
834void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) {
Sylvain Defresne8327a2f2019-01-17 14:19:18835 GetGlobalFlagsState().ResetAllFlags(flags_storage);
sdefresne14900ee2015-11-27 14:43:21836}
837
838namespace testing {
839
840const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) {
kokihoon189a4022018-10-13 02:43:44841 *count = base::size(kFeatureEntries);
sdefresne14900ee2015-11-27 14:43:21842 return kFeatureEntries;
843}
844
845} // namespace testing