blob: 2760e5b12531349b60da8ceaf75485777d75eff3 [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"
Elly Fong-Jonesc3e9aea2019-10-24 19:44:1916#include "base/bind_helpers.h"
sdefresne14900ee2015-11-27 14:43:2117#include "base/command_line.h"
18#include "base/logging.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"
sdefresne14900ee2015-11-27 14:43:2128#include "components/dom_distiller/core/dom_distiller_switches.h"
Tommy Nyquistc1d6dea12017-07-26 20:37:2329#include "components/feature_engagement/public/feature_constants.h"
30#include "components/feature_engagement/public/feature_list.h"
sdefresne14900ee2015-11-27 14:43:2131#include "components/flags_ui/feature_entry.h"
32#include "components/flags_ui/feature_entry_macros.h"
33#include "components/flags_ui/flags_storage.h"
34#include "components/flags_ui/flags_ui_switches.h"
sczs27e389e2020-01-15 15:19:1835#include "components/infobars/core/infobar_feature.h"
Tanja Gornakb0985dd2018-10-11 17:24:4036#include "components/invalidation/impl/invalidation_switches.h"
noyau4cfb1332016-10-25 17:05:4237#include "components/ntp_tiles/switches.h"
Justin Donnelly33d712e2017-08-23 21:32:5138#include "components/omnibox/browser/omnibox_field_trial.h"
Tomasz Wiszkowskid938a1112019-03-06 18:01:5739#include "components/omnibox/common/omnibox_features.h"
Ioana Pandeled14ce9e2017-11-28 14:41:4640#include "components/password_manager/core/common/password_manager_features.h"
mathp9b4c11d2017-07-06 20:24:1341#include "components/payments/core/features.h"
Marc Treib5fc99e1f2017-11-08 12:19:1842#include "components/search_provider_logos/switches.h"
Emily Starkbafa9062017-12-27 15:22:4643#include "components/security_state/core/features.h"
Sébastien Séguin-Gagnondcb854b2019-04-10 16:36:4444#include "components/send_tab_to_self/features.h"
Valeriya Sinevicha79dc612018-09-25 14:49:0945#include "components/signin/core/browser/account_reconcilor.h"
Jérôme Lebelc374fdd2019-09-27 10:36:4846#include "components/signin/ios/browser/features.h"
Colin Blundell3517170e2019-07-11 08:16:3447#include "components/signin/public/base/signin_switches.h"
sdefresne36579782016-02-05 11:08:2548#include "components/strings/grit/components_strings.h"
Moe Ahmadid6d5d172018-06-20 17:20:2349#include "components/sync/driver/sync_driver_switches.h"
Moe Ahmadie4cce1f2018-12-18 23:48:0150#include "components/translate/core/browser/translate_prefs.h"
Chris Lu0683adf2019-02-26 15:56:4551#include "components/ukm/ios/features.h"
Sylvain Defresneae6987e2018-03-01 13:21:4052#include "ios/chrome/browser/browsing_data/browsing_data_features.h"
sdefresne14900ee2015-11-27 14:43:2153#include "ios/chrome/browser/chrome_switches.h"
Mike Doughertyb6c770d2019-09-13 22:56:4654#include "ios/chrome/browser/crash_report/breadcrumbs/features.h"
Olivier Robin2a898dc2018-10-31 14:37:0455#include "ios/chrome/browser/crash_report/crash_report_flags.h"
Jean-François Geyelin30be5912017-08-25 12:05:3856#include "ios/chrome/browser/drag_and_drop/drag_and_drop_flag.h"
Chris Lu77905ac2018-12-06 20:46:5157#include "ios/chrome/browser/find_in_page/features.h"
Nazerke21bdc45a2019-07-11 09:02:0558#include "ios/chrome/browser/flags/ios_chrome_flag_descriptions.h"
David Jean7d0bff12019-04-01 08:21:1459#include "ios/chrome/browser/passwords/password_manager_features.h"
Gauthier Ambard33e03302019-02-21 13:28:5860#include "ios/chrome/browser/system_flags.h"
Kurt Horimoto9165404a2018-11-13 23:48:1261#import "ios/chrome/browser/ui/dialogs/dialog_features.h"
Kurt Horimoto4da682b022018-04-12 07:43:3562#import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h"
sczs80a6f462018-12-05 20:37:1863#import "ios/chrome/browser/ui/infobars/infobar_feature.h"
Gauthier Ambardf2247baa2020-01-06 19:16:3464#import "ios/chrome/browser/ui/page_info/features.h"
Tanisha Mandre549612ea2019-07-17 11:36:1565#include "ios/chrome/browser/ui/settings/autofill/features.h"
sczs76b9ba02019-07-23 23:34:3066#import "ios/chrome/browser/ui/table_view/feature_flags.h"
Mark Cogan02ed6c772018-05-31 17:00:5167#import "ios/chrome/browser/ui/toolbar/public/features.h"
Kurt Horimoto79d590b2018-09-12 19:09:2868#import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h"
Justin Cohen2d81c582018-01-22 14:46:4469#include "ios/chrome/browser/ui/ui_feature_flags.h"
Yi Su392b3032018-06-05 07:26:4770#include "ios/chrome/browser/web/features.h"
sdefresne14900ee2015-11-27 14:43:2171#include "ios/chrome/grit/ios_strings.h"
msardafc76f662017-02-24 12:46:2872#include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
Eugene But61818bc2019-04-15 21:04:0773#include "ios/web/common/features.h"
Eugene Bute79f2742019-07-26 17:07:2274#include "ios/web/common/user_agent.h"
Eugene Butb1416232019-07-22 17:31:5875#include "ios/web/common/web_view_creation_util.h"
sdefresne14900ee2015-11-27 14:43:2176
77#if !defined(OFFICIAL_BUILD)
78#include "components/variations/variations_switches.h"
vitaliii489217aa2017-01-30 14:50:2279#endif
stkhapuginc1be1792016-12-13 14:30:5380
81#if !defined(__has_feature) || !__has_feature(objc_arc)
82#error "This file requires ARC support."
83#endif
sdefresne14900ee2015-11-27 14:43:2184
elawrence816f6790e2017-06-16 18:19:2885using flags_ui::FeatureEntry;
86
sdefresne14900ee2015-11-27 14:43:2187namespace {
Emily Starkbafa9062017-12-27 15:22:4688
89const FeatureEntry::FeatureParam kMarkHttpAsDangerous[] = {
90 {security_state::features::kMarkHttpAsFeatureParameterName,
91 security_state::features::kMarkHttpAsParameterDangerous}};
Emily Starkbafa9062017-12-27 15:22:4692const FeatureEntry::FeatureParam kMarkHttpAsWarningAndDangerousOnFormEdits[] = {
93 {security_state::features::kMarkHttpAsFeatureParameterName,
94 security_state::features::
95 kMarkHttpAsParameterWarningAndDangerousOnFormEdits}};
Livvie Linc8a9ed462019-10-29 01:06:5096const FeatureEntry::FeatureParam kMarkHttpAsDangerWarning[] = {
97 {security_state::features::kMarkHttpAsFeatureParameterName,
98 security_state::features::kMarkHttpAsParameterDangerWarning}};
Emily Starkbafa9062017-12-27 15:22:4699
100const FeatureEntry::FeatureVariation kMarkHttpAsFeatureVariations[] = {
101 {"(mark as actively dangerous)", kMarkHttpAsDangerous,
kokihoon189a4022018-10-13 02:43:44102 base::size(kMarkHttpAsDangerous), nullptr},
Emily Starkbafa9062017-12-27 15:22:46103 {"(mark with a Not Secure warning and dangerous on form edits)",
104 kMarkHttpAsWarningAndDangerousOnFormEdits,
Livvie Linc8a9ed462019-10-29 01:06:50105 base::size(kMarkHttpAsWarningAndDangerousOnFormEdits), nullptr},
106 {"(mark with a grey triangle icon)", kMarkHttpAsDangerWarning,
107 base::size(kMarkHttpAsDangerWarning), nullptr}};
elawrence816f6790e2017-06-16 18:19:28108
Marc Treib5fc99e1f2017-11-08 12:19:18109const FeatureEntry::Choice kUseDdljsonApiChoices[] = {
110 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
111 {"(force test doodle 0)", search_provider_logos::switches::kGoogleDoodleUrl,
112 "https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios0.json"},
113 {"(force test doodle 1)", search_provider_logos::switches::kGoogleDoodleUrl,
114 "https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios1.json"},
115 {"(force test doodle 2)", search_provider_logos::switches::kGoogleDoodleUrl,
116 "https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios2.json"},
117 {"(force test doodle 3)", search_provider_logos::switches::kGoogleDoodleUrl,
118 "https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios3.json"},
119 {"(force test doodle 4)", search_provider_logos::switches::kGoogleDoodleUrl,
120 "https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios4.json"},
121};
Marc Treib2752e8b2017-08-04 14:12:09122
Olivier Robin3d60411622018-02-23 10:03:22123const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = {
124 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
125 {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"},
126 {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"},
127 {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"},
128 {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"},
129 {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"},
130 {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"},
131 {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"},
132 {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"},
133};
134
Ce Chen104a5382019-12-10 01:09:05135const FeatureEntry::FeatureParam kOmniboxOnDeviceHeadSuggestAlwaysServe[] = {
136 {OmniboxFieldTrial::kOnDeviceHeadSuggestIncognitoServeMode,
137 "always-serve"}};
138const FeatureEntry::FeatureParam kOmniboxOnDeviceHeadSuggestIncognitoOnly[] = {
139 {OmniboxFieldTrial::kOnDeviceHeadSuggestIncognitoServeMode,
140 "incognito-only"}};
141const FeatureEntry::FeatureVariation
142 kOmniboxOnDeviceHeadSuggestIncognitoVariations[] = {
143 {"both-normal-and-incognito", kOmniboxOnDeviceHeadSuggestAlwaysServe,
144 base::size(kOmniboxOnDeviceHeadSuggestAlwaysServe), nullptr},
145 {"incognito-only", kOmniboxOnDeviceHeadSuggestIncognitoOnly,
146 base::size(kOmniboxOnDeviceHeadSuggestIncognitoOnly), nullptr}};
147
Stepan Khapugincc4e9842019-01-23 13:38:13148const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = {
149 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}};
150const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = {
151 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}};
152const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = {
153 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}};
154const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = {
155 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}};
156const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = {
157 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}};
158const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = {
159 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}};
160const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = {
161 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}};
162
163const FeatureEntry::FeatureVariation
164 kOmniboxUIMaxAutocompleteMatchesVariations[] = {
165 {"3 matches", kOmniboxUIMaxAutocompleteMatches3,
166 base::size(kOmniboxUIMaxAutocompleteMatches3), nullptr},
167 {"4 matches", kOmniboxUIMaxAutocompleteMatches4,
168 base::size(kOmniboxUIMaxAutocompleteMatches4), nullptr},
169 {"5 matches", kOmniboxUIMaxAutocompleteMatches5,
170 base::size(kOmniboxUIMaxAutocompleteMatches5), nullptr},
171 {"6 matches", kOmniboxUIMaxAutocompleteMatches6,
172 base::size(kOmniboxUIMaxAutocompleteMatches6), nullptr},
173 {"8 matches", kOmniboxUIMaxAutocompleteMatches8,
174 base::size(kOmniboxUIMaxAutocompleteMatches8), nullptr},
175 {"10 matches", kOmniboxUIMaxAutocompleteMatches10,
176 base::size(kOmniboxUIMaxAutocompleteMatches10), nullptr},
177 {"12 matches", kOmniboxUIMaxAutocompleteMatches12,
178 base::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}};
179
Gauthier Ambard2392f2a2018-10-24 16:33:27180const FeatureEntry::FeatureParam kIconForSearchButtonGrey[] = {
181 {kIconForSearchButtonFeatureParameterName,
182 kIconForSearchButtonParameterGrey}};
183const FeatureEntry::FeatureParam kIconForSearchButtonColorful[] = {
184 {kIconForSearchButtonFeatureParameterName,
185 kIconForSearchButtonParameterColorful}};
186const FeatureEntry::FeatureParam kIconForSearchButtonMagnifying[] = {
187 {kIconForSearchButtonFeatureParameterName,
188 kIconForSearchButtonParameterMagnifying}};
189
190const FeatureEntry::FeatureVariation kIconForSearchButtonVariations[] = {
191 {"Grey search engine logo", kIconForSearchButtonGrey,
192 base::size(kIconForSearchButtonGrey), nullptr},
193 {"Colorful search engine logo", kIconForSearchButtonColorful,
194 base::size(kIconForSearchButtonColorful), nullptr},
195 {"Magnifying glass", kIconForSearchButtonMagnifying,
196 base::size(kIconForSearchButtonMagnifying), nullptr}};
197
Olivier Robince9386ebd2018-11-29 09:07:38198const FeatureEntry::FeatureParam kDetectMainThreadFreezeTimeout3s[] = {
199 {crash_report::kDetectMainThreadFreezeParameterName,
200 crash_report::kDetectMainThreadFreezeParameter3s}};
201const FeatureEntry::FeatureParam kDetectMainThreadFreezeTimeout5s[] = {
202 {crash_report::kDetectMainThreadFreezeParameterName,
203 crash_report::kDetectMainThreadFreezeParameter5s}};
204const FeatureEntry::FeatureParam kDetectMainThreadFreezeTimeout7s[] = {
205 {crash_report::kDetectMainThreadFreezeParameterName,
206 crash_report::kDetectMainThreadFreezeParameter7s}};
207const FeatureEntry::FeatureParam kDetectMainThreadFreezeTimeout9s[] = {
208 {crash_report::kDetectMainThreadFreezeParameterName,
209 crash_report::kDetectMainThreadFreezeParameter9s}};
210
211const FeatureEntry::FeatureVariation kDetectMainThreadFreezeVariations[] = {
212 {"3s", kDetectMainThreadFreezeTimeout3s,
213 base::size(kDetectMainThreadFreezeTimeout3s), nullptr},
214 {"5s", kDetectMainThreadFreezeTimeout5s,
215 base::size(kDetectMainThreadFreezeTimeout5s), nullptr},
216 {"7s", kDetectMainThreadFreezeTimeout7s,
217 base::size(kDetectMainThreadFreezeTimeout7s), nullptr},
218 {"9s", kDetectMainThreadFreezeTimeout9s,
219 base::size(kDetectMainThreadFreezeTimeout9s), nullptr}};
220
Caitlin Fischer37e01232019-05-24 13:05:45221const FeatureEntry::FeatureParam
222 kAutofillUseMobileLabelDisambiguationShowAll[] = {
223 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
224 autofill::features::
225 kAutofillUseMobileLabelDisambiguationParameterShowAll}};
226const FeatureEntry::FeatureParam
227 kAutofillUseMobileLabelDisambiguationShowOne[] = {
228 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
229 autofill::features::
230 kAutofillUseMobileLabelDisambiguationParameterShowOne}};
231
232const FeatureEntry::FeatureVariation
233 kAutofillUseMobileLabelDisambiguationVariations[] = {
234 {"(show all)", kAutofillUseMobileLabelDisambiguationShowAll,
235 base::size(kAutofillUseMobileLabelDisambiguationShowAll), nullptr},
236 {"(show one)", kAutofillUseMobileLabelDisambiguationShowOne,
237 base::size(kAutofillUseMobileLabelDisambiguationShowOne), nullptr}};
238
Cooper Knaak1e026562017-07-26 05:22:28239// To add a new entry, add to the end of kFeatureEntries. There are four
sdefresne14900ee2015-11-27 14:43:21240// distinct types of entries:
Cooper Knaak1e026562017-07-26 05:22:28241// . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the
242// default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE
sdefresne14900ee2015-11-27 14:43:21243// macro for this type supplying the command line to the macro.
244// . MULTI_VALUE: a list of choices, the first of which should correspond to a
245// deactivated state for this lab (i.e. no command line option). To specify
246// this type of entry use the macro MULTI_VALUE_TYPE supplying it the
247// array of choices.
Cooper Knaak1e026562017-07-26 05:22:28248// . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is
249// either enabled, disabled, or uses the default value of the associated
250// base::Feature instance. To specify this type of entry use the macro
251// FEATURE_VALUE_TYPE supplying it the base::Feature instance.
252// . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a
253// base::Feature instance. Choices corresponding to the default state, a
254// universally enabled state, and a universally disabled state are
255// automatically included. To specify this type of entry use the macro
256// FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and
257// the array of choices.
258//
sdefresne14900ee2015-11-27 14:43:21259// See the documentation of FeatureEntry for details on the fields.
260//
261// When adding a new choice, add it to the end of the list.
262const flags_ui::FeatureEntry kFeatureEntries[] = {
Emily Starkbafa9062017-12-27 15:22:46263 {"enable-mark-http-as", flag_descriptions::kMarkHttpAsName,
elawrence816f6790e2017-06-16 18:19:28264 flag_descriptions::kMarkHttpAsDescription, flags_ui::kOsIos,
Emily Starkbafa9062017-12-27 15:22:46265 FEATURE_WITH_PARAMS_VALUE_TYPE(
266 security_state::features::kMarkHttpAsFeature,
267 kMarkHttpAsFeatureVariations,
268 "MarkHttpAs")},
Cooper Knaak1e026562017-07-26 05:22:28269 {"in-product-help-demo-mode-choice",
270 flag_descriptions::kInProductHelpDemoModeName,
271 flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos,
272 FEATURE_WITH_PARAMS_VALUE_TYPE(
Tommy Nyquistc1d6dea12017-07-26 20:37:23273 feature_engagement::kIPHDemoMode,
274 feature_engagement::kIPHDemoModeChoiceVariations,
Marc Treib2752e8b2017-08-04 14:12:09275 "IPH_DemoMode")},
276 {"use-ddljson-api", flag_descriptions::kUseDdljsonApiName,
277 flag_descriptions::kUseDdljsonApiDescription, flags_ui::kOsIos,
Marc Treib5fc99e1f2017-11-08 12:19:18278 MULTI_VALUE_TYPE(kUseDdljsonApiChoices)},
Jean-François Geyelin30be5912017-08-25 12:05:38279 {"drag_and_drop", flag_descriptions::kDragAndDropName,
280 flag_descriptions::kDragAndDropDescription, flags_ui::kOsIos,
Rohit Rao6a3a481d2017-09-25 19:31:41281 FEATURE_VALUE_TYPE(kDragAndDrop)},
Eugene But468b6d5f02018-10-18 21:17:45282 {"ignores-viewport-scale-limits",
283 flag_descriptions::kIgnoresViewportScaleLimitsName,
284 flag_descriptions::kIgnoresViewportScaleLimitsDescription,
285 flags_ui::kOsIos,
286 FEATURE_VALUE_TYPE(web::features::kIgnoresViewportScaleLimits)},
Moe Ahmadic3fd7cd2018-05-11 21:40:22287 {"enable-autofill-credit-card-upload",
288 flag_descriptions::kAutofillCreditCardUploadName,
289 flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos,
Anne Lim579b5732018-08-30 18:24:24290 FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)},
Himanshu Jajue760efb2019-10-17 11:07:53291 {"enable-sync-device-info-in-transport-mode",
292 flag_descriptions::kSyncDeviceInfoInTransportModeName,
293 flag_descriptions::kSyncDeviceInfoInTransportModeDescription,
294 flags_ui::kOsIos,
295 FEATURE_VALUE_TYPE(switches::kSyncDeviceInfoInTransportMode)},
Moe Ahmadid6d5d172018-06-20 17:20:23296 {"use-sync-sandbox", flag_descriptions::kSyncSandboxName,
297 flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos,
298 SINGLE_VALUE_TYPE_AND_VALUE(
299 switches::kSyncServiceURL,
300 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")},
301 {"wallet-service-use-sandbox",
302 flag_descriptions::kWalletServiceUseSandboxName,
303 flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos,
304 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
305 autofill::switches::kWalletServiceUseSandbox,
306 "1",
307 autofill::switches::kWalletServiceUseSandbox,
308 "0")},
Mohamad Ahmadic4df81f2017-12-20 04:41:59309 {"show-autofill-type-predictions",
310 flag_descriptions::kShowAutofillTypePredictionsName,
311 flag_descriptions::kShowAutofillTypePredictionsDescription,
312 flags_ui::kOsIos,
Gauthier Ambardcfd85182018-01-05 10:37:46313 FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)},
Olivier Robin3d60411622018-02-23 10:03:22314 {"autofill-ios-delay-between-fields",
315 flag_descriptions::kAutofillIOSDelayBetweenFieldsName,
316 flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription,
317 flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)},
Olivier Robind81475b02018-06-20 21:30:11318 {"autofill-show-all-profiles-on-prefilled-forms",
319 flag_descriptions::kAutofillShowAllSuggestionsOnPrefilledFormsName,
320 flag_descriptions::kAutofillShowAllSuggestionsOnPrefilledFormsDescription,
321 flags_ui::kOsIos,
322 FEATURE_VALUE_TYPE(
323 autofill::features::kAutofillShowAllSuggestionsOnPrefilledForms)},
Moe Ahmadid3ddfcb2018-04-20 19:51:08324 {"autofill-restrict-formless-form-extraction",
325 flag_descriptions::kAutofillRestrictUnownedFieldsToFormlessCheckoutName,
326 flag_descriptions::
327 kAutofillRestrictUnownedFieldsToFormlessCheckoutDescription,
328 flags_ui::kOsIos,
329 FEATURE_VALUE_TYPE(
330 autofill::features::kAutofillRestrictUnownedFieldsToFormlessCheckout)},
Roger McFarlanee193ab122018-11-22 20:55:07331 {"autofill-rich-metadata-queries",
332 flag_descriptions::kAutofillRichMetadataQueriesName,
333 flag_descriptions::kAutofillRichMetadataQueriesDescription,
334 flags_ui::kOsIos,
335 FEATURE_VALUE_TYPE(autofill::features::kAutofillRichMetadataQueries)},
Kurt Horimotodc33af32018-05-01 01:39:14336 {"fullscreen-viewport-adjustment-experiment",
Chris Lu481a9322019-09-25 22:16:53337 flag_descriptions::kFullscreenSmoothScrollingName,
338 flag_descriptions::kFullscreenSmoothScrollingDescription, flags_ui::kOsIos,
339 FEATURE_VALUE_TYPE(fullscreen::features::kSmoothScrollingDefault)},
Roger McFarlane1a37d7b2018-04-20 22:45:19340 {"autofill-enforce-min-required-fields-for-heuristics",
341 flag_descriptions::kAutofillEnforceMinRequiredFieldsForHeuristicsName,
342 flag_descriptions::
343 kAutofillEnforceMinRequiredFieldsForHeuristicsDescription,
344 flags_ui::kOsIos,
345 FEATURE_VALUE_TYPE(
346 autofill::features::kAutofillEnforceMinRequiredFieldsForHeuristics)},
347 {"autofill-enforce-min-required-fields-for-query",
348 flag_descriptions::kAutofillEnforceMinRequiredFieldsForQueryName,
349 flag_descriptions::kAutofillEnforceMinRequiredFieldsForQueryDescription,
350 flags_ui::kOsIos,
351 FEATURE_VALUE_TYPE(
352 autofill::features::kAutofillEnforceMinRequiredFieldsForQuery)},
353 {"autofill-enforce-min-required-fields-for-upload",
354 flag_descriptions::kAutofillEnforceMinRequiredFieldsForUploadName,
355 flag_descriptions::kAutofillEnforceMinRequiredFieldsForUploadDescription,
356 flags_ui::kOsIos,
357 FEATURE_VALUE_TYPE(
358 autofill::features::kAutofillEnforceMinRequiredFieldsForUpload)},
Roger McFarlane2eceba982018-05-18 01:37:11359 {"autofill-cache-query-responses",
360 flag_descriptions::kAutofillCacheQueryResponsesName,
361 flag_descriptions::kAutofillCacheQueryResponsesDescription,
362 flags_ui::kOsIos,
363 FEATURE_VALUE_TYPE(autofill::features::kAutofillCacheQueryResponses)},
Jeffrey Cohen05cdafa392018-08-15 20:49:17364 {"autofill-enable-company-name",
365 flag_descriptions::kAutofillEnableCompanyNameName,
366 flag_descriptions::kAutofillEnableCompanyNameDescription, flags_ui::kOsIos,
367 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableCompanyName)},
Yi Su392b3032018-06-05 07:26:47368 {"webpage-text-accessibility",
369 flag_descriptions::kWebPageTextAccessibilityName,
370 flag_descriptions::kWebPageTextAccessibilityDescription, flags_ui::kOsIos,
371 FEATURE_VALUE_TYPE(web::kWebPageTextAccessibility)},
Kurt Horimoto79d590b2018-09-12 19:09:28372 {"toolbar-container", flag_descriptions::kToolbarContainerName,
373 flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos,
374 FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)},
Ce Chen20af01c2019-07-02 19:16:36375 {"omnibox-on-device-head-suggestions",
376 flag_descriptions::kOmniboxOnDeviceHeadSuggestionsName,
377 flag_descriptions::kOmniboxOnDeviceHeadSuggestionsDescription,
Ce Chen104a5382019-12-10 01:09:05378 flags_ui::kOsIos,
379 FEATURE_WITH_PARAMS_VALUE_TYPE(
380 omnibox::kOnDeviceHeadProvider,
381 kOmniboxOnDeviceHeadSuggestIncognitoVariations,
382 "OmniboxOnDeviceHeadSuggestIOS")},
Stepan Khapugincc4e9842019-01-23 13:38:13383 {"omnibox-ui-max-autocomplete-matches",
384 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName,
385 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription,
386 flags_ui::kOsIos,
387 FEATURE_WITH_PARAMS_VALUE_TYPE(
388 omnibox::kUIExperimentMaxAutocompleteMatches,
389 kOmniboxUIMaxAutocompleteMatchesVariations,
390 "OmniboxUIMaxAutocompleteVariations")},
Gauthier Ambard2392f2a2018-10-24 16:33:27391 {"search-icon-toggle", flag_descriptions::kSearchIconToggleName,
392 flag_descriptions::kSearchIconToggleDescription, flags_ui::kOsIos,
393 FEATURE_WITH_PARAMS_VALUE_TYPE(kIconForSearchButtonFeature,
394 kIconForSearchButtonVariations,
395 "ToggleSearchButtonIcon")},
Olivier Robin2a898dc2018-10-31 14:37:04396 {"enable-breakpad-upload-no-delay",
397 flag_descriptions::kBreakpadNoDelayInitialUploadName,
398 flag_descriptions::kBreakpadNoDelayInitialUploadDescription,
399 flags_ui::kOsIos,
400 FEATURE_VALUE_TYPE(crash_report::kBreakpadNoDelayInitialUpload)},
Kurt Horimoto9165404a2018-11-13 23:48:12401 {"non-modal-dialogs", flag_descriptions::kNonModalDialogsName,
402 flag_descriptions::kNonModalDialogsDescription, flags_ui::kOsIos,
403 FEATURE_VALUE_TYPE(dialogs::kNonModalDialogs)},
Olivier Robince9386ebd2018-11-29 09:07:38404 {"detect-main-thread-freeze",
405 flag_descriptions::kDetectMainThreadFreezeName,
406 flag_descriptions::kDetectMainThreadFreezeDescription, flags_ui::kOsIos,
407 FEATURE_WITH_PARAMS_VALUE_TYPE(crash_report::kDetectMainThreadFreeze,
408 kDetectMainThreadFreezeVariations,
409 "DetectMainThreadFreeze")},
sczs80a6f462018-12-05 20:37:18410 {"infobar-ui-reboot", flag_descriptions::kInfobarUIRebootName,
411 flag_descriptions::kInfobarUIRebootDescription, flags_ui::kOsIos,
sczs27e389e2020-01-15 15:19:18412 FEATURE_VALUE_TYPE(kIOSInfobarUIReboot)},
Chris Lu77905ac2018-12-06 20:46:51413 {"find-in-page-iframe", flag_descriptions::kFindInPageiFrameName,
414 flag_descriptions::kFindInPageiFrameDescription, flags_ui::kOsIos,
415 FEATURE_VALUE_TYPE(kFindInPageiFrame)},
Robbie Gibson80d732e2019-01-10 10:42:49416 {"enable-clipboard-provider-text-suggestions",
417 flag_descriptions::kEnableClipboardProviderTextSuggestionsName,
418 flag_descriptions::kEnableClipboardProviderTextSuggestionsDescription,
419 flags_ui::kOsIos,
420 FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProviderTextSuggestions)},
421 {"enable-clipboard-provider-image-suggestions",
422 flag_descriptions::kEnableClipboardProviderImageSuggestionsName,
423 flag_descriptions::kEnableClipboardProviderImageSuggestionsDescription,
424 flags_ui::kOsIos,
425 FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProviderImageSuggestions)},
edchin5ae0b4c2019-01-06 06:52:28426 {"snapshot-draw-view", flag_descriptions::kSnapshotDrawViewName,
427 flag_descriptions::kSnapshotDrawViewDescription, flags_ui::kOsIos,
428 FEATURE_VALUE_TYPE(kSnapshotDrawView)},
Justin Cohen20b6f072019-01-16 01:38:50429#if defined(DCHECK_IS_CONFIGURABLE)
430 {"dcheck-is-fatal", flag_descriptions::kDcheckIsFatalName,
431 flag_descriptions::kDcheckIsFatalDescription, flags_ui::kOsIos,
432 FEATURE_VALUE_TYPE(base::kDCheckIsFatalFeature)},
433#endif // defined(DCHECK_IS_CONFIGURABLE)
Gauthier Ambard5f610862019-01-17 11:43:55434 {"settings-refresh", flag_descriptions::kSettingsRefreshName,
435 flag_descriptions::kSettingsRefreshDescription, flags_ui::kOsIos,
436 FEATURE_VALUE_TYPE(kSettingsRefresh)},
Justin Cohencd633af2019-01-29 20:19:00437 {"browser-container-keeps-content-view",
438 flag_descriptions::kBrowserContainerKeepsContentViewName,
439 flag_descriptions::kBrowserContainerKeepsContentViewDescription,
440 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kBrowserContainerKeepsContentView)},
Gauthier Ambardef4442a2019-02-15 11:14:42441 {"web-clear-browsing-data", flag_descriptions::kWebClearBrowsingDataName,
442 flag_descriptions::kWebClearBrowsingDataDescription, flags_ui::kOsIos,
Gauthier Ambard33e03302019-02-21 13:28:58443 FEATURE_VALUE_TYPE(kWebClearBrowsingData)},
Chris Lu8153e6e2019-03-26 16:28:21444 {"send-uma-cellular", flag_descriptions::kSendUmaOverAnyNetwork,
445 flag_descriptions::kSendUmaOverAnyNetworkDescription, flags_ui::kOsIos,
Chris Lu0683adf2019-02-26 15:56:45446 FEATURE_VALUE_TYPE(kUmaCellular)},
Mohamed Amir Yosef79feb7752019-03-04 09:49:37447 {"enable-sync-uss-passwords",
448 flag_descriptions::kEnableSyncUSSPasswordsName,
449 flag_descriptions::kEnableSyncUSSPasswordsDescription, flags_ui::kOsIos,
450 FEATURE_VALUE_TYPE(switches::kSyncUSSPasswords)},
Jared Saul8c224932019-03-12 15:01:18451 {"autofill-no-local-save-on-upload-success",
452 flag_descriptions::kAutofillNoLocalSaveOnUploadSuccessName,
453 flag_descriptions::kAutofillNoLocalSaveOnUploadSuccessDescription,
454 flags_ui::kOsIos,
455 FEATURE_VALUE_TYPE(
456 autofill::features::kAutofillNoLocalSaveOnUploadSuccess)},
Jared Saul63f598a12019-03-22 23:40:26457 {"autofill-no-local-save-on-unmask-success",
458 flag_descriptions::kAutofillNoLocalSaveOnUnmaskSuccessName,
459 flag_descriptions::kAutofillNoLocalSaveOnUnmaskSuccessDescription,
460 flags_ui::kOsIos,
461 FEATURE_VALUE_TYPE(
462 autofill::features::kAutofillNoLocalSaveOnUnmaskSuccess)},
Stepan Khapugin13b7427a2019-04-02 13:17:54463 {"new-omnibox-popup-layout", flag_descriptions::kNewOmniboxPopupLayoutName,
464 flag_descriptions::kNewOmniboxPopupLayoutDescription, flags_ui::kOsIos,
465 FEATURE_VALUE_TYPE(kNewOmniboxPopupLayout)},
Nazerke4179c0e2019-04-11 15:43:34466 {"omnibox-use-default-search-engine-favicon",
467 flag_descriptions::kOmniboxUseDefaultSearchEngineFaviconName,
468 flag_descriptions::kOmniboxUseDefaultSearchEngineFaviconDescription,
469 flags_ui::kOsIos,
470 FEATURE_VALUE_TYPE(kOmniboxUseDefaultSearchEngineFavicon)},
Robbie Gibson5cf28c6a2019-11-22 18:26:37471 {"omnibox-preserve-default-match-against-async-update",
472 flag_descriptions::kOmniboxPreserveDefaultMatchAgainstAsyncUpdateName,
473 flag_descriptions::
474 kOmniboxPreserveDefaultMatchAgainstAsyncUpdateDescription,
475 flags_ui::kOsIos,
476 FEATURE_VALUE_TYPE(
477 omnibox::kOmniboxPreserveDefaultMatchAgainstAsyncUpdate)},
Sébastien Séguin-Gagnon30481922019-04-24 21:31:00478 {"enable-send-tab-to-self-broadcast",
479 flag_descriptions::kSendTabToSelfBroadcastName,
480 flag_descriptions::kSendTabToSelfBroadcastDescription, flags_ui::kOsIos,
481 FEATURE_VALUE_TYPE(send_tab_to_self::kSendTabToSelfBroadcast)},
Caitlin Fischer43edd90a2019-05-01 13:24:30482 {"autofill-use-mobile-label-disambiguation",
483 flag_descriptions::kAutofillUseMobileLabelDisambiguationName,
484 flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription,
485 flags_ui::kOsIos,
Caitlin Fischer37e01232019-05-24 13:05:45486 FEATURE_WITH_PARAMS_VALUE_TYPE(
487 autofill::features::kAutofillUseMobileLabelDisambiguation,
488 kAutofillUseMobileLabelDisambiguationVariations,
489 "AutofillUseMobileLabelDisambiguation")},
Caitlin Fischer6d609542019-05-01 21:59:21490 {"enable-autofill-prune-suggestions",
491 flag_descriptions::kAutofillPruneSuggestionsName,
492 flag_descriptions::kAutofillPruneSuggestionsDescription, flags_ui::kOsIos,
493 FEATURE_VALUE_TYPE(autofill::features::kAutofillPruneSuggestions)},
Gauthier Ambard4d42f39d2019-06-24 13:05:33494 {"toolbar-new-tab-button", flag_descriptions::kToolbarNewTabButtonName,
495 flag_descriptions::kToolbarNewTabButtonDescription, flags_ui::kOsIos,
496 FEATURE_VALUE_TYPE(kToolbarNewTabButton)},
Maksim Moskvitin35b09c1bf2019-06-28 17:29:48497 {"enable-sync-uss-nigori", flag_descriptions::kEnableSyncUSSNigoriName,
498 flag_descriptions::kEnableSyncUSSNigoriDescription, flags_ui::kOsIos,
499 FEATURE_VALUE_TYPE(switches::kSyncUSSNigori)},
sczs76b9ba02019-07-23 23:34:30500 {"collections-card-presentation-style",
501 flag_descriptions::kCollectionsCardPresentationStyleName,
502 flag_descriptions::kCollectionsCardPresentationStyleDescription,
503 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kCollectionsCardPresentationStyle)},
Jared Saul3f520c62019-09-03 23:58:12504 {"enable-autofill-credit-card-upload-editable-cardholder-name",
505 flag_descriptions::
506 kEnableAutofillCreditCardUploadEditableCardholderNameName,
507 flag_descriptions::
508 kEnableAutofillCreditCardUploadEditableCardholderNameDescription,
509 flags_ui::kOsIos,
510 FEATURE_VALUE_TYPE(
511 autofill::features::kAutofillUpstreamEditableCardholderName)},
512 {"enable-autofill-credit-card-upload-editable-expiration-date",
513 flag_descriptions::
514 kEnableAutofillCreditCardUploadEditableExpirationDateName,
515 flag_descriptions::
516 kEnableAutofillCreditCardUploadEditableExpirationDateDescription,
517 flags_ui::kOsIos,
518 FEATURE_VALUE_TYPE(
519 autofill::features::kAutofillUpstreamEditableExpirationDate)},
Tanisha Mandre3a14d382019-09-05 17:33:44520 {"credit-card-scanner", flag_descriptions::kCreditCardScannerName,
521 flag_descriptions::kCreditCardScannerDescription, flags_ui::kOsIos,
522 FEATURE_VALUE_TYPE(kCreditCardScanner)},
Mike Doughertyb6c770d2019-09-13 22:56:46523 {"ios-breadcrumbs", flag_descriptions::kLogBreadcrumbsName,
524 flag_descriptions::kLogBreadcrumbsDescription, flags_ui::kOsIos,
525 FEATURE_VALUE_TYPE(kLogBreadcrumbs)},
Ioana Pandele0a74f422019-09-25 12:27:45526 {"password-leak-detection", flag_descriptions::kPasswordLeakDetectionName,
527 flag_descriptions::kPasswordLeakDetectionDescription, flags_ui::kOsIos,
528 FEATURE_VALUE_TYPE(password_manager::features::kLeakDetection)},
Jérôme Lebelc374fdd2019-09-27 10:36:48529 {"force-startup-signin-promo",
530 flag_descriptions::kForceStartupSigninPromoName,
531 flag_descriptions::kForceStartupSigninPromoDescription, flags_ui::kOsIos,
532 FEATURE_VALUE_TYPE(signin::kForceStartupSigninPromo)},
Justin Cohenc57413a2019-09-30 19:42:29533 {"embedder-block-restore-url",
534 flag_descriptions::kEmbedderBlockRestoreUrlName,
535 flag_descriptions::kEmbedderBlockRestoreUrlDescription, flags_ui::kOsIos,
536 FEATURE_VALUE_TYPE(kEmbedderBlockRestoreUrl)},
sczs6c3202e2019-10-01 00:22:46537 {"messages-confirm-infobars",
538 flag_descriptions::kConfirmInfobarMessagesUIName,
539 flag_descriptions::kConfirmInfobarMessagesUIDescription, flags_ui::kOsIos,
540 FEATURE_VALUE_TYPE(kConfirmInfobarMessagesUI)},
David Jeana9bf62b2019-10-04 11:53:36541 {"disable-animation-on-low-battery",
542 flag_descriptions::kDisableAnimationOnLowBatteryName,
543 flag_descriptions::kDisableAnimationOnLowBatteryDescription,
544 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDisableAnimationOnLowBattery)},
sczs004fa6c2019-10-18 17:22:52545 {"messages-save-card-infobar",
546 flag_descriptions::kSaveCardInfobarMessagesUIName,
547 flag_descriptions::kSaveCardInfobarMessagesUIDescription, flags_ui::kOsIos,
548 FEATURE_VALUE_TYPE(kSaveCardInfobarMessagesUI)},
Chris Lu4cc111b452019-10-18 22:18:48549 {"messages-translate-infobar",
550 flag_descriptions::kTranslateInfobarMessagesUIName,
551 flag_descriptions::kTranslateInfobarMessagesUIDescription,
552 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kTranslateInfobarMessagesUI)},
Yi Sued66a312019-10-24 13:36:08553 {"use-WKWebView-loading", flag_descriptions::kUseWKWebViewLoadingName,
554 flag_descriptions::kUseWKWebViewLoadingDescription, flags_ui::kOsIos,
555 FEATURE_VALUE_TYPE(web::features::kUseWKWebViewLoading)},
sczs4622e6e2019-11-06 01:17:59556 {"autofill-save-card-dismiss-on-navigation",
557 flag_descriptions::kAutofillSaveCardDismissOnNavigationName,
558 flag_descriptions::kAutofillSaveCardDismissOnNavigationDescription,
559 flags_ui::kOsIos,
560 FEATURE_VALUE_TYPE(
561 autofill::features::kAutofillSaveCardDismissOnNavigation)},
Ewann6674c132019-11-06 11:20:41562 {"enable-persistent-downloads",
563 flag_descriptions::kEnablePersistentDownloadsName,
564 flag_descriptions::kEnablePersistentDownloadsDescription, flags_ui::kOsIos,
565 FEATURE_VALUE_TYPE(web::features::kEnablePersistentDownloads)},
Rohit Raoe7b489312019-11-12 12:28:55566 {"force-unstacked-tabstrip", flag_descriptions::kForceUnstackedTabstripName,
567 flag_descriptions::kForceUnstackedTabstripDescription, flags_ui::kOsIos,
568 FEATURE_VALUE_TYPE(kForceUnstackedTabstrip)},
Gauthier Ambard93914002019-11-14 12:56:12569 {"use-js-error-page", flag_descriptions::kUseJSForErrorPageName,
570 flag_descriptions::kUseJSForErrorPageDescription, flags_ui::kOsIos,
571 FEATURE_VALUE_TYPE(web::features::kUseJSForErrorPage)},
Javier Ernesto Flores Robles73cf70ab2019-11-15 14:34:07572 {"messages-download-infobar",
573 flag_descriptions::kDownloadInfobarMessagesUIName,
574 flag_descriptions::kDownloadInfobarMessagesUIDescription, flags_ui::kOsIos,
575 FEATURE_VALUE_TYPE(kDownloadInfobarMessagesUI)},
Gauthier Ambardbde9def2019-11-19 18:04:33576 {"desktop-version-default", flag_descriptions::kDefaultToDesktopOnIPadName,
577 flag_descriptions::kDefaultToDesktopOnIPadDescription, flags_ui::kOsIos,
Gauthier Ambard054175f2019-12-16 11:54:09578 FEATURE_VALUE_TYPE(web::features::kUseDefaultUserAgentInWebClient)},
Gauthier Ambardbde9def2019-11-19 18:04:33579 {"mobile-google-srp", flag_descriptions::kMobileGoogleSRPName,
580 flag_descriptions::kMobileGoogleSRPDescription, flags_ui::kOsIos,
581 FEATURE_VALUE_TYPE(web::kMobileGoogleSRP)},
sczs3bede8282019-11-27 14:16:54582 {"messages-crash-restore-infobars",
583 flag_descriptions::kCrashRestoreInfobarMessagesUIName,
584 flag_descriptions::kCrashRestoreInfobarMessagesUIDescription,
585 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kCrashRestoreInfobarMessagesUI)},
Kurt Horimotod754e8ec2019-12-03 20:54:02586 {"infobar-overlay-ui", flag_descriptions::kInfobarOverlayUIName,
587 flag_descriptions::kInfobarOverlayUIDescription, flags_ui::kOsIos,
588 FEATURE_VALUE_TYPE(kInfobarOverlayUI)},
sczs391ebba2019-12-05 06:59:30589 {"autofill-save-card-infobar-edit-support",
590 flag_descriptions::kAutofillSaveCardInfobarEditSupportName,
591 flag_descriptions::kAutofillSaveCardInfobarEditSupportDescription,
592 flags_ui::kOsIos,
593 FEATURE_VALUE_TYPE(
594 autofill::features::kAutofillSaveCardInfobarEditSupport)},
Gauthier Ambardcd302c42019-12-11 09:56:50595 {"reload-sad-tab", flag_descriptions::kReloadSadTabName,
596 flag_descriptions::kReloadSadTabDescription, flags_ui::kOsIos,
597 FEATURE_VALUE_TYPE(web::kReloadSadTab)},
Gauthier Ambardf2247baa2020-01-06 19:16:34598 {"page-info-refactoring", flag_descriptions::kPageInfoRefactoringName,
599 flag_descriptions::kPageInfoRefactoringDescription, flags_ui::kOsIos,
Gauthier Ambarde813c07f2020-01-09 10:18:49600 FEATURE_VALUE_TYPE(kPageInfoRefactoring)},
601 {"contained-browser-bvc", flag_descriptions::kContainedBVCName,
602 flag_descriptions::kContainedBVCDescription, flags_ui::kOsIos,
603 FEATURE_VALUE_TYPE(kContainedBVC)},
Nohemi Fernandez6b6260a2020-01-17 16:53:45604 {"clear-synced-data", flag_descriptions::kClearSyncedDataName,
605 flag_descriptions::kClearSyncedDataDescription, flags_ui::kOsIos,
606 FEATURE_VALUE_TYPE(kClearSyncedData)},
Gauthier Ambarde813c07f2020-01-09 10:18:49607};
sdefresne14900ee2015-11-27 14:43:21608
609// Add all switches from experimental flags to |command_line|.
610void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) {
611 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
612
sdefresne14900ee2015-11-27 14:43:21613 // Set the UA flag if UseMobileSafariUA is enabled.
614 if ([defaults boolForKey:@"UseMobileSafariUA"]) {
615 // Safari uses "Vesion/", followed by the OS version excluding bugfix, where
616 // Chrome puts its product token.
avi571943672015-12-22 02:12:49617 int32_t major = 0;
618 int32_t minor = 0;
619 int32_t bugfix = 0;
sdefresne14900ee2015-11-27 14:43:21620 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix);
621 std::string product = base::StringPrintf("Version/%d.%d", major, minor);
622
Gauthier Ambard22945482019-11-29 14:02:21623 command_line->AppendSwitchASCII(
624 switches::kUserAgent,
625 web::BuildUserAgentFromProduct(web::UserAgentType::MOBILE, product));
sdefresne14900ee2015-11-27 14:43:21626 }
627
628 // Freeform commandline flags. These are added last, so that any flags added
629 // earlier in this function take precedence.
630 if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) {
631 base::CommandLine::StringVector flags;
632 // Append an empty "program" argument.
633 flags.push_back("");
634
635 // The number of flags corresponds to the number of text fields in
636 // Experimental.plist.
637 const int kNumFreeformFlags = 5;
638 for (int i = 1; i <= kNumFreeformFlags; ++i) {
639 NSString* key =
640 [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i];
641 NSString* flag = [defaults stringForKey:key];
642 if ([flag length]) {
Robbie Gibsonc91ce622019-05-20 14:44:33643 // iOS keyboard replaces -- with —, so undo that.
644 flag = [flag stringByReplacingOccurrencesOfString:@"—"
645 withString:@"--"
646 options:0
647 range:NSMakeRange(0, 1)];
648 // To make things easier, allow flags with no dashes by prepending them
649 // here. This also allows for flags that just have one dash if they
650 // exist.
651 if (![flag hasPrefix:@"-"]) {
652 flag = [@"--" stringByAppendingString:flag];
653 }
sdefresne14900ee2015-11-27 14:43:21654 flags.push_back(base::SysNSStringToUTF8(flag));
655 }
656 }
657
658 base::CommandLine temp_command_line(flags);
659 command_line->AppendArguments(temp_command_line, false);
660 }
msardafc76f662017-02-24 12:46:28661
justincohendacc85d2017-06-28 23:34:10662 // Populate command line flag for 3rd party keyboard omnibox workaround.
663 NSString* enableThirdPartyKeyboardWorkaround =
664 [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"];
665 if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) {
666 command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround);
667 } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) {
668 command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround);
669 }
670
msardafc76f662017-02-24 12:46:28671 ios::GetChromeBrowserProvider()->AppendSwitchesFromExperimentalSettings(
672 defaults, command_line);
sdefresne14900ee2015-11-27 14:43:21673}
674
675bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
676 return false;
677}
678
Sylvain Defresne8327a2f2019-01-17 14:19:18679flags_ui::FlagsState& GetGlobalFlagsState() {
Elly Fong-Jones3cd75282019-11-12 20:26:50680 static base::NoDestructor<flags_ui::FlagsState> flags_state(kFeatureEntries,
681 nullptr);
Sylvain Defresne8327a2f2019-01-17 14:19:18682 return *flags_state;
683}
sdefresne14900ee2015-11-27 14:43:21684} // namespace
685
686void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage,
687 base::CommandLine* command_line) {
Gregory Chatzinoff31305112017-12-20 21:56:02688 AppendSwitchesFromExperimentalSettings(command_line);
Sylvain Defresne8327a2f2019-01-17 14:19:18689 GetGlobalFlagsState().ConvertFlagsToSwitches(
sdefresnec9763902015-12-02 10:30:11690 flags_storage, command_line, flags_ui::kAddSentinels,
Gregory Chatzinofff6523722017-11-21 01:33:53691 switches::kEnableFeatures, switches::kDisableFeatures);
sdefresne14900ee2015-11-27 14:43:21692}
693
jkrcalbf073372016-07-29 07:21:31694std::vector<std::string> RegisterAllFeatureVariationParameters(
695 flags_ui::FlagsStorage* flags_storage,
696 base::FeatureList* feature_list) {
Justin Cohen2e2adb52019-10-25 17:00:02697 // Occasionally DCHECK crashes on canary can be very distuptive. An
698 // experimental flag was added to aid in temporarily disabling this for
699 // canary testers.
700#if defined(DCHECK_IS_CONFIGURABLE)
701 if (experimental_flags::AreDCHECKCrashesDisabled()) {
702 std::vector<base::FeatureList::FeatureOverrideInfo> overrides;
703 overrides.push_back(
704 {std::cref(base::kDCheckIsFatalFeature),
705 base::FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE});
706 feature_list->RegisterExtraFeatureOverrides(std::move(overrides));
707 }
708#endif // defined(DCHECK_IS_CONFIGURABLE)
709
Sylvain Defresne8327a2f2019-01-17 14:19:18710 return GetGlobalFlagsState().RegisterAllFeatureVariationParameters(
711 flags_storage, feature_list);
jkrcalbf073372016-07-29 07:21:31712}
713
sdefresne14900ee2015-11-27 14:43:21714void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage,
715 flags_ui::FlagAccess access,
716 base::ListValue* supported_entries,
717 base::ListValue* unsupported_entries) {
Sylvain Defresne8327a2f2019-01-17 14:19:18718 GetGlobalFlagsState().GetFlagFeatureEntries(
sdefresne14900ee2015-11-27 14:43:21719 flags_storage, access, supported_entries, unsupported_entries,
720 base::Bind(&SkipConditionalFeatureEntry));
721}
722
723void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage,
724 const std::string& internal_name,
725 bool enable) {
Sylvain Defresne8327a2f2019-01-17 14:19:18726 GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name,
727 enable);
sdefresne14900ee2015-11-27 14:43:21728}
729
730void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) {
Sylvain Defresne8327a2f2019-01-17 14:19:18731 GetGlobalFlagsState().ResetAllFlags(flags_storage);
sdefresne14900ee2015-11-27 14:43:21732}
733
734namespace testing {
735
736const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) {
kokihoon189a4022018-10-13 02:43:44737 *count = base::size(kFeatureEntries);
sdefresne14900ee2015-11-27 14:43:21738 return kFeatureEntries;
739}
740
741} // namespace testing