blob: 58a98db9fe344362a0659da5797d2f0dc0b0e314 [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"
Ali Juma01ca4ff2020-03-19 15:53:1142#include "components/safe_browsing/core/features.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"
Mikel Astize2678da22020-04-02 20:55:0450#include "components/sync/engine/sync_engine_switches.h"
Moe Ahmadie4cce1f2018-12-18 23:48:0151#include "components/translate/core/browser/translate_prefs.h"
Chris Lu0683adf2019-02-26 15:56:4552#include "components/ukm/ios/features.h"
Sylvain Defresneae6987e2018-03-01 13:21:4053#include "ios/chrome/browser/browsing_data/browsing_data_features.h"
sdefresne14900ee2015-11-27 14:43:2154#include "ios/chrome/browser/chrome_switches.h"
Mike Doughertyb6c770d2019-09-13 22:56:4655#include "ios/chrome/browser/crash_report/breadcrumbs/features.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"
edchin68696842020-04-09 17:19:3160#include "ios/chrome/browser/policy/policy_features.h"
Gauthier Ambard33e03302019-02-21 13:28:5861#include "ios/chrome/browser/system_flags.h"
Ewann93ce65c2020-03-05 16:47:1362#import "ios/chrome/browser/ui/download/features.h"
Kurt Horimoto4da682b022018-04-12 07:43:3563#import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h"
sczs80a6f462018-12-05 20:37:1864#import "ios/chrome/browser/ui/infobars/infobar_feature.h"
Gauthier Ambardf2247baa2020-01-06 19:16:3465#import "ios/chrome/browser/ui/page_info/features.h"
Tanisha Mandre549612ea2019-07-17 11:36:1566#include "ios/chrome/browser/ui/settings/autofill/features.h"
sczs76b9ba02019-07-23 23:34:3067#import "ios/chrome/browser/ui/table_view/feature_flags.h"
Mark Cogan02ed6c772018-05-31 17:00:5168#import "ios/chrome/browser/ui/toolbar/public/features.h"
Kurt Horimoto79d590b2018-09-12 19:09:2869#import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h"
Justin Cohen2d81c582018-01-22 14:46:4470#include "ios/chrome/browser/ui/ui_feature_flags.h"
Yi Su392b3032018-06-05 07:26:4771#include "ios/chrome/browser/web/features.h"
sdefresne14900ee2015-11-27 14:43:2172#include "ios/chrome/grit/ios_strings.h"
msardafc76f662017-02-24 12:46:2873#include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
Eugene But61818bc2019-04-15 21:04:0774#include "ios/web/common/features.h"
Eugene Bute79f2742019-07-26 17:07:2275#include "ios/web/common/user_agent.h"
Eugene Butb1416232019-07-22 17:31:5876#include "ios/web/common/web_view_creation_util.h"
sdefresne14900ee2015-11-27 14:43:2177
78#if !defined(OFFICIAL_BUILD)
79#include "components/variations/variations_switches.h"
vitaliii489217aa2017-01-30 14:50:2280#endif
stkhapuginc1be1792016-12-13 14:30:5381
82#if !defined(__has_feature) || !__has_feature(objc_arc)
83#error "This file requires ARC support."
84#endif
sdefresne14900ee2015-11-27 14:43:2185
elawrence816f6790e2017-06-16 18:19:2886using flags_ui::FeatureEntry;
87
sdefresne14900ee2015-11-27 14:43:2188namespace {
Emily Starkbafa9062017-12-27 15:22:4689
90const FeatureEntry::FeatureParam kMarkHttpAsDangerous[] = {
91 {security_state::features::kMarkHttpAsFeatureParameterName,
92 security_state::features::kMarkHttpAsParameterDangerous}};
Emily Starkbafa9062017-12-27 15:22:4693const FeatureEntry::FeatureParam kMarkHttpAsWarningAndDangerousOnFormEdits[] = {
94 {security_state::features::kMarkHttpAsFeatureParameterName,
95 security_state::features::
96 kMarkHttpAsParameterWarningAndDangerousOnFormEdits}};
Livvie Linc8a9ed462019-10-29 01:06:5097const FeatureEntry::FeatureParam kMarkHttpAsDangerWarning[] = {
98 {security_state::features::kMarkHttpAsFeatureParameterName,
99 security_state::features::kMarkHttpAsParameterDangerWarning}};
Emily Starkbafa9062017-12-27 15:22:46100
101const FeatureEntry::FeatureVariation kMarkHttpAsFeatureVariations[] = {
102 {"(mark as actively dangerous)", kMarkHttpAsDangerous,
kokihoon189a4022018-10-13 02:43:44103 base::size(kMarkHttpAsDangerous), nullptr},
Emily Starkbafa9062017-12-27 15:22:46104 {"(mark with a Not Secure warning and dangerous on form edits)",
105 kMarkHttpAsWarningAndDangerousOnFormEdits,
Livvie Linc8a9ed462019-10-29 01:06:50106 base::size(kMarkHttpAsWarningAndDangerousOnFormEdits), nullptr},
107 {"(mark with a grey triangle icon)", kMarkHttpAsDangerWarning,
108 base::size(kMarkHttpAsDangerWarning), nullptr}};
elawrence816f6790e2017-06-16 18:19:28109
Olivier Robin3d60411622018-02-23 10:03:22110const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = {
111 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
112 {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"},
113 {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"},
114 {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"},
115 {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"},
116 {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"},
117 {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"},
118 {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"},
119 {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"},
120};
121
Ce Chen104a5382019-12-10 01:09:05122const FeatureEntry::FeatureParam kOmniboxOnDeviceHeadSuggestAlwaysServe[] = {
123 {OmniboxFieldTrial::kOnDeviceHeadSuggestIncognitoServeMode,
124 "always-serve"}};
125const FeatureEntry::FeatureParam kOmniboxOnDeviceHeadSuggestIncognitoOnly[] = {
126 {OmniboxFieldTrial::kOnDeviceHeadSuggestIncognitoServeMode,
127 "incognito-only"}};
Ce Chena30d2302020-02-08 02:22:19128const FeatureEntry::FeatureParam kOmniboxOnDeviceHeadSuggestRelevance1000[] = {
129 {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput, "1000"},
130 {OmniboxFieldTrial::kOnDeviceHeadSuggestDemoteMode, "decrease-relevances"}};
131const FeatureEntry::FeatureParam
132 kOmniboxOnDeviceHeadSuggestIncognitoOnlyRelevance1000[] = {
133 {OmniboxFieldTrial::kOnDeviceHeadSuggestIncognitoServeMode,
134 "incognito-only"},
135 {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput,
136 "1000"}};
137const FeatureEntry::FeatureParam kOmniboxOnDeviceHeadSuggestDelay200Ms[] = {
138 {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs, "200"}};
139const FeatureEntry::FeatureParam kOmniboxOnDeviceHeadSuggestDelay350Ms[] = {
140 {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs, "350"}};
141const FeatureEntry::FeatureParam
142 kOmniboxOnDeviceHeadSuggestDelay200MsAndRelevance1000[] = {
143 {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs, "200"},
144 {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput, "1000"},
145 {OmniboxFieldTrial::kOnDeviceHeadSuggestDemoteMode,
146 "decrease-relevances"}};
147const FeatureEntry::FeatureParam
148 kOmniboxOnDeviceHeadSuggestDelay350MsAndRelevance1000[] = {
149 {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs, "350"},
150 {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput, "1000"},
151 {OmniboxFieldTrial::kOnDeviceHeadSuggestDemoteMode,
152 "decrease-relevances"}};
153
Ce Chen104a5382019-12-10 01:09:05154const FeatureEntry::FeatureVariation
Ce Chena30d2302020-02-08 02:22:19155 kOmniboxOnDeviceHeadSuggestExperimentVariations[] = {
Ce Chen104a5382019-12-10 01:09:05156 {"both-normal-and-incognito", kOmniboxOnDeviceHeadSuggestAlwaysServe,
157 base::size(kOmniboxOnDeviceHeadSuggestAlwaysServe), nullptr},
158 {"incognito-only", kOmniboxOnDeviceHeadSuggestIncognitoOnly,
Ce Chena30d2302020-02-08 02:22:19159 base::size(kOmniboxOnDeviceHeadSuggestIncognitoOnly), nullptr},
160 {"relevance-1000", kOmniboxOnDeviceHeadSuggestRelevance1000,
161 base::size(kOmniboxOnDeviceHeadSuggestRelevance1000), nullptr},
162 {"incognito-only-relevance-1000",
163 kOmniboxOnDeviceHeadSuggestIncognitoOnlyRelevance1000,
164 base::size(kOmniboxOnDeviceHeadSuggestIncognitoOnlyRelevance1000),
165 nullptr},
166 {"request-delay-200ms", kOmniboxOnDeviceHeadSuggestDelay200Ms,
167 base::size(kOmniboxOnDeviceHeadSuggestDelay200Ms), nullptr},
168 {"request-delay-350ms", kOmniboxOnDeviceHeadSuggestDelay350Ms,
169 base::size(kOmniboxOnDeviceHeadSuggestDelay350Ms), nullptr},
170 {"delay-200ms-relevance-1000",
171 kOmniboxOnDeviceHeadSuggestDelay200MsAndRelevance1000,
172 base::size(kOmniboxOnDeviceHeadSuggestDelay200MsAndRelevance1000),
173 nullptr},
174 {"delay-350ms-relevance-1000",
175 kOmniboxOnDeviceHeadSuggestDelay350MsAndRelevance1000,
176 base::size(kOmniboxOnDeviceHeadSuggestDelay350MsAndRelevance1000),
177 nullptr}};
Ce Chen104a5382019-12-10 01:09:05178
Robbie Gibson6436fc42020-02-19 10:58:19179const FeatureEntry::FeatureParam kOmniboxNTPZPSRemote[] = {
180 {"ZeroSuggestVariant:1:*", "RemoteNoUrl"},
181 {"ZeroSuggestVariant:7:*", "RemoteNoUrl"},
182 {"ZeroSuggestVariant:8:*", "RemoteNoUrl"}};
183
184const FeatureEntry::FeatureVariation kOmniboxOnFocusSuggestionsVariations[] = {
185 {"ZPS on NTP: Remote History", kOmniboxNTPZPSRemote,
186 base::size(kOmniboxNTPZPSRemote), "t3316653" /* variation_id */},
187};
188
Stepan Khapugincc4e9842019-01-23 13:38:13189const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = {
190 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}};
191const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = {
192 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}};
193const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = {
194 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}};
195const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = {
196 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}};
197const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = {
198 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}};
199const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = {
200 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}};
201const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = {
202 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}};
203
204const FeatureEntry::FeatureVariation
205 kOmniboxUIMaxAutocompleteMatchesVariations[] = {
206 {"3 matches", kOmniboxUIMaxAutocompleteMatches3,
207 base::size(kOmniboxUIMaxAutocompleteMatches3), nullptr},
208 {"4 matches", kOmniboxUIMaxAutocompleteMatches4,
209 base::size(kOmniboxUIMaxAutocompleteMatches4), nullptr},
210 {"5 matches", kOmniboxUIMaxAutocompleteMatches5,
211 base::size(kOmniboxUIMaxAutocompleteMatches5), nullptr},
212 {"6 matches", kOmniboxUIMaxAutocompleteMatches6,
213 base::size(kOmniboxUIMaxAutocompleteMatches6), nullptr},
214 {"8 matches", kOmniboxUIMaxAutocompleteMatches8,
215 base::size(kOmniboxUIMaxAutocompleteMatches8), nullptr},
216 {"10 matches", kOmniboxUIMaxAutocompleteMatches10,
217 base::size(kOmniboxUIMaxAutocompleteMatches10), nullptr},
218 {"12 matches", kOmniboxUIMaxAutocompleteMatches12,
219 base::size(kOmniboxUIMaxAutocompleteMatches12), 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")},
Jean-François Geyelin30be5912017-08-25 12:05:38276 {"drag_and_drop", flag_descriptions::kDragAndDropName,
277 flag_descriptions::kDragAndDropDescription, flags_ui::kOsIos,
Rohit Rao6a3a481d2017-09-25 19:31:41278 FEATURE_VALUE_TYPE(kDragAndDrop)},
Eugene But468b6d5f02018-10-18 21:17:45279 {"ignores-viewport-scale-limits",
280 flag_descriptions::kIgnoresViewportScaleLimitsName,
281 flag_descriptions::kIgnoresViewportScaleLimitsDescription,
282 flags_ui::kOsIos,
283 FEATURE_VALUE_TYPE(web::features::kIgnoresViewportScaleLimits)},
Moe Ahmadic3fd7cd2018-05-11 21:40:22284 {"enable-autofill-credit-card-upload",
285 flag_descriptions::kAutofillCreditCardUploadName,
286 flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos,
Anne Lim579b5732018-08-30 18:24:24287 FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)},
Himanshu Jajue760efb2019-10-17 11:07:53288 {"enable-sync-device-info-in-transport-mode",
289 flag_descriptions::kSyncDeviceInfoInTransportModeName,
290 flag_descriptions::kSyncDeviceInfoInTransportModeDescription,
291 flags_ui::kOsIos,
292 FEATURE_VALUE_TYPE(switches::kSyncDeviceInfoInTransportMode)},
Moe Ahmadid6d5d172018-06-20 17:20:23293 {"use-sync-sandbox", flag_descriptions::kSyncSandboxName,
294 flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos,
295 SINGLE_VALUE_TYPE_AND_VALUE(
296 switches::kSyncServiceURL,
297 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")},
298 {"wallet-service-use-sandbox",
299 flag_descriptions::kWalletServiceUseSandboxName,
300 flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos,
301 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
302 autofill::switches::kWalletServiceUseSandbox,
303 "1",
304 autofill::switches::kWalletServiceUseSandbox,
305 "0")},
Mohamad Ahmadic4df81f2017-12-20 04:41:59306 {"show-autofill-type-predictions",
307 flag_descriptions::kShowAutofillTypePredictionsName,
308 flag_descriptions::kShowAutofillTypePredictionsDescription,
309 flags_ui::kOsIos,
Gauthier Ambardcfd85182018-01-05 10:37:46310 FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)},
Olivier Robin3d60411622018-02-23 10:03:22311 {"autofill-ios-delay-between-fields",
312 flag_descriptions::kAutofillIOSDelayBetweenFieldsName,
313 flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription,
314 flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)},
Olivier Robind81475b02018-06-20 21:30:11315 {"autofill-show-all-profiles-on-prefilled-forms",
316 flag_descriptions::kAutofillShowAllSuggestionsOnPrefilledFormsName,
317 flag_descriptions::kAutofillShowAllSuggestionsOnPrefilledFormsDescription,
318 flags_ui::kOsIos,
319 FEATURE_VALUE_TYPE(
320 autofill::features::kAutofillShowAllSuggestionsOnPrefilledForms)},
Moe Ahmadid3ddfcb2018-04-20 19:51:08321 {"autofill-restrict-formless-form-extraction",
322 flag_descriptions::kAutofillRestrictUnownedFieldsToFormlessCheckoutName,
323 flag_descriptions::
324 kAutofillRestrictUnownedFieldsToFormlessCheckoutDescription,
325 flags_ui::kOsIos,
326 FEATURE_VALUE_TYPE(
327 autofill::features::kAutofillRestrictUnownedFieldsToFormlessCheckout)},
Roger McFarlanee193ab122018-11-22 20:55:07328 {"autofill-rich-metadata-queries",
329 flag_descriptions::kAutofillRichMetadataQueriesName,
330 flag_descriptions::kAutofillRichMetadataQueriesDescription,
331 flags_ui::kOsIos,
332 FEATURE_VALUE_TYPE(autofill::features::kAutofillRichMetadataQueries)},
Kurt Horimotodc33af32018-05-01 01:39:14333 {"fullscreen-viewport-adjustment-experiment",
Chris Lu481a9322019-09-25 22:16:53334 flag_descriptions::kFullscreenSmoothScrollingName,
335 flag_descriptions::kFullscreenSmoothScrollingDescription, flags_ui::kOsIos,
336 FEATURE_VALUE_TYPE(fullscreen::features::kSmoothScrollingDefault)},
Roger McFarlane1a37d7b2018-04-20 22:45:19337 {"autofill-enforce-min-required-fields-for-heuristics",
338 flag_descriptions::kAutofillEnforceMinRequiredFieldsForHeuristicsName,
339 flag_descriptions::
340 kAutofillEnforceMinRequiredFieldsForHeuristicsDescription,
341 flags_ui::kOsIos,
342 FEATURE_VALUE_TYPE(
343 autofill::features::kAutofillEnforceMinRequiredFieldsForHeuristics)},
344 {"autofill-enforce-min-required-fields-for-query",
345 flag_descriptions::kAutofillEnforceMinRequiredFieldsForQueryName,
346 flag_descriptions::kAutofillEnforceMinRequiredFieldsForQueryDescription,
347 flags_ui::kOsIos,
348 FEATURE_VALUE_TYPE(
349 autofill::features::kAutofillEnforceMinRequiredFieldsForQuery)},
350 {"autofill-enforce-min-required-fields-for-upload",
351 flag_descriptions::kAutofillEnforceMinRequiredFieldsForUploadName,
352 flag_descriptions::kAutofillEnforceMinRequiredFieldsForUploadDescription,
353 flags_ui::kOsIos,
354 FEATURE_VALUE_TYPE(
355 autofill::features::kAutofillEnforceMinRequiredFieldsForUpload)},
Roger McFarlane2eceba982018-05-18 01:37:11356 {"autofill-cache-query-responses",
357 flag_descriptions::kAutofillCacheQueryResponsesName,
358 flag_descriptions::kAutofillCacheQueryResponsesDescription,
359 flags_ui::kOsIos,
360 FEATURE_VALUE_TYPE(autofill::features::kAutofillCacheQueryResponses)},
Jeffrey Cohen05cdafa392018-08-15 20:49:17361 {"autofill-enable-company-name",
362 flag_descriptions::kAutofillEnableCompanyNameName,
363 flag_descriptions::kAutofillEnableCompanyNameDescription, flags_ui::kOsIos,
364 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableCompanyName)},
Yi Su392b3032018-06-05 07:26:47365 {"webpage-text-accessibility",
366 flag_descriptions::kWebPageTextAccessibilityName,
367 flag_descriptions::kWebPageTextAccessibilityDescription, flags_ui::kOsIos,
368 FEATURE_VALUE_TYPE(web::kWebPageTextAccessibility)},
Kurt Horimoto79d590b2018-09-12 19:09:28369 {"toolbar-container", flag_descriptions::kToolbarContainerName,
370 flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos,
371 FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)},
Ce Chen20af01c2019-07-02 19:16:36372 {"omnibox-on-device-head-suggestions",
373 flag_descriptions::kOmniboxOnDeviceHeadSuggestionsName,
374 flag_descriptions::kOmniboxOnDeviceHeadSuggestionsDescription,
Ce Chen104a5382019-12-10 01:09:05375 flags_ui::kOsIos,
376 FEATURE_WITH_PARAMS_VALUE_TYPE(
377 omnibox::kOnDeviceHeadProvider,
Ce Chena30d2302020-02-08 02:22:19378 kOmniboxOnDeviceHeadSuggestExperimentVariations,
Ce Chen104a5382019-12-10 01:09:05379 "OmniboxOnDeviceHeadSuggestIOS")},
Robbie Gibson6436fc42020-02-19 10:58:19380 {"omnibox-on-focus-suggestions",
381 flag_descriptions::kOmniboxOnFocusSuggestionsName,
382 flag_descriptions::kOmniboxOnFocusSuggestionsDescription, flags_ui::kOsIos,
383 FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kOnFocusSuggestions,
384 kOmniboxOnFocusSuggestionsVariations,
Robbie Gibson58a38772020-04-21 13:51:51385 "OmniboxBundledExperimentV1")},
Stepan Khapugincc4e9842019-01-23 13:38:13386 {"omnibox-ui-max-autocomplete-matches",
387 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName,
388 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription,
389 flags_ui::kOsIos,
390 FEATURE_WITH_PARAMS_VALUE_TYPE(
391 omnibox::kUIExperimentMaxAutocompleteMatches,
392 kOmniboxUIMaxAutocompleteMatchesVariations,
393 "OmniboxUIMaxAutocompleteVariations")},
sczs80a6f462018-12-05 20:37:18394 {"infobar-ui-reboot", flag_descriptions::kInfobarUIRebootName,
395 flag_descriptions::kInfobarUIRebootDescription, flags_ui::kOsIos,
sczs27e389e2020-01-15 15:19:18396 FEATURE_VALUE_TYPE(kIOSInfobarUIReboot)},
Chris Lu77905ac2018-12-06 20:46:51397 {"find-in-page-iframe", flag_descriptions::kFindInPageiFrameName,
398 flag_descriptions::kFindInPageiFrameDescription, flags_ui::kOsIos,
399 FEATURE_VALUE_TYPE(kFindInPageiFrame)},
Robbie Gibson80d732e2019-01-10 10:42:49400 {"enable-clipboard-provider-image-suggestions",
401 flag_descriptions::kEnableClipboardProviderImageSuggestionsName,
402 flag_descriptions::kEnableClipboardProviderImageSuggestionsDescription,
403 flags_ui::kOsIos,
404 FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProviderImageSuggestions)},
edchin5ae0b4c2019-01-06 06:52:28405 {"snapshot-draw-view", flag_descriptions::kSnapshotDrawViewName,
406 flag_descriptions::kSnapshotDrawViewDescription, flags_ui::kOsIos,
407 FEATURE_VALUE_TYPE(kSnapshotDrawView)},
Justin Cohen20b6f072019-01-16 01:38:50408#if defined(DCHECK_IS_CONFIGURABLE)
409 {"dcheck-is-fatal", flag_descriptions::kDcheckIsFatalName,
410 flag_descriptions::kDcheckIsFatalDescription, flags_ui::kOsIos,
411 FEATURE_VALUE_TYPE(base::kDCheckIsFatalFeature)},
412#endif // defined(DCHECK_IS_CONFIGURABLE)
Gauthier Ambard5f610862019-01-17 11:43:55413 {"settings-refresh", flag_descriptions::kSettingsRefreshName,
414 flag_descriptions::kSettingsRefreshDescription, flags_ui::kOsIos,
415 FEATURE_VALUE_TYPE(kSettingsRefresh)},
Chris Lu8153e6e2019-03-26 16:28:21416 {"send-uma-cellular", flag_descriptions::kSendUmaOverAnyNetwork,
417 flag_descriptions::kSendUmaOverAnyNetworkDescription, flags_ui::kOsIos,
Chris Lu0683adf2019-02-26 15:56:45418 FEATURE_VALUE_TYPE(kUmaCellular)},
Jared Saul8c224932019-03-12 15:01:18419 {"autofill-no-local-save-on-upload-success",
420 flag_descriptions::kAutofillNoLocalSaveOnUploadSuccessName,
421 flag_descriptions::kAutofillNoLocalSaveOnUploadSuccessDescription,
422 flags_ui::kOsIos,
423 FEATURE_VALUE_TYPE(
424 autofill::features::kAutofillNoLocalSaveOnUploadSuccess)},
Jared Saul63f598a12019-03-22 23:40:26425 {"autofill-no-local-save-on-unmask-success",
426 flag_descriptions::kAutofillNoLocalSaveOnUnmaskSuccessName,
427 flag_descriptions::kAutofillNoLocalSaveOnUnmaskSuccessDescription,
428 flags_ui::kOsIos,
429 FEATURE_VALUE_TYPE(
430 autofill::features::kAutofillNoLocalSaveOnUnmaskSuccess)},
Robbie Gibson5cf28c6a2019-11-22 18:26:37431 {"omnibox-preserve-default-match-against-async-update",
432 flag_descriptions::kOmniboxPreserveDefaultMatchAgainstAsyncUpdateName,
433 flag_descriptions::
434 kOmniboxPreserveDefaultMatchAgainstAsyncUpdateDescription,
435 flags_ui::kOsIos,
436 FEATURE_VALUE_TYPE(
437 omnibox::kOmniboxPreserveDefaultMatchAgainstAsyncUpdate)},
Sébastien Séguin-Gagnon30481922019-04-24 21:31:00438 {"enable-send-tab-to-self-broadcast",
439 flag_descriptions::kSendTabToSelfBroadcastName,
440 flag_descriptions::kSendTabToSelfBroadcastDescription, flags_ui::kOsIos,
441 FEATURE_VALUE_TYPE(send_tab_to_self::kSendTabToSelfBroadcast)},
Caitlin Fischer43edd90a2019-05-01 13:24:30442 {"autofill-use-mobile-label-disambiguation",
443 flag_descriptions::kAutofillUseMobileLabelDisambiguationName,
444 flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription,
445 flags_ui::kOsIos,
Caitlin Fischer37e01232019-05-24 13:05:45446 FEATURE_WITH_PARAMS_VALUE_TYPE(
447 autofill::features::kAutofillUseMobileLabelDisambiguation,
448 kAutofillUseMobileLabelDisambiguationVariations,
449 "AutofillUseMobileLabelDisambiguation")},
edchinb5d92582020-03-11 15:26:11450 {"autofill-prune-suggestions",
Caitlin Fischer6d609542019-05-01 21:59:21451 flag_descriptions::kAutofillPruneSuggestionsName,
452 flag_descriptions::kAutofillPruneSuggestionsDescription, flags_ui::kOsIos,
453 FEATURE_VALUE_TYPE(autofill::features::kAutofillPruneSuggestions)},
Mikel Astize2678da22020-04-02 20:55:04454 {"enable-sync-trusted-vault",
455 flag_descriptions::kEnableSyncTrustedVaultName,
456 flag_descriptions::kEnableSyncTrustedVaultDescription, flags_ui::kOsIos,
457 FEATURE_VALUE_TYPE(switches::kSyncSupportTrustedVaultPassphrase)},
Maksim Moskvitin35b09c1bf2019-06-28 17:29:48458 {"enable-sync-uss-nigori", flag_descriptions::kEnableSyncUSSNigoriName,
459 flag_descriptions::kEnableSyncUSSNigoriDescription, flags_ui::kOsIos,
460 FEATURE_VALUE_TYPE(switches::kSyncUSSNigori)},
sczs76b9ba02019-07-23 23:34:30461 {"collections-card-presentation-style",
462 flag_descriptions::kCollectionsCardPresentationStyleName,
463 flag_descriptions::kCollectionsCardPresentationStyleDescription,
464 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kCollectionsCardPresentationStyle)},
Jared Saul3f520c62019-09-03 23:58:12465 {"enable-autofill-credit-card-upload-editable-expiration-date",
466 flag_descriptions::
467 kEnableAutofillCreditCardUploadEditableExpirationDateName,
468 flag_descriptions::
469 kEnableAutofillCreditCardUploadEditableExpirationDateDescription,
470 flags_ui::kOsIos,
471 FEATURE_VALUE_TYPE(
472 autofill::features::kAutofillUpstreamEditableExpirationDate)},
Tanisha Mandre3a14d382019-09-05 17:33:44473 {"credit-card-scanner", flag_descriptions::kCreditCardScannerName,
474 flag_descriptions::kCreditCardScannerDescription, flags_ui::kOsIos,
475 FEATURE_VALUE_TYPE(kCreditCardScanner)},
Mike Doughertyb6c770d2019-09-13 22:56:46476 {"ios-breadcrumbs", flag_descriptions::kLogBreadcrumbsName,
477 flag_descriptions::kLogBreadcrumbsDescription, flags_ui::kOsIos,
478 FEATURE_VALUE_TYPE(kLogBreadcrumbs)},
Jérôme Lebelc374fdd2019-09-27 10:36:48479 {"force-startup-signin-promo",
480 flag_descriptions::kForceStartupSigninPromoName,
481 flag_descriptions::kForceStartupSigninPromoDescription, flags_ui::kOsIos,
482 FEATURE_VALUE_TYPE(signin::kForceStartupSigninPromo)},
Justin Cohenc57413a2019-09-30 19:42:29483 {"embedder-block-restore-url",
484 flag_descriptions::kEmbedderBlockRestoreUrlName,
485 flag_descriptions::kEmbedderBlockRestoreUrlDescription, flags_ui::kOsIos,
486 FEATURE_VALUE_TYPE(kEmbedderBlockRestoreUrl)},
sczs6c3202e2019-10-01 00:22:46487 {"messages-confirm-infobars",
488 flag_descriptions::kConfirmInfobarMessagesUIName,
489 flag_descriptions::kConfirmInfobarMessagesUIDescription, flags_ui::kOsIos,
490 FEATURE_VALUE_TYPE(kConfirmInfobarMessagesUI)},
David Jeana9bf62b2019-10-04 11:53:36491 {"disable-animation-on-low-battery",
492 flag_descriptions::kDisableAnimationOnLowBatteryName,
493 flag_descriptions::kDisableAnimationOnLowBatteryDescription,
494 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDisableAnimationOnLowBattery)},
sczs004fa6c2019-10-18 17:22:52495 {"messages-save-card-infobar",
496 flag_descriptions::kSaveCardInfobarMessagesUIName,
497 flag_descriptions::kSaveCardInfobarMessagesUIDescription, flags_ui::kOsIos,
498 FEATURE_VALUE_TYPE(kSaveCardInfobarMessagesUI)},
Chris Lu4cc111b452019-10-18 22:18:48499 {"messages-translate-infobar",
500 flag_descriptions::kTranslateInfobarMessagesUIName,
501 flag_descriptions::kTranslateInfobarMessagesUIDescription,
502 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kTranslateInfobarMessagesUI)},
sczs4622e6e2019-11-06 01:17:59503 {"autofill-save-card-dismiss-on-navigation",
504 flag_descriptions::kAutofillSaveCardDismissOnNavigationName,
505 flag_descriptions::kAutofillSaveCardDismissOnNavigationDescription,
506 flags_ui::kOsIos,
507 FEATURE_VALUE_TYPE(
508 autofill::features::kAutofillSaveCardDismissOnNavigation)},
Ewann6674c132019-11-06 11:20:41509 {"enable-persistent-downloads",
510 flag_descriptions::kEnablePersistentDownloadsName,
511 flag_descriptions::kEnablePersistentDownloadsDescription, flags_ui::kOsIos,
512 FEATURE_VALUE_TYPE(web::features::kEnablePersistentDownloads)},
Rohit Raoe7b489312019-11-12 12:28:55513 {"force-unstacked-tabstrip", flag_descriptions::kForceUnstackedTabstripName,
514 flag_descriptions::kForceUnstackedTabstripDescription, flags_ui::kOsIos,
515 FEATURE_VALUE_TYPE(kForceUnstackedTabstrip)},
Gauthier Ambard93914002019-11-14 12:56:12516 {"use-js-error-page", flag_descriptions::kUseJSForErrorPageName,
517 flag_descriptions::kUseJSForErrorPageDescription, flags_ui::kOsIos,
518 FEATURE_VALUE_TYPE(web::features::kUseJSForErrorPage)},
Javier Ernesto Flores Robles73cf70ab2019-11-15 14:34:07519 {"messages-download-infobar",
520 flag_descriptions::kDownloadInfobarMessagesUIName,
521 flag_descriptions::kDownloadInfobarMessagesUIDescription, flags_ui::kOsIos,
522 FEATURE_VALUE_TYPE(kDownloadInfobarMessagesUI)},
Gauthier Ambardbde9def2019-11-19 18:04:33523 {"desktop-version-default", flag_descriptions::kDefaultToDesktopOnIPadName,
524 flag_descriptions::kDefaultToDesktopOnIPadDescription, flags_ui::kOsIos,
Gauthier Ambard054175f2019-12-16 11:54:09525 FEATURE_VALUE_TYPE(web::features::kUseDefaultUserAgentInWebClient)},
Gauthier Ambardbde9def2019-11-19 18:04:33526 {"mobile-google-srp", flag_descriptions::kMobileGoogleSRPName,
527 flag_descriptions::kMobileGoogleSRPDescription, flags_ui::kOsIos,
528 FEATURE_VALUE_TYPE(web::kMobileGoogleSRP)},
sczs3bede8282019-11-27 14:16:54529 {"messages-crash-restore-infobars",
530 flag_descriptions::kCrashRestoreInfobarMessagesUIName,
531 flag_descriptions::kCrashRestoreInfobarMessagesUIDescription,
532 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kCrashRestoreInfobarMessagesUI)},
Kurt Horimotod754e8ec2019-12-03 20:54:02533 {"infobar-overlay-ui", flag_descriptions::kInfobarOverlayUIName,
534 flag_descriptions::kInfobarOverlayUIDescription, flags_ui::kOsIos,
535 FEATURE_VALUE_TYPE(kInfobarOverlayUI)},
sczs391ebba2019-12-05 06:59:30536 {"autofill-save-card-infobar-edit-support",
537 flag_descriptions::kAutofillSaveCardInfobarEditSupportName,
538 flag_descriptions::kAutofillSaveCardInfobarEditSupportDescription,
539 flags_ui::kOsIos,
540 FEATURE_VALUE_TYPE(
541 autofill::features::kAutofillSaveCardInfobarEditSupport)},
Gauthier Ambardcd302c42019-12-11 09:56:50542 {"reload-sad-tab", flag_descriptions::kReloadSadTabName,
543 flag_descriptions::kReloadSadTabDescription, flags_ui::kOsIos,
544 FEATURE_VALUE_TYPE(web::kReloadSadTab)},
Ewann9b6b8a22020-03-24 08:59:36545 {"page-info-chrome-guard", flag_descriptions::kPageInfoChromeGuardName,
546 flag_descriptions::kPageInfoChromeGuardDescription, flags_ui::kOsIos,
547 FEATURE_VALUE_TYPE(kPageInfoChromeGuard)},
Gauthier Ambardf2247baa2020-01-06 19:16:34548 {"page-info-refactoring", flag_descriptions::kPageInfoRefactoringName,
549 flag_descriptions::kPageInfoRefactoringDescription, flags_ui::kOsIos,
Gauthier Ambarde813c07f2020-01-09 10:18:49550 FEATURE_VALUE_TYPE(kPageInfoRefactoring)},
551 {"contained-browser-bvc", flag_descriptions::kContainedBVCName,
552 flag_descriptions::kContainedBVCDescription, flags_ui::kOsIos,
553 FEATURE_VALUE_TYPE(kContainedBVC)},
Nohemi Fernandez6b6260a2020-01-17 16:53:45554 {"clear-synced-data", flag_descriptions::kClearSyncedDataName,
555 flag_descriptions::kClearSyncedDataDescription, flags_ui::kOsIos,
556 FEATURE_VALUE_TYPE(kClearSyncedData)},
Livvie Linb861cba2020-01-22 01:54:47557 {"ssl-committed-interstitials",
558 flag_descriptions::kSSLCommittedInterstitialsName,
559 flag_descriptions::kSSLCommittedInterstitialsDescription, flags_ui::kOsIos,
560 FEATURE_VALUE_TYPE(web::features::kSSLCommittedInterstitials)},
Ewann62d2d9c2020-01-22 13:47:19561 {"change-tab-switcher-position",
562 flag_descriptions::kChangeTabSwitcherPositionName,
563 flag_descriptions::kChangeTabSwitcherPositionDescription, flags_ui::kOsIos,
564 FEATURE_VALUE_TYPE(kChangeTabSwitcherPosition)},
Chris Luf7c9b072020-01-23 17:57:32565 {"fullscreen-controller-browser-scoped",
566 flag_descriptions::kFullscreenControllerBrowserScopedName,
567 flag_descriptions::kFullscreenControllerBrowserScopedDescription,
568 flags_ui::kOsIos,
569 FEATURE_VALUE_TYPE(
570 fullscreen::features::kFullscreenControllerBrowserScoped)},
Ewann93ce65c2020-03-05 16:47:13571 {"open-downloads-in-files.app",
572 flag_descriptions::kOpenDownloadsInFilesAppName,
573 flag_descriptions::kOpenDownloadsInFilesAppDescription, flags_ui::kOsIos,
574 FEATURE_VALUE_TYPE(kOpenDownloadsInFilesApp)},
Livvie Lin5e095912020-03-18 18:16:28575 {"ios-lookalike-url-navigation-suggestions-ui",
576 flag_descriptions::kIOSLookalikeUrlNavigationSuggestionsUIName,
577 flag_descriptions::kIOSLookalikeUrlNavigationSuggestionsUIDescription,
578 flags_ui::kOsIos,
579 FEATURE_VALUE_TYPE(
580 web::features::kIOSLookalikeUrlNavigationSuggestionsUI)},
Ali Juma01ca4ff2020-03-19 15:53:11581 {"safe-browsing-available", flag_descriptions::kSafeBrowsingAvailableName,
582 flag_descriptions::kSafeBrowsingAvailableDescription, flags_ui::kOsIos,
583 FEATURE_VALUE_TYPE(safe_browsing::kSafeBrowsingAvailableOnIOS)},
Nohemi Fernandez41e256e2020-03-25 11:52:11584 {"new-signin-architecture", flag_descriptions::kNewSigninArchitectureName,
585 flag_descriptions::kNewSigninArchitectureDescription, flags_ui::kOsIos,
586 FEATURE_VALUE_TYPE(kNewSigninArchitecture)},
Sebastien Lalancette8b011b32020-03-27 13:31:24587 {"qr-code-generation", flag_descriptions::kQRCodeGenerationName,
588 flag_descriptions::kQRCodeGenerationDescription, flags_ui::kOsIos,
589 FEATURE_VALUE_TYPE(kQRCodeGeneration)},
Sujie Zhu2b17c00a2020-04-08 21:09:41590 {"autofill-enable-surfacing-server-card-nickname",
591 flag_descriptions::kAutofillEnableSurfacingServerCardNicknameName,
592 flag_descriptions::kAutofillEnableSurfacingServerCardNicknameDescription,
593 flags_ui::kOsIos,
594 FEATURE_VALUE_TYPE(
595 autofill::features::kAutofillEnableSurfacingServerCardNickname)},
edchin68696842020-04-09 17:19:31596 {"managed-bookmarks-ios", flag_descriptions::kManagedBookmarksIOSName,
597 flag_descriptions::kManagedBookmarksIOSDescription, flags_ui::kOsIos,
598 FEATURE_VALUE_TYPE(kManagedBookmarksIOS)},
Anne Lime49c5cb2020-04-15 03:20:59599 {"enable-autofill-cache-server-card-info",
600 flag_descriptions::kEnableAutofillCacheServerCardInfoName,
601 flag_descriptions::kEnableAutofillCacheServerCardInfoDescription,
602 flags_ui::kOsIos,
603 FEATURE_VALUE_TYPE(autofill::features::kAutofillCacheServerCardInfo)},
sczs5b8ac5f2020-04-17 16:23:20604 {"infobar-ui-reboot-only-ios13",
605 flag_descriptions::kInfobarUIRebootOnlyiOS13Name,
606 flag_descriptions::kInfobarUIRebootOnlyiOS13Description, flags_ui::kOsIos,
607 FEATURE_VALUE_TYPE(kInfobarUIRebootOnlyiOS13)},
edchin39d08d62020-04-20 13:11:24608 {"edit-bookmarks-ios", flag_descriptions::kEditBookmarksIOSName,
609 flag_descriptions::kEditBookmarksIOSDescription, flags_ui::kOsIos,
610 FEATURE_VALUE_TYPE(kEditBookmarksIOS)},
Mike Dougherty768389502020-04-21 08:28:35611 {"url-blocklist-ios", flag_descriptions::kURLBlocklistIOSName,
612 flag_descriptions::kURLBlocklistIOSDescription, flags_ui::kOsIos,
613 FEATURE_VALUE_TYPE(kURLBlocklistIOS)},
Gauthier Ambarde813c07f2020-01-09 10:18:49614};
sdefresne14900ee2015-11-27 14:43:21615
616// Add all switches from experimental flags to |command_line|.
617void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) {
618 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
619
sdefresne14900ee2015-11-27 14:43:21620 // Set the UA flag if UseMobileSafariUA is enabled.
621 if ([defaults boolForKey:@"UseMobileSafariUA"]) {
622 // Safari uses "Vesion/", followed by the OS version excluding bugfix, where
623 // Chrome puts its product token.
avi571943672015-12-22 02:12:49624 int32_t major = 0;
625 int32_t minor = 0;
626 int32_t bugfix = 0;
sdefresne14900ee2015-11-27 14:43:21627 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix);
628 std::string product = base::StringPrintf("Version/%d.%d", major, minor);
629
Gauthier Ambard22945482019-11-29 14:02:21630 command_line->AppendSwitchASCII(
631 switches::kUserAgent,
632 web::BuildUserAgentFromProduct(web::UserAgentType::MOBILE, product));
sdefresne14900ee2015-11-27 14:43:21633 }
634
635 // Freeform commandline flags. These are added last, so that any flags added
636 // earlier in this function take precedence.
637 if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) {
638 base::CommandLine::StringVector flags;
639 // Append an empty "program" argument.
640 flags.push_back("");
641
642 // The number of flags corresponds to the number of text fields in
643 // Experimental.plist.
644 const int kNumFreeformFlags = 5;
645 for (int i = 1; i <= kNumFreeformFlags; ++i) {
646 NSString* key =
647 [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i];
648 NSString* flag = [defaults stringForKey:key];
649 if ([flag length]) {
Robbie Gibsonc91ce622019-05-20 14:44:33650 // iOS keyboard replaces -- with —, so undo that.
651 flag = [flag stringByReplacingOccurrencesOfString:@"—"
652 withString:@"--"
653 options:0
654 range:NSMakeRange(0, 1)];
655 // To make things easier, allow flags with no dashes by prepending them
656 // here. This also allows for flags that just have one dash if they
657 // exist.
658 if (![flag hasPrefix:@"-"]) {
659 flag = [@"--" stringByAppendingString:flag];
660 }
sdefresne14900ee2015-11-27 14:43:21661 flags.push_back(base::SysNSStringToUTF8(flag));
662 }
663 }
664
665 base::CommandLine temp_command_line(flags);
666 command_line->AppendArguments(temp_command_line, false);
667 }
msardafc76f662017-02-24 12:46:28668
justincohendacc85d2017-06-28 23:34:10669 // Populate command line flag for 3rd party keyboard omnibox workaround.
670 NSString* enableThirdPartyKeyboardWorkaround =
671 [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"];
672 if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) {
673 command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround);
674 } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) {
675 command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround);
676 }
677
msardafc76f662017-02-24 12:46:28678 ios::GetChromeBrowserProvider()->AppendSwitchesFromExperimentalSettings(
679 defaults, command_line);
sdefresne14900ee2015-11-27 14:43:21680}
681
682bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
683 return false;
684}
685
Sylvain Defresne8327a2f2019-01-17 14:19:18686flags_ui::FlagsState& GetGlobalFlagsState() {
Elly Fong-Jones3cd75282019-11-12 20:26:50687 static base::NoDestructor<flags_ui::FlagsState> flags_state(kFeatureEntries,
688 nullptr);
Sylvain Defresne8327a2f2019-01-17 14:19:18689 return *flags_state;
690}
sdefresne14900ee2015-11-27 14:43:21691} // namespace
692
693void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage,
694 base::CommandLine* command_line) {
Gregory Chatzinoff31305112017-12-20 21:56:02695 AppendSwitchesFromExperimentalSettings(command_line);
Sylvain Defresne8327a2f2019-01-17 14:19:18696 GetGlobalFlagsState().ConvertFlagsToSwitches(
sdefresnec9763902015-12-02 10:30:11697 flags_storage, command_line, flags_ui::kAddSentinels,
Gregory Chatzinofff6523722017-11-21 01:33:53698 switches::kEnableFeatures, switches::kDisableFeatures);
sdefresne14900ee2015-11-27 14:43:21699}
700
jkrcalbf073372016-07-29 07:21:31701std::vector<std::string> RegisterAllFeatureVariationParameters(
702 flags_ui::FlagsStorage* flags_storage,
703 base::FeatureList* feature_list) {
Justin Cohen2e2adb52019-10-25 17:00:02704 // Occasionally DCHECK crashes on canary can be very distuptive. An
705 // experimental flag was added to aid in temporarily disabling this for
706 // canary testers.
707#if defined(DCHECK_IS_CONFIGURABLE)
708 if (experimental_flags::AreDCHECKCrashesDisabled()) {
709 std::vector<base::FeatureList::FeatureOverrideInfo> overrides;
710 overrides.push_back(
711 {std::cref(base::kDCheckIsFatalFeature),
712 base::FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE});
713 feature_list->RegisterExtraFeatureOverrides(std::move(overrides));
714 }
715#endif // defined(DCHECK_IS_CONFIGURABLE)
716
Sylvain Defresne8327a2f2019-01-17 14:19:18717 return GetGlobalFlagsState().RegisterAllFeatureVariationParameters(
718 flags_storage, feature_list);
jkrcalbf073372016-07-29 07:21:31719}
720
sdefresne14900ee2015-11-27 14:43:21721void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage,
722 flags_ui::FlagAccess access,
723 base::ListValue* supported_entries,
724 base::ListValue* unsupported_entries) {
Sylvain Defresne8327a2f2019-01-17 14:19:18725 GetGlobalFlagsState().GetFlagFeatureEntries(
sdefresne14900ee2015-11-27 14:43:21726 flags_storage, access, supported_entries, unsupported_entries,
727 base::Bind(&SkipConditionalFeatureEntry));
728}
729
730void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage,
731 const std::string& internal_name,
732 bool enable) {
Sylvain Defresne8327a2f2019-01-17 14:19:18733 GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name,
734 enable);
sdefresne14900ee2015-11-27 14:43:21735}
736
737void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) {
Sylvain Defresne8327a2f2019-01-17 14:19:18738 GetGlobalFlagsState().ResetAllFlags(flags_storage);
sdefresne14900ee2015-11-27 14:43:21739}
740
741namespace testing {
742
743const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) {
kokihoon189a4022018-10-13 02:43:44744 *count = base::size(kFeatureEntries);
sdefresne14900ee2015-11-27 14:43:21745 return kFeatureEntries;
746}
747
748} // namespace testing