blob: 64f7aa08352901fb32ed74efd40fc1308ca4c7f1 [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"
Hans Wennborg3a2fb61f2020-05-11 15:51:1617#include "base/check_op.h"
sdefresne14900ee2015-11-27 14:43:2118#include "base/command_line.h"
Sylvain Defresne8327a2f2019-01-17 14:19:1819#include "base/no_destructor.h"
kokihoon189a4022018-10-13 02:43:4420#include "base/stl_util.h"
sdefresne14900ee2015-11-27 14:43:2121#include "base/strings/stringprintf.h"
22#include "base/strings/sys_string_conversions.h"
Sebastien Marchand75a7cdf2018-11-13 23:47:0323#include "base/system/sys_info.h"
Mohamad Ahmadic4df81f2017-12-20 04:41:5924#include "components/autofill/core/common/autofill_features.h"
Jared Sauld998539f2019-03-19 15:11:1725#include "components/autofill/core/common/autofill_payments_features.h"
Moe Ahmadid6d5d172018-06-20 17:20:2326#include "components/autofill/core/common/autofill_switches.h"
Olivier Robin3d60411622018-02-23 10:03:2227#include "components/autofill/ios/browser/autofill_switches.h"
Robbie Gibson5e3436632020-04-27 15:48:0428#include "components/content_settings/core/common/features.h"
sdefresne14900ee2015-11-27 14:43:2129#include "components/dom_distiller/core/dom_distiller_switches.h"
Tommy Nyquistc1d6dea12017-07-26 20:37:2330#include "components/feature_engagement/public/feature_constants.h"
31#include "components/feature_engagement/public/feature_list.h"
sdefresne14900ee2015-11-27 14:43:2132#include "components/flags_ui/feature_entry.h"
33#include "components/flags_ui/feature_entry_macros.h"
34#include "components/flags_ui/flags_storage.h"
35#include "components/flags_ui/flags_ui_switches.h"
sczs27e389e2020-01-15 15:19:1836#include "components/infobars/core/infobar_feature.h"
Tanja Gornakb0985dd2018-10-11 17:24:4037#include "components/invalidation/impl/invalidation_switches.h"
noyau4cfb1332016-10-25 17:05:4238#include "components/ntp_tiles/switches.h"
Justin Donnelly33d712e2017-08-23 21:32:5139#include "components/omnibox/browser/omnibox_field_trial.h"
Tomasz Wiszkowskid938a1112019-03-06 18:01:5740#include "components/omnibox/common/omnibox_features.h"
Ioana Pandeled14ce9e2017-11-28 14:41:4641#include "components/password_manager/core/common/password_manager_features.h"
mathp9b4c11d2017-07-06 20:24:1342#include "components/payments/core/features.h"
Guillaume Jenkinseeb7007c2020-06-25 22:55:4043#import "components/policy/core/common/policy_loader_ios_constants.h"
44#include "components/policy/policy_constants.h"
Ali Juma01ca4ff2020-03-19 15:53:1145#include "components/safe_browsing/core/features.h"
Emily Starkbafa9062017-12-27 15:22:4646#include "components/security_state/core/features.h"
Sébastien Séguin-Gagnondcb854b2019-04-10 16:36:4447#include "components/send_tab_to_self/features.h"
Valeriya Sinevicha79dc612018-09-25 14:49:0948#include "components/signin/core/browser/account_reconcilor.h"
Jérôme Lebelc374fdd2019-09-27 10:36:4849#include "components/signin/ios/browser/features.h"
Nohemi Fernandez983d6d52020-09-09 09:46:1950#include "components/signin/public/base/account_consistency_method.h"
Colin Blundell3517170e2019-07-11 08:16:3451#include "components/signin/public/base/signin_switches.h"
sdefresne36579782016-02-05 11:08:2552#include "components/strings/grit/components_strings.h"
Rushan Suleymanov988ad372020-07-26 19:10:0853#include "components/sync/base/sync_base_switches.h"
Moe Ahmadid6d5d172018-06-20 17:20:2354#include "components/sync/driver/sync_driver_switches.h"
Moe Ahmadie4cce1f2018-12-18 23:48:0155#include "components/translate/core/browser/translate_prefs.h"
Chris Lu0683adf2019-02-26 15:56:4556#include "components/ukm/ios/features.h"
Sylvain Defresneae6987e2018-03-01 13:21:4057#include "ios/chrome/browser/browsing_data/browsing_data_features.h"
sdefresne14900ee2015-11-27 14:43:2158#include "ios/chrome/browser/chrome_switches.h"
Mike Doughertyb6c770d2019-09-13 22:56:4659#include "ios/chrome/browser/crash_report/breadcrumbs/features.h"
Eugene But2823dc7e2020-07-21 18:10:3760#include "ios/chrome/browser/crash_report/features.h"
Jean-François Geyelin30be5912017-08-25 12:05:3861#include "ios/chrome/browser/drag_and_drop/drag_and_drop_flag.h"
Nazerke21bdc45a2019-07-11 09:02:0562#include "ios/chrome/browser/flags/ios_chrome_flag_descriptions.h"
Ewann163e3952020-08-21 12:34:4963#import "ios/chrome/browser/open_in/features.h"
edchin68696842020-04-09 17:19:3164#include "ios/chrome/browser/policy/policy_features.h"
Sylvain Defresne9c107082020-10-27 16:39:1365#include "ios/chrome/browser/screen_time/screen_time_buildflags.h"
Gauthier Ambard33e03302019-02-21 13:28:5866#include "ios/chrome/browser/system_flags.h"
adamta22a4d502020-05-21 03:12:2167#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h"
Ewann93ce65c2020-03-05 16:47:1368#import "ios/chrome/browser/ui/download/features.h"
Kurt Horimoto4da682b022018-04-12 07:43:3569#import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h"
sczs80a6f462018-12-05 20:37:1870#import "ios/chrome/browser/ui/infobars/infobar_feature.h"
Ewann Pellé987f3c12020-06-29 15:23:0871#import "ios/chrome/browser/ui/page_info/features.h"
Tanisha Mandre549612ea2019-07-17 11:36:1572#include "ios/chrome/browser/ui/settings/autofill/features.h"
Ewanne1ffc6d2020-09-01 07:56:1373#import "ios/chrome/browser/ui/tab_grid/features.h"
sczs76b9ba02019-07-23 23:34:3074#import "ios/chrome/browser/ui/table_view/feature_flags.h"
Kurt Horimoto79d590b2018-09-12 19:09:2875#import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h"
Justin Cohen2d81c582018-01-22 14:46:4476#include "ios/chrome/browser/ui/ui_feature_flags.h"
Yi Su392b3032018-06-05 07:26:4777#include "ios/chrome/browser/web/features.h"
sdefresne14900ee2015-11-27 14:43:2178#include "ios/chrome/grit/ios_strings.h"
msardafc76f662017-02-24 12:46:2879#include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
Eugene But61818bc2019-04-15 21:04:0780#include "ios/web/common/features.h"
Eugene Bute79f2742019-07-26 17:07:2281#include "ios/web/common/user_agent.h"
Eugene Butb1416232019-07-22 17:31:5882#include "ios/web/common/web_view_creation_util.h"
sdefresne14900ee2015-11-27 14:43:2183
Sylvain Defresne9c107082020-10-27 16:39:1384#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
85#include "ios/chrome/browser/screen_time/features.h"
86#endif
87
sdefresne14900ee2015-11-27 14:43:2188#if !defined(OFFICIAL_BUILD)
89#include "components/variations/variations_switches.h"
vitaliii489217aa2017-01-30 14:50:2290#endif
stkhapuginc1be1792016-12-13 14:30:5391
92#if !defined(__has_feature) || !__has_feature(objc_arc)
93#error "This file requires ARC support."
94#endif
sdefresne14900ee2015-11-27 14:43:2195
elawrence816f6790e2017-06-16 18:19:2896using flags_ui::FeatureEntry;
97
sdefresne14900ee2015-11-27 14:43:2198namespace {
Emily Starkbafa9062017-12-27 15:22:4699
100const FeatureEntry::FeatureParam kMarkHttpAsDangerous[] = {
101 {security_state::features::kMarkHttpAsFeatureParameterName,
102 security_state::features::kMarkHttpAsParameterDangerous}};
Emily Starkbafa9062017-12-27 15:22:46103const FeatureEntry::FeatureParam kMarkHttpAsWarningAndDangerousOnFormEdits[] = {
104 {security_state::features::kMarkHttpAsFeatureParameterName,
105 security_state::features::
106 kMarkHttpAsParameterWarningAndDangerousOnFormEdits}};
Livvie Linc8a9ed462019-10-29 01:06:50107const FeatureEntry::FeatureParam kMarkHttpAsDangerWarning[] = {
108 {security_state::features::kMarkHttpAsFeatureParameterName,
109 security_state::features::kMarkHttpAsParameterDangerWarning}};
Emily Starkbafa9062017-12-27 15:22:46110
111const FeatureEntry::FeatureVariation kMarkHttpAsFeatureVariations[] = {
112 {"(mark as actively dangerous)", kMarkHttpAsDangerous,
kokihoon189a4022018-10-13 02:43:44113 base::size(kMarkHttpAsDangerous), nullptr},
Emily Starkbafa9062017-12-27 15:22:46114 {"(mark with a Not Secure warning and dangerous on form edits)",
115 kMarkHttpAsWarningAndDangerousOnFormEdits,
Livvie Linc8a9ed462019-10-29 01:06:50116 base::size(kMarkHttpAsWarningAndDangerousOnFormEdits), nullptr},
117 {"(mark with a grey triangle icon)", kMarkHttpAsDangerWarning,
118 base::size(kMarkHttpAsDangerWarning), nullptr}};
elawrence816f6790e2017-06-16 18:19:28119
Olivier Robin3d60411622018-02-23 10:03:22120const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = {
121 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
122 {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"},
123 {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"},
124 {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"},
125 {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"},
126 {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"},
127 {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"},
128 {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"},
129 {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"},
130};
131
Nohemi Fernandez222d6d42020-09-30 20:35:57132const FeatureEntry::Choice kDelayThresholdMinutesToUpdateGaiaCookieChoices[] = {
133 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
134 {"0", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "0"},
135 {"10", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "10"},
136 {"60", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "60"},
137};
138
Ce Chenc8d803a2020-04-27 09:31:33139const FeatureEntry::FeatureVariation
Ce Chenc8d803a2020-04-27 09:31:33140 kOmniboxOnDeviceHeadSuggestNonIncognitoExperimentVariations[] = {
141 {
142 "relevance-1000",
143 (FeatureEntry::FeatureParam[]){
144 {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput,
145 "1000"},
146 {OmniboxFieldTrial::kOnDeviceHeadSuggestDemoteMode,
147 "decrease-relevances"}},
148 2,
149 nullptr,
150 },
151 {
152 "request-delay-100ms",
153 (FeatureEntry::FeatureParam[]){
154 {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs,
155 "100"}},
156 1,
157 nullptr,
158 },
159 {
160 "delay-100ms-relevance-1000",
161 (FeatureEntry::FeatureParam[]){
162 {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs,
163 "100"},
164 {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput,
165 "1000"},
166 {OmniboxFieldTrial::kOnDeviceHeadSuggestDemoteMode,
167 "decrease-relevances"}},
168 3,
169 nullptr,
170 },
171 {
172 "request-delay-200ms",
173 (FeatureEntry::FeatureParam[]){
174 {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs,
175 "200"}},
176 1,
177 nullptr,
178 },
179 {
180 "delay-200ms-relevance-1000",
181 (FeatureEntry::FeatureParam[]){
182 {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs,
183 "200"},
184 {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput,
185 "1000"},
186 {OmniboxFieldTrial::kOnDeviceHeadSuggestDemoteMode,
187 "decrease-relevances"}},
188 3,
189 nullptr,
190 }};
Ce Chen104a5382019-12-10 01:09:05191
Stepan Khapugincc4e9842019-01-23 13:38:13192const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = {
193 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}};
194const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = {
195 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}};
196const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = {
197 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}};
198const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = {
199 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}};
200const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = {
201 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}};
202const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = {
203 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}};
204const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = {
205 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}};
206
207const FeatureEntry::FeatureVariation
208 kOmniboxUIMaxAutocompleteMatchesVariations[] = {
209 {"3 matches", kOmniboxUIMaxAutocompleteMatches3,
210 base::size(kOmniboxUIMaxAutocompleteMatches3), nullptr},
211 {"4 matches", kOmniboxUIMaxAutocompleteMatches4,
212 base::size(kOmniboxUIMaxAutocompleteMatches4), nullptr},
213 {"5 matches", kOmniboxUIMaxAutocompleteMatches5,
214 base::size(kOmniboxUIMaxAutocompleteMatches5), nullptr},
215 {"6 matches", kOmniboxUIMaxAutocompleteMatches6,
216 base::size(kOmniboxUIMaxAutocompleteMatches6), nullptr},
217 {"8 matches", kOmniboxUIMaxAutocompleteMatches8,
218 base::size(kOmniboxUIMaxAutocompleteMatches8), nullptr},
219 {"10 matches", kOmniboxUIMaxAutocompleteMatches10,
220 base::size(kOmniboxUIMaxAutocompleteMatches10), nullptr},
221 {"12 matches", kOmniboxUIMaxAutocompleteMatches12,
222 base::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}};
223
Caitlin Fischer37e01232019-05-24 13:05:45224const FeatureEntry::FeatureParam
225 kAutofillUseMobileLabelDisambiguationShowAll[] = {
226 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
227 autofill::features::
228 kAutofillUseMobileLabelDisambiguationParameterShowAll}};
229const FeatureEntry::FeatureParam
230 kAutofillUseMobileLabelDisambiguationShowOne[] = {
231 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
232 autofill::features::
233 kAutofillUseMobileLabelDisambiguationParameterShowOne}};
234
235const FeatureEntry::FeatureVariation
236 kAutofillUseMobileLabelDisambiguationVariations[] = {
237 {"(show all)", kAutofillUseMobileLabelDisambiguationShowAll,
238 base::size(kAutofillUseMobileLabelDisambiguationShowAll), nullptr},
239 {"(show one)", kAutofillUseMobileLabelDisambiguationShowOne,
240 base::size(kAutofillUseMobileLabelDisambiguationShowOne), nullptr}};
241
Cooper Knaak1e026562017-07-26 05:22:28242// To add a new entry, add to the end of kFeatureEntries. There are four
sdefresne14900ee2015-11-27 14:43:21243// distinct types of entries:
Cooper Knaak1e026562017-07-26 05:22:28244// . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the
245// default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE
sdefresne14900ee2015-11-27 14:43:21246// macro for this type supplying the command line to the macro.
247// . MULTI_VALUE: a list of choices, the first of which should correspond to a
248// deactivated state for this lab (i.e. no command line option). To specify
249// this type of entry use the macro MULTI_VALUE_TYPE supplying it the
250// array of choices.
Cooper Knaak1e026562017-07-26 05:22:28251// . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is
252// either enabled, disabled, or uses the default value of the associated
253// base::Feature instance. To specify this type of entry use the macro
254// FEATURE_VALUE_TYPE supplying it the base::Feature instance.
255// . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a
256// base::Feature instance. Choices corresponding to the default state, a
257// universally enabled state, and a universally disabled state are
258// automatically included. To specify this type of entry use the macro
259// FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and
260// the array of choices.
261//
sdefresne14900ee2015-11-27 14:43:21262// See the documentation of FeatureEntry for details on the fields.
263//
264// When adding a new choice, add it to the end of the list.
265const flags_ui::FeatureEntry kFeatureEntries[] = {
Emily Starkbafa9062017-12-27 15:22:46266 {"enable-mark-http-as", flag_descriptions::kMarkHttpAsName,
elawrence816f6790e2017-06-16 18:19:28267 flag_descriptions::kMarkHttpAsDescription, flags_ui::kOsIos,
Emily Starkbafa9062017-12-27 15:22:46268 FEATURE_WITH_PARAMS_VALUE_TYPE(
269 security_state::features::kMarkHttpAsFeature,
270 kMarkHttpAsFeatureVariations,
271 "MarkHttpAs")},
Cooper Knaak1e026562017-07-26 05:22:28272 {"in-product-help-demo-mode-choice",
273 flag_descriptions::kInProductHelpDemoModeName,
274 flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos,
275 FEATURE_WITH_PARAMS_VALUE_TYPE(
Tommy Nyquistc1d6dea12017-07-26 20:37:23276 feature_engagement::kIPHDemoMode,
277 feature_engagement::kIPHDemoModeChoiceVariations,
Marc Treib2752e8b2017-08-04 14:12:09278 "IPH_DemoMode")},
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)},
Moe Ahmadic3fd7cd2018-05-11 21:40:22282 {"enable-autofill-credit-card-upload",
283 flag_descriptions::kAutofillCreditCardUploadName,
284 flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos,
Anne Lim579b5732018-08-30 18:24:24285 FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)},
Moe Ahmadid6d5d172018-06-20 17:20:23286 {"use-sync-sandbox", flag_descriptions::kSyncSandboxName,
287 flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos,
288 SINGLE_VALUE_TYPE_AND_VALUE(
289 switches::kSyncServiceURL,
290 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")},
291 {"wallet-service-use-sandbox",
292 flag_descriptions::kWalletServiceUseSandboxName,
293 flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos,
294 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
295 autofill::switches::kWalletServiceUseSandbox,
296 "1",
297 autofill::switches::kWalletServiceUseSandbox,
298 "0")},
Mohamad Ahmadic4df81f2017-12-20 04:41:59299 {"show-autofill-type-predictions",
300 flag_descriptions::kShowAutofillTypePredictionsName,
301 flag_descriptions::kShowAutofillTypePredictionsDescription,
302 flags_ui::kOsIos,
Gauthier Ambardcfd85182018-01-05 10:37:46303 FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)},
Olivier Robin3d60411622018-02-23 10:03:22304 {"autofill-ios-delay-between-fields",
305 flag_descriptions::kAutofillIOSDelayBetweenFieldsName,
306 flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription,
307 flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)},
Moe Ahmadid3ddfcb2018-04-20 19:51:08308 {"autofill-restrict-formless-form-extraction",
309 flag_descriptions::kAutofillRestrictUnownedFieldsToFormlessCheckoutName,
310 flag_descriptions::
311 kAutofillRestrictUnownedFieldsToFormlessCheckoutDescription,
312 flags_ui::kOsIos,
313 FEATURE_VALUE_TYPE(
314 autofill::features::kAutofillRestrictUnownedFieldsToFormlessCheckout)},
Roger McFarlanee193ab122018-11-22 20:55:07315 {"autofill-rich-metadata-queries",
316 flag_descriptions::kAutofillRichMetadataQueriesName,
317 flag_descriptions::kAutofillRichMetadataQueriesDescription,
318 flags_ui::kOsIos,
319 FEATURE_VALUE_TYPE(autofill::features::kAutofillRichMetadataQueries)},
Kurt Horimotodc33af32018-05-01 01:39:14320 {"fullscreen-viewport-adjustment-experiment",
Chris Lu481a9322019-09-25 22:16:53321 flag_descriptions::kFullscreenSmoothScrollingName,
322 flag_descriptions::kFullscreenSmoothScrollingDescription, flags_ui::kOsIos,
323 FEATURE_VALUE_TYPE(fullscreen::features::kSmoothScrollingDefault)},
Roger McFarlane1a37d7b2018-04-20 22:45:19324 {"autofill-enforce-min-required-fields-for-heuristics",
325 flag_descriptions::kAutofillEnforceMinRequiredFieldsForHeuristicsName,
326 flag_descriptions::
327 kAutofillEnforceMinRequiredFieldsForHeuristicsDescription,
328 flags_ui::kOsIos,
329 FEATURE_VALUE_TYPE(
330 autofill::features::kAutofillEnforceMinRequiredFieldsForHeuristics)},
331 {"autofill-enforce-min-required-fields-for-query",
332 flag_descriptions::kAutofillEnforceMinRequiredFieldsForQueryName,
333 flag_descriptions::kAutofillEnforceMinRequiredFieldsForQueryDescription,
334 flags_ui::kOsIos,
335 FEATURE_VALUE_TYPE(
336 autofill::features::kAutofillEnforceMinRequiredFieldsForQuery)},
337 {"autofill-enforce-min-required-fields-for-upload",
338 flag_descriptions::kAutofillEnforceMinRequiredFieldsForUploadName,
339 flag_descriptions::kAutofillEnforceMinRequiredFieldsForUploadDescription,
340 flags_ui::kOsIos,
341 FEATURE_VALUE_TYPE(
342 autofill::features::kAutofillEnforceMinRequiredFieldsForUpload)},
Roger McFarlane2eceba982018-05-18 01:37:11343 {"autofill-cache-query-responses",
344 flag_descriptions::kAutofillCacheQueryResponsesName,
345 flag_descriptions::kAutofillCacheQueryResponsesDescription,
346 flags_ui::kOsIos,
347 FEATURE_VALUE_TYPE(autofill::features::kAutofillCacheQueryResponses)},
Robbie Gibson1f37a5e2020-08-06 17:03:06348 {"webpage-default-zoom-from-dynamic-type",
349 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeName,
350 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeDescription,
351 flags_ui::kOsIos,
352 FEATURE_VALUE_TYPE(web::kWebPageDefaultZoomFromDynamicType)},
Yi Su392b3032018-06-05 07:26:47353 {"webpage-text-accessibility",
354 flag_descriptions::kWebPageTextAccessibilityName,
355 flag_descriptions::kWebPageTextAccessibilityDescription, flags_ui::kOsIos,
356 FEATURE_VALUE_TYPE(web::kWebPageTextAccessibility)},
Robbie Gibson88f23962020-09-28 14:35:56357 {"webpage-alternative-text-zoom",
358 flag_descriptions::kWebPageAlternativeTextZoomName,
359 flag_descriptions::kWebPageAlternativeTextZoomDescription,
360 flags_ui::kOsIos, FEATURE_VALUE_TYPE(web::kWebPageAlternativeTextZoom)},
Kurt Horimoto79d590b2018-09-12 19:09:28361 {"toolbar-container", flag_descriptions::kToolbarContainerName,
362 flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos,
363 FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)},
Ce Chenc8d803a2020-04-27 09:31:33364 {"omnibox-on-device-head-suggestions-incognito",
365 flag_descriptions::kOmniboxOnDeviceHeadSuggestionsIncognitoName,
366 flag_descriptions::kOmniboxOnDeviceHeadSuggestionsIncognitoDescription,
Ce Chen104a5382019-12-10 01:09:05367 flags_ui::kOsIos,
Ce Chend565f71f2020-08-12 01:15:53368 FEATURE_VALUE_TYPE(omnibox::kOnDeviceHeadProviderIncognito)},
Ce Chenc8d803a2020-04-27 09:31:33369 {"omnibox-on-device-head-suggestions-non-incognito",
370 flag_descriptions::kOmniboxOnDeviceHeadSuggestionsNonIncognitoName,
371 flag_descriptions::kOmniboxOnDeviceHeadSuggestionsNonIncognitoDescription,
372 flags_ui::kOsIos,
373 FEATURE_WITH_PARAMS_VALUE_TYPE(
374 omnibox::kOnDeviceHeadProviderNonIncognito,
375 kOmniboxOnDeviceHeadSuggestNonIncognitoExperimentVariations,
376 "OmniboxOnDeviceHeadSuggestNonIncognitoIOS")},
Stepan Khapugincc4e9842019-01-23 13:38:13377 {"omnibox-ui-max-autocomplete-matches",
378 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName,
379 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription,
380 flags_ui::kOsIos,
381 FEATURE_WITH_PARAMS_VALUE_TYPE(
382 omnibox::kUIExperimentMaxAutocompleteMatches,
383 kOmniboxUIMaxAutocompleteMatchesVariations,
384 "OmniboxUIMaxAutocompleteVariations")},
sczs80a6f462018-12-05 20:37:18385 {"infobar-ui-reboot", flag_descriptions::kInfobarUIRebootName,
386 flag_descriptions::kInfobarUIRebootDescription, flags_ui::kOsIos,
sczs27e389e2020-01-15 15:19:18387 FEATURE_VALUE_TYPE(kIOSInfobarUIReboot)},
Robbie Gibson80d732e2019-01-10 10:42:49388 {"enable-clipboard-provider-image-suggestions",
389 flag_descriptions::kEnableClipboardProviderImageSuggestionsName,
390 flag_descriptions::kEnableClipboardProviderImageSuggestionsDescription,
391 flags_ui::kOsIos,
392 FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProviderImageSuggestions)},
edchin5ae0b4c2019-01-06 06:52:28393 {"snapshot-draw-view", flag_descriptions::kSnapshotDrawViewName,
394 flag_descriptions::kSnapshotDrawViewDescription, flags_ui::kOsIos,
395 FEATURE_VALUE_TYPE(kSnapshotDrawView)},
Justin Cohen20b6f072019-01-16 01:38:50396#if defined(DCHECK_IS_CONFIGURABLE)
397 {"dcheck-is-fatal", flag_descriptions::kDcheckIsFatalName,
398 flag_descriptions::kDcheckIsFatalDescription, flags_ui::kOsIos,
399 FEATURE_VALUE_TYPE(base::kDCheckIsFatalFeature)},
400#endif // defined(DCHECK_IS_CONFIGURABLE)
Gauthier Ambard5f610862019-01-17 11:43:55401 {"settings-refresh", flag_descriptions::kSettingsRefreshName,
402 flag_descriptions::kSettingsRefreshDescription, flags_ui::kOsIos,
403 FEATURE_VALUE_TYPE(kSettingsRefresh)},
Chris Lu8153e6e2019-03-26 16:28:21404 {"send-uma-cellular", flag_descriptions::kSendUmaOverAnyNetwork,
405 flag_descriptions::kSendUmaOverAnyNetworkDescription, flags_ui::kOsIos,
Chris Lu0683adf2019-02-26 15:56:45406 FEATURE_VALUE_TYPE(kUmaCellular)},
Caitlin Fischer43edd90a2019-05-01 13:24:30407 {"autofill-use-mobile-label-disambiguation",
408 flag_descriptions::kAutofillUseMobileLabelDisambiguationName,
409 flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription,
410 flags_ui::kOsIos,
Caitlin Fischer37e01232019-05-24 13:05:45411 FEATURE_WITH_PARAMS_VALUE_TYPE(
412 autofill::features::kAutofillUseMobileLabelDisambiguation,
413 kAutofillUseMobileLabelDisambiguationVariations,
414 "AutofillUseMobileLabelDisambiguation")},
edchinb5d92582020-03-11 15:26:11415 {"autofill-prune-suggestions",
Caitlin Fischer6d609542019-05-01 21:59:21416 flag_descriptions::kAutofillPruneSuggestionsName,
417 flag_descriptions::kAutofillPruneSuggestionsDescription, flags_ui::kOsIos,
418 FEATURE_VALUE_TYPE(autofill::features::kAutofillPruneSuggestions)},
sczs76b9ba02019-07-23 23:34:30419 {"collections-card-presentation-style",
420 flag_descriptions::kCollectionsCardPresentationStyleName,
421 flag_descriptions::kCollectionsCardPresentationStyleDescription,
422 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kCollectionsCardPresentationStyle)},
Tanisha Mandre3a14d382019-09-05 17:33:44423 {"credit-card-scanner", flag_descriptions::kCreditCardScannerName,
424 flag_descriptions::kCreditCardScannerDescription, flags_ui::kOsIos,
425 FEATURE_VALUE_TYPE(kCreditCardScanner)},
Mike Doughertyb6c770d2019-09-13 22:56:46426 {"ios-breadcrumbs", flag_descriptions::kLogBreadcrumbsName,
427 flag_descriptions::kLogBreadcrumbsDescription, flags_ui::kOsIos,
428 FEATURE_VALUE_TYPE(kLogBreadcrumbs)},
Eugene But2823dc7e2020-07-21 18:10:37429 {"ios-synthetic-crash-reports",
430 flag_descriptions::kSyntheticCrashReportsForUteName,
431 flag_descriptions::kSyntheticCrashReportsForUteDescription,
432 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSyntheticCrashReportsForUte)},
Jérôme Lebelc374fdd2019-09-27 10:36:48433 {"force-startup-signin-promo",
434 flag_descriptions::kForceStartupSigninPromoName,
435 flag_descriptions::kForceStartupSigninPromoDescription, flags_ui::kOsIos,
436 FEATURE_VALUE_TYPE(signin::kForceStartupSigninPromo)},
Justin Cohenc57413a2019-09-30 19:42:29437 {"embedder-block-restore-url",
438 flag_descriptions::kEmbedderBlockRestoreUrlName,
439 flag_descriptions::kEmbedderBlockRestoreUrlDescription, flags_ui::kOsIos,
440 FEATURE_VALUE_TYPE(kEmbedderBlockRestoreUrl)},
David Jeanfaeae6f92020-06-05 08:51:52441 {"disable-progress-bar-animation",
442 flag_descriptions::kDisableProgressBarAnimationName,
443 flag_descriptions::kDisableProgressBarAnimationDescription,
444 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDisableProgressBarAnimation)},
sczs004fa6c2019-10-18 17:22:52445 {"messages-save-card-infobar",
446 flag_descriptions::kSaveCardInfobarMessagesUIName,
447 flag_descriptions::kSaveCardInfobarMessagesUIDescription, flags_ui::kOsIos,
448 FEATURE_VALUE_TYPE(kSaveCardInfobarMessagesUI)},
Chris Lu4cc111b452019-10-18 22:18:48449 {"messages-translate-infobar",
450 flag_descriptions::kTranslateInfobarMessagesUIName,
451 flag_descriptions::kTranslateInfobarMessagesUIDescription,
452 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kTranslateInfobarMessagesUI)},
sczs4622e6e2019-11-06 01:17:59453 {"autofill-save-card-dismiss-on-navigation",
454 flag_descriptions::kAutofillSaveCardDismissOnNavigationName,
455 flag_descriptions::kAutofillSaveCardDismissOnNavigationDescription,
456 flags_ui::kOsIos,
457 FEATURE_VALUE_TYPE(
458 autofill::features::kAutofillSaveCardDismissOnNavigation)},
Ewann6674c132019-11-06 11:20:41459 {"enable-persistent-downloads",
460 flag_descriptions::kEnablePersistentDownloadsName,
461 flag_descriptions::kEnablePersistentDownloadsDescription, flags_ui::kOsIos,
462 FEATURE_VALUE_TYPE(web::features::kEnablePersistentDownloads)},
Rohit Raoe7b489312019-11-12 12:28:55463 {"force-unstacked-tabstrip", flag_descriptions::kForceUnstackedTabstripName,
464 flag_descriptions::kForceUnstackedTabstripDescription, flags_ui::kOsIos,
465 FEATURE_VALUE_TYPE(kForceUnstackedTabstrip)},
Gauthier Ambard93914002019-11-14 12:56:12466 {"use-js-error-page", flag_descriptions::kUseJSForErrorPageName,
467 flag_descriptions::kUseJSForErrorPageDescription, flags_ui::kOsIos,
468 FEATURE_VALUE_TYPE(web::features::kUseJSForErrorPage)},
Gauthier Ambardbde9def2019-11-19 18:04:33469 {"desktop-version-default", flag_descriptions::kDefaultToDesktopOnIPadName,
470 flag_descriptions::kDefaultToDesktopOnIPadDescription, flags_ui::kOsIos,
Gauthier Ambard054175f2019-12-16 11:54:09471 FEATURE_VALUE_TYPE(web::features::kUseDefaultUserAgentInWebClient)},
Gauthier Ambardbde9def2019-11-19 18:04:33472 {"mobile-google-srp", flag_descriptions::kMobileGoogleSRPName,
473 flag_descriptions::kMobileGoogleSRPDescription, flags_ui::kOsIos,
474 FEATURE_VALUE_TYPE(web::kMobileGoogleSRP)},
Kurt Horimotod754e8ec2019-12-03 20:54:02475 {"infobar-overlay-ui", flag_descriptions::kInfobarOverlayUIName,
476 flag_descriptions::kInfobarOverlayUIDescription, flags_ui::kOsIos,
477 FEATURE_VALUE_TYPE(kInfobarOverlayUI)},
sczs391ebba2019-12-05 06:59:30478 {"autofill-save-card-infobar-edit-support",
479 flag_descriptions::kAutofillSaveCardInfobarEditSupportName,
480 flag_descriptions::kAutofillSaveCardInfobarEditSupportDescription,
481 flags_ui::kOsIos,
482 FEATURE_VALUE_TYPE(
483 autofill::features::kAutofillSaveCardInfobarEditSupport)},
Ewann Pellé987f3c12020-06-29 15:23:08484 {"page-info-refactoring", flag_descriptions::kPageInfoRefactoringName,
485 flag_descriptions::kPageInfoRefactoringDescription, flags_ui::kOsIos,
486 FEATURE_VALUE_TYPE(kPageInfoRefactoring)},
Livvie Linb861cba2020-01-22 01:54:47487 {"ssl-committed-interstitials",
488 flag_descriptions::kSSLCommittedInterstitialsName,
489 flag_descriptions::kSSLCommittedInterstitialsDescription, flags_ui::kOsIos,
490 FEATURE_VALUE_TYPE(web::features::kSSLCommittedInterstitials)},
Chris Luf7c9b072020-01-23 17:57:32491 {"fullscreen-controller-browser-scoped",
492 flag_descriptions::kFullscreenControllerBrowserScopedName,
493 flag_descriptions::kFullscreenControllerBrowserScopedDescription,
494 flags_ui::kOsIos,
495 FEATURE_VALUE_TYPE(
496 fullscreen::features::kFullscreenControllerBrowserScoped)},
Ewann93ce65c2020-03-05 16:47:13497 {"open-downloads-in-files.app",
498 flag_descriptions::kOpenDownloadsInFilesAppName,
499 flag_descriptions::kOpenDownloadsInFilesAppDescription, flags_ui::kOsIos,
500 FEATURE_VALUE_TYPE(kOpenDownloadsInFilesApp)},
Livvie Lin5e095912020-03-18 18:16:28501 {"ios-lookalike-url-navigation-suggestions-ui",
502 flag_descriptions::kIOSLookalikeUrlNavigationSuggestionsUIName,
503 flag_descriptions::kIOSLookalikeUrlNavigationSuggestionsUIDescription,
504 flags_ui::kOsIos,
505 FEATURE_VALUE_TYPE(
506 web::features::kIOSLookalikeUrlNavigationSuggestionsUI)},
Ali Juma01ca4ff2020-03-19 15:53:11507 {"safe-browsing-available", flag_descriptions::kSafeBrowsingAvailableName,
508 flag_descriptions::kSafeBrowsingAvailableDescription, flags_ui::kOsIos,
509 FEATURE_VALUE_TYPE(safe_browsing::kSafeBrowsingAvailableOnIOS)},
Ali Jumaa2821be2020-07-23 18:26:16510 {"safe-browsing-real-time",
511 flag_descriptions::kSafeBrowsingRealTimeLookupName,
512 flag_descriptions::kSafeBrowsingRealTimeLookupDescription,
513 flags_ui::kOsIos,
514 FEATURE_VALUE_TYPE(safe_browsing::kRealTimeUrlLookupEnabled)},
edchin68696842020-04-09 17:19:31515 {"managed-bookmarks-ios", flag_descriptions::kManagedBookmarksIOSName,
516 flag_descriptions::kManagedBookmarksIOSDescription, flags_ui::kOsIos,
517 FEATURE_VALUE_TYPE(kManagedBookmarksIOS)},
Anne Lime49c5cb2020-04-15 03:20:59518 {"enable-autofill-cache-server-card-info",
519 flag_descriptions::kEnableAutofillCacheServerCardInfoName,
520 flag_descriptions::kEnableAutofillCacheServerCardInfoDescription,
521 flags_ui::kOsIos,
522 FEATURE_VALUE_TYPE(autofill::features::kAutofillCacheServerCardInfo)},
sczs5b8ac5f2020-04-17 16:23:20523 {"infobar-ui-reboot-only-ios13",
524 flag_descriptions::kInfobarUIRebootOnlyiOS13Name,
525 flag_descriptions::kInfobarUIRebootOnlyiOS13Description, flags_ui::kOsIos,
526 FEATURE_VALUE_TYPE(kInfobarUIRebootOnlyiOS13)},
edchin39d08d62020-04-20 13:11:24527 {"edit-bookmarks-ios", flag_descriptions::kEditBookmarksIOSName,
528 flag_descriptions::kEditBookmarksIOSDescription, flags_ui::kOsIos,
529 FEATURE_VALUE_TYPE(kEditBookmarksIOS)},
Mike Dougherty768389502020-04-21 08:28:35530 {"url-blocklist-ios", flag_descriptions::kURLBlocklistIOSName,
531 flag_descriptions::kURLBlocklistIOSDescription, flags_ui::kOsIos,
532 FEATURE_VALUE_TYPE(kURLBlocklistIOS)},
Éric Noyau41b90108f2020-04-22 21:37:55533#if defined(__IPHONE_13_4)
534 {"pointer-support", flag_descriptions::kPointerSupportName,
535 flag_descriptions::kPointerSupportDescription, flags_ui::kOsIos,
536 FEATURE_VALUE_TYPE(kPointerSupport)},
537#endif // defined(__IPHONE_13_4)
siashah0a386222020-04-23 03:31:35538 {"autofill-enable-google-issued-card",
539 flag_descriptions::kAutofillEnableGoogleIssuedCardName,
540 flag_descriptions::kAutofillEnableGoogleIssuedCardDescription,
541 flags_ui::kOsIos,
542 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableGoogleIssuedCard)},
Nohemi Fernandez94021472020-05-05 08:33:58543 {"enable-mygoogle", flag_descriptions::kEnableMyGoogleName,
544 flag_descriptions::kEnableMyGoogleDescription, flags_ui::kOsIos,
545 FEATURE_VALUE_TYPE(kEnableMyGoogle)},
Siyu And1f86e22020-05-13 20:35:16546 {"autofill-enable-card-nickname-management",
547 flag_descriptions::kAutofillEnableCardNicknameManagementName,
548 flag_descriptions::kAutofillEnableCardNicknameManagementDescription,
549 flags_ui::kOsIos,
550 FEATURE_VALUE_TYPE(
551 autofill::features::kAutofillEnableCardNicknameManagement)},
Tina Wang52aea19d2020-05-15 16:47:33552 {"enable-ios-managed-settings-ui",
553 flag_descriptions::kEnableIOSManagedSettingsUIName,
554 flag_descriptions::kEnableIOSManagedSettingsUIDescription,
555 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableIOSManagedSettingsUI)},
Sean Harrison0ada3b082020-05-18 19:07:51556 {"safety-check-ios", flag_descriptions::kSafetyCheckIOSName,
557 flag_descriptions::kSafetyCheckIOSDescription, flags_ui::kOsIos,
558 FEATURE_VALUE_TYPE(kSafetyCheckIOS)},
sczs37d9c132020-07-18 06:06:33559 {"new-content-suggestions-feed", flag_descriptions::kDiscoverFeedInNtpName,
adamta22a4d502020-05-21 03:12:21560 flag_descriptions::kDiscoverFeedInNtpDescription, flags_ui::kOsIos,
561 FEATURE_VALUE_TYPE(kDiscoverFeedInNtp)},
Siyu An6ca4cdb2020-05-29 20:56:17562 {"autofill-enable-card-nickname-upstream",
563 flag_descriptions::kAutofillEnableCardNicknameUpstreamName,
564 flag_descriptions::kAutofillEnableCardNicknameUpstreamDescription,
565 flags_ui::kOsIos,
566 FEATURE_VALUE_TYPE(
567 autofill::features::kAutofillEnableCardNicknameUpstream)},
Maxime Charland425d9b42020-06-01 19:47:21568 {"illustrated-empty-states", flag_descriptions::kIllustratedEmptyStatesName,
569 flag_descriptions::kIllustratedEmptyStatesDescription, flags_ui::kOsIos,
570 FEATURE_VALUE_TYPE(kIllustratedEmptyStates)},
Sebastien Lalancette414fc1ce2020-06-11 14:43:06571 {"enable-native-context-menus",
572 flag_descriptions::kEnableNativeContextMenusName,
573 flag_descriptions::kEnableNativeContextMenusDescription, flags_ui::kOsIos,
574 FEATURE_VALUE_TYPE(kEnableNativeContextMenus)},
Roberto Mourab87b9722020-06-17 17:12:09575 {"expanded-tab-strip", flag_descriptions::kExpandedTabStripName,
576 flag_descriptions::kExpandedTabStripDescription, flags_ui::kOsIos,
577 FEATURE_VALUE_TYPE(kExpandedTabStrip)},
Ben Blake14592fe2020-06-16 15:34:38578 {"autofill-enable-offers-in-downstream",
579 flag_descriptions::kAutofillEnableOffersInDownstreamName,
580 flag_descriptions::kAutofillEnableOffersInDownstreamDescription,
581 flags_ui::kOsIos,
582 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableOffersInDownstream)},
Tommy Martino6b4eb7e2020-06-25 18:25:41583 {"shared-highlighting-ios", flag_descriptions::kSharedHighlightingIOSName,
584 flag_descriptions::kSharedHighlightingIOSDescription, flags_ui::kOsIos,
585 FEATURE_VALUE_TYPE(kSharedHighlightingIOS)},
edchin8fdb893042020-06-25 23:17:07586 {"add-web-content-drop-interaction",
587 flag_descriptions::kAddWebContentDropInteractionName,
588 flag_descriptions::kAddWebContentDropInteractionDescription,
589 flags_ui::kOsIos,
590 FEATURE_VALUE_TYPE(web::features::kAddWebContentDropInteraction)},
Julian Mentasti-Meza4c0a4162020-07-20 18:51:41591 {"enable-fullpage-screenshot",
592 flag_descriptions::kEnableFullPageScreenshotName,
593 flag_descriptions::kEnableFullPageScreenshotDescription, flags_ui::kOsIos,
594 FEATURE_VALUE_TYPE(kEnableFullPageScreenshot)},
Tommy Martino40124672020-07-31 17:29:44595 {"scroll-to-text-ios", flag_descriptions::kScrollToTextIOSName,
596 flag_descriptions::kScrollToTextIOSDescription, flags_ui::kOsIos,
597 FEATURE_VALUE_TYPE(web::features::kScrollToTextIOS)},
Chris Thompson40cbb162020-08-04 23:22:15598 {"legacy-tls-interstitial",
599 flag_descriptions::kIOSLegacyTLSInterstitialsName,
600 flag_descriptions::kIOSLegacyTLSInterstitialsDescription, flags_ui::kOsIos,
601 FEATURE_VALUE_TYPE(web::features::kIOSLegacyTLSInterstitial)},
Ewann163e3952020-08-21 12:34:49602 {"extend-open-in-files-support",
603 flag_descriptions::kExtendOpenInFilesSupportName,
604 flag_descriptions::kExtendOpenInFilesSupportDescription, flags_ui::kOsIos,
605 FEATURE_VALUE_TYPE(kExtendOpenInFilesSupport)},
Jan Wilken Dörrie7df8c602020-08-31 11:16:39606 {"well-known-change-password",
607 flag_descriptions::kWellKnownChangePasswordName,
608 flag_descriptions::kWellKnownChangePasswordDescription, flags_ui::kOsIos,
609 FEATURE_VALUE_TYPE(password_manager::features::kWellKnownChangePassword)},
Ewanne1ffc6d2020-09-01 07:56:13610 {"enable-close-all-tabs-confirmation",
611 flag_descriptions::kEnableCloseAllTabsConfirmationName,
612 flag_descriptions::kEnableCloseAllTabsConfirmationDescription,
613 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableCloseAllTabsConfirmation)},
Sylvain Defresne9c107082020-10-27 16:39:13614#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
edchin81467b82020-09-03 19:31:45615 {"screen-time-integration-ios",
616 flag_descriptions::kScreenTimeIntegrationName,
617 flag_descriptions::kScreenTimeIntegrationDescription, flags_ui::kOsIos,
618 FEATURE_VALUE_TYPE(kScreenTimeIntegration)},
Sylvain Defresne9c107082020-10-27 16:39:13619#endif
Nohemi Fernandez983d6d52020-09-09 09:46:19620 {"mobile-identity-consistency",
621 flag_descriptions::kMobileIdentityConsistencyName,
622 flag_descriptions::kMobileIdentityConsistencyDescription, flags_ui::kOsIos,
623 FEATURE_VALUE_TYPE(signin::kMobileIdentityConsistency)},
Chris Lu34503302020-09-11 22:08:07624 {"default-browser-fullscreen-promo",
625 flag_descriptions::kDefaultBrowserFullscreenPromoName,
626 flag_descriptions::kDefaultBrowserFullscreenPromoDescription,
627 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDefaultBrowserFullscreenPromo)},
Gauthier Ambarda1d88a02020-09-14 11:46:37628 {"default-browser-setting", flag_descriptions::kDefaultBrowserSettingsName,
629 flag_descriptions::kDefaultBrowserSettingsDescription, flags_ui::kOsIos,
630 FEATURE_VALUE_TYPE(kDefaultBrowserSettings)},
Nazerke3e993f72020-09-21 13:00:06631 {"modern-tab-strip", flag_descriptions::kModernTabStripName,
632 flag_descriptions::kModernTabStripDescription, flags_ui::kOsIos,
633 FEATURE_VALUE_TYPE(kModernTabStrip)},
Maria Kazinovad4e2ed72020-09-22 17:40:50634 {"autofill-use-renderer-ids",
635 flag_descriptions::kAutofillUseRendererIDsName,
636 flag_descriptions::kAutofillUseRendererIDsDescription, flags_ui::kOsIos,
637 FEATURE_VALUE_TYPE(
638 autofill::features::kAutofillUseUniqueRendererIDsOnIOS)},
Nohemi Fernandez704527492020-09-23 14:00:08639 {"restore-gaia-cookies-if-deleted",
640 flag_descriptions::kRestoreGaiaCookiesIfDeletedName,
641 flag_descriptions::kRestoreGaiaCookiesIfDeletedDescription,
642 flags_ui::kOsIos,
643 FEATURE_VALUE_TYPE(signin::kRestoreGaiaCookiesIfDeleted)},
Nohemi Fernandez222d6d42020-09-30 20:35:57644 {"minutes-delay-to-restore-gaia-cookies-if-deleted",
645 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieName,
646 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieDescription,
647 flags_ui::kOsIos,
648 MULTI_VALUE_TYPE(kDelayThresholdMinutesToUpdateGaiaCookieChoices)},
Viktor Semeniukd932ff52020-10-13 13:10:17649 {"edit-passwords-in-settings",
650 flag_descriptions::kEditPasswordsInSettingsName,
651 flag_descriptions::kEditPasswordsInSettingsDescription, flags_ui::kOsIos,
652 FEATURE_VALUE_TYPE(password_manager::features::kEditPasswordsInSettings)},
Stepan Khapuginddb85962020-10-21 11:49:58653 {"enable-incognito-authentication-ios",
654 flag_descriptions::kIncognitoAuthenticationName,
655 flag_descriptions::kIncognitoAuthenticationDescription, flags_ui::kOsIos,
656 FEATURE_VALUE_TYPE(kIncognitoAuthentication)},
Chris Lu36a2f972020-10-21 16:30:34657 {"location-first-run-modal", flag_descriptions::kLocationFirstRunModalName,
658 flag_descriptions::kLocationFirstRunModalDescription, flags_ui::kOsIos,
659 FEATURE_VALUE_TYPE(kLocationFirstRunModal)},
660 {"location-remove-first-run",
661 flag_descriptions::kLocationRemoveFirstRunPromptName,
662 flag_descriptions::kLocationRemoveFirstRunPromptDescription,
663 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kLocationRemoveFirstRunPrompt)},
664 {"location-change-string", flag_descriptions::kLocationStringChangeName,
665 flag_descriptions::kLocationStringChangeDescription, flags_ui::kOsIos,
666 FEATURE_VALUE_TYPE(kLocationStringChange)},
Gauthier Ambardcb6a0ccc2020-10-30 13:12:00667 {"web-view-native-context-menu",
668 flag_descriptions::kWebViewNativeContextMenuName,
669 flag_descriptions::kWebViewNativeContextMenuDescription, flags_ui::kOsIos,
670 FEATURE_VALUE_TYPE(web::features::kWebViewNativeContextMenu)},
Gauthier Ambarde813c07f2020-01-09 10:18:49671};
sdefresne14900ee2015-11-27 14:43:21672
Rohit Raobed794c2020-04-27 15:27:45673bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
674 return false;
675}
676
677flags_ui::FlagsState& GetGlobalFlagsState() {
678 static base::NoDestructor<flags_ui::FlagsState> flags_state(kFeatureEntries,
679 nullptr);
680 return *flags_state;
681}
682} // namespace
683
sdefresne14900ee2015-11-27 14:43:21684// Add all switches from experimental flags to |command_line|.
685void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) {
686 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
687
sdefresne14900ee2015-11-27 14:43:21688 // Set the UA flag if UseMobileSafariUA is enabled.
689 if ([defaults boolForKey:@"UseMobileSafariUA"]) {
690 // Safari uses "Vesion/", followed by the OS version excluding bugfix, where
691 // Chrome puts its product token.
avi571943672015-12-22 02:12:49692 int32_t major = 0;
693 int32_t minor = 0;
694 int32_t bugfix = 0;
sdefresne14900ee2015-11-27 14:43:21695 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix);
696 std::string product = base::StringPrintf("Version/%d.%d", major, minor);
697
Gauthier Ambardba163d42020-05-27 14:48:17698 command_line->AppendSwitchASCII(switches::kUserAgent,
699 web::BuildMobileUserAgent(product));
sdefresne14900ee2015-11-27 14:43:21700 }
701
Guillaume Jenkins25e9bd72020-08-27 17:39:06702 // Shared variables for all enterprise experimental flags.
Guillaume Jenkins57606d72020-08-13 17:32:55703 NSMutableDictionary* testing_policies = [[NSMutableDictionary alloc] init];
Guillaume Jenkins25e9bd72020-08-27 17:39:06704 NSMutableArray* allowed_experimental_policies = [[NSMutableArray alloc] init];
Guillaume Jenkins57606d72020-08-13 17:32:55705
Guillaume Jenkins25e9bd72020-08-27 17:39:06706 // Set some sample policy values for testing if EnableSamplePolicies is set to
707 // true.
Guillaume Jenkinseeb7007c2020-06-25 22:55:40708 if ([defaults boolForKey:@"EnableSamplePolicies"]) {
Guillaume Jenkins25e9bd72020-08-27 17:39:06709 // Some of the sample policies are still marked as experimental and must be
710 // explicitly allowed, otherwise they will be ignored in Beta and Stable.
711 [allowed_experimental_policies addObjectsFromArray:@[
Tina Wang59d0b7e2020-08-11 04:41:01712 base::SysUTF8ToNSString(policy::key::kAutofillAddressEnabled),
Sébastien Séguin-Gagnonc107b1f2020-07-02 21:43:58713 base::SysUTF8ToNSString(policy::key::kAutofillCreditCardEnabled),
714 base::SysUTF8ToNSString(policy::key::kChromeVariations),
715 base::SysUTF8ToNSString(policy::key::kDefaultPopupsSetting),
Tina Wang5abee802020-07-29 23:09:52716 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderEnabled),
717 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderName),
718 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderSearchURL),
Tina Wang89068c82020-10-29 15:51:50719 base::SysUTF8ToNSString(policy::key::kEditBookmarksEnabled),
Tina Wang59d0b7e2020-08-11 04:41:01720 base::SysUTF8ToNSString(policy::key::kPasswordManagerEnabled),
Tina Wang54dddfc22020-08-20 22:34:53721 base::SysUTF8ToNSString(policy::key::kSafeBrowsingProtectionLevel),
722 base::SysUTF8ToNSString(policy::key::kSearchSuggestEnabled),
Tina Wang59d0b7e2020-08-11 04:41:01723 base::SysUTF8ToNSString(policy::key::kTranslateEnabled)
Guillaume Jenkins25e9bd72020-08-27 17:39:06724 ]];
Sébastien Séguin-Gagnonc107b1f2020-07-02 21:43:58725
726 // Define sample policies to enable.
Guillaume Jenkins57606d72020-08-13 17:32:55727 [testing_policies addEntriesFromDictionary:@{
Tina Wang59d0b7e2020-08-11 04:41:01728 base::SysUTF8ToNSString(policy::key::kAutofillAddressEnabled) : @NO,
729
Guillaume Jenkinseeb7007c2020-06-25 22:55:40730 base::SysUTF8ToNSString(policy::key::kAutofillCreditCardEnabled) : @NO,
731
732 // 2 = Disable all variations
733 base::SysUTF8ToNSString(policy::key::kChromeVariations) : @2,
734
735 // 2 = Do not allow any site to show popups
736 base::SysUTF8ToNSString(policy::key::kDefaultPopupsSetting) : @2,
737
Tina Wang5abee802020-07-29 23:09:52738 // Set default search engine.
739 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderEnabled) :
740 @YES,
741 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderSearchURL) :
742 @"http://www.google.com/search?q={searchTerms}",
743 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderName) :
Tina Wang7cd0a062020-09-15 21:31:02744 @"TestEngine",
Tina Wang5abee802020-07-29 23:09:52745
Tina Wang89068c82020-10-29 15:51:50746 base::SysUTF8ToNSString(policy::key::kEditBookmarksEnabled) : @NO,
747
Guillaume Jenkinseeb7007c2020-06-25 22:55:40748 base::SysUTF8ToNSString(policy::key::kPasswordManagerEnabled) : @NO,
Tina Wang59d0b7e2020-08-11 04:41:01749
750 base::SysUTF8ToNSString(policy::key::kTranslateEnabled) : @NO,
Tina Wang54dddfc22020-08-20 22:34:53751
752 // 2 = Enhanced safe browsing protection
753 base::SysUTF8ToNSString(policy::key::kSafeBrowsingProtectionLevel) : @2,
754
755 base::SysUTF8ToNSString(policy::key::kSearchSuggestEnabled) : @YES,
Guillaume Jenkins57606d72020-08-13 17:32:55756 }];
757 }
758
759 // If a CBCM enrollment token is provided, force Chrome Browser Cloud
Guillaume Jenkins25e9bd72020-08-27 17:39:06760 // Management to enabled, add the token to the list of policies, and allow
761 // the CloudReportingEnabled experimental policy.
Guillaume Jenkins57606d72020-08-13 17:32:55762 NSString* token_key =
763 base::SysUTF8ToNSString(policy::key::kCloudManagementEnrollmentToken);
764 NSString* token = [defaults stringForKey:token_key];
765
766 if ([token length] > 0) {
767 command_line->AppendSwitch(switches::kEnableChromeBrowserCloudManagement);
Guillaume Jenkins25e9bd72020-08-27 17:39:06768 [allowed_experimental_policies
769 addObject:base::SysUTF8ToNSString(policy::key::kCloudReportingEnabled)];
Guillaume Jenkins57606d72020-08-13 17:32:55770 [testing_policies setValue:token forKey:token_key];
771 }
772
Guillaume Jenkins25e9bd72020-08-27 17:39:06773 // If any experimental policy was allowed, set the EnableExperimentalPolicies
774 // policy.
775 if ([allowed_experimental_policies count] > 0) {
776 [testing_policies setValue:allowed_experimental_policies
777 forKey:base::SysUTF8ToNSString(
778 policy::key::kEnableExperimentalPolicies)];
779 }
780
Guillaume Jenkins57606d72020-08-13 17:32:55781 // If some policies were set, commit them to the app's registration defaults.
782 if ([testing_policies count] > 0) {
Guillaume Jenkinseeb7007c2020-06-25 22:55:40783 NSDictionary* registration_defaults =
784 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
785 [defaults registerDefaults:registration_defaults];
786 }
787
sdefresne14900ee2015-11-27 14:43:21788 // Freeform commandline flags. These are added last, so that any flags added
789 // earlier in this function take precedence.
790 if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) {
791 base::CommandLine::StringVector flags;
792 // Append an empty "program" argument.
793 flags.push_back("");
794
795 // The number of flags corresponds to the number of text fields in
796 // Experimental.plist.
797 const int kNumFreeformFlags = 5;
798 for (int i = 1; i <= kNumFreeformFlags; ++i) {
799 NSString* key =
800 [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i];
801 NSString* flag = [defaults stringForKey:key];
802 if ([flag length]) {
Robbie Gibsonc91ce622019-05-20 14:44:33803 // iOS keyboard replaces -- with —, so undo that.
804 flag = [flag stringByReplacingOccurrencesOfString:@"—"
805 withString:@"--"
806 options:0
807 range:NSMakeRange(0, 1)];
808 // To make things easier, allow flags with no dashes by prepending them
809 // here. This also allows for flags that just have one dash if they
810 // exist.
811 if (![flag hasPrefix:@"-"]) {
812 flag = [@"--" stringByAppendingString:flag];
813 }
sdefresne14900ee2015-11-27 14:43:21814 flags.push_back(base::SysNSStringToUTF8(flag));
815 }
816 }
817
818 base::CommandLine temp_command_line(flags);
819 command_line->AppendArguments(temp_command_line, false);
820 }
msardafc76f662017-02-24 12:46:28821
justincohendacc85d2017-06-28 23:34:10822 // Populate command line flag for 3rd party keyboard omnibox workaround.
823 NSString* enableThirdPartyKeyboardWorkaround =
824 [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"];
825 if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) {
826 command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround);
827 } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) {
828 command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround);
829 }
830
msardafc76f662017-02-24 12:46:28831 ios::GetChromeBrowserProvider()->AppendSwitchesFromExperimentalSettings(
832 defaults, command_line);
sdefresne14900ee2015-11-27 14:43:21833}
834
sdefresne14900ee2015-11-27 14:43:21835void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage,
836 base::CommandLine* command_line) {
Sylvain Defresne8327a2f2019-01-17 14:19:18837 GetGlobalFlagsState().ConvertFlagsToSwitches(
sdefresnec9763902015-12-02 10:30:11838 flags_storage, command_line, flags_ui::kAddSentinels,
Gregory Chatzinofff6523722017-11-21 01:33:53839 switches::kEnableFeatures, switches::kDisableFeatures);
sdefresne14900ee2015-11-27 14:43:21840}
841
jkrcalbf073372016-07-29 07:21:31842std::vector<std::string> RegisterAllFeatureVariationParameters(
843 flags_ui::FlagsStorage* flags_storage,
844 base::FeatureList* feature_list) {
Justin Cohen2e2adb52019-10-25 17:00:02845 // Occasionally DCHECK crashes on canary can be very distuptive. An
846 // experimental flag was added to aid in temporarily disabling this for
847 // canary testers.
848#if defined(DCHECK_IS_CONFIGURABLE)
849 if (experimental_flags::AreDCHECKCrashesDisabled()) {
850 std::vector<base::FeatureList::FeatureOverrideInfo> overrides;
851 overrides.push_back(
852 {std::cref(base::kDCheckIsFatalFeature),
853 base::FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE});
854 feature_list->RegisterExtraFeatureOverrides(std::move(overrides));
855 }
856#endif // defined(DCHECK_IS_CONFIGURABLE)
857
Sylvain Defresne8327a2f2019-01-17 14:19:18858 return GetGlobalFlagsState().RegisterAllFeatureVariationParameters(
859 flags_storage, feature_list);
jkrcalbf073372016-07-29 07:21:31860}
861
sdefresne14900ee2015-11-27 14:43:21862void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage,
863 flags_ui::FlagAccess access,
864 base::ListValue* supported_entries,
865 base::ListValue* unsupported_entries) {
Sylvain Defresne8327a2f2019-01-17 14:19:18866 GetGlobalFlagsState().GetFlagFeatureEntries(
sdefresne14900ee2015-11-27 14:43:21867 flags_storage, access, supported_entries, unsupported_entries,
868 base::Bind(&SkipConditionalFeatureEntry));
869}
870
871void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage,
872 const std::string& internal_name,
873 bool enable) {
Sylvain Defresne8327a2f2019-01-17 14:19:18874 GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name,
875 enable);
sdefresne14900ee2015-11-27 14:43:21876}
877
878void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) {
Sylvain Defresne8327a2f2019-01-17 14:19:18879 GetGlobalFlagsState().ResetAllFlags(flags_storage);
sdefresne14900ee2015-11-27 14:43:21880}
881
882namespace testing {
883
884const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) {
kokihoon189a4022018-10-13 02:43:44885 *count = base::size(kFeatureEntries);
sdefresne14900ee2015-11-27 14:43:21886 return kFeatureEntries;
887}
888
889} // namespace testing