blob: 5877623f7795101276b090b21dc2be7e85318e17 [file] [log] [blame]
sdefresne14900ee2015-11-27 14:43:211// Copyright 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Implementation of about_flags for iOS that sets flags based on experimental
6// settings.
7
Nazerke9c259052019-06-26 15:30:108#include "ios/chrome/browser/flags/about_flags.h"
sdefresne14900ee2015-11-27 14:43:219
Nazerke9c259052019-06-26 15:30:1010#import <UIKit/UIKit.h>
avi571943672015-12-22 02:12:4911#include <stddef.h>
12#include <stdint.h>
sdefresne14900ee2015-11-27 14:43:2113
Gregory Chatzinofff6523722017-11-21 01:33:5314#include "base/base_switches.h"
sdefresne14900ee2015-11-27 14:43:2115#include "base/bind.h"
danakjdb9ae7942020-11-11 16:01:3516#include "base/callback_helpers.h"
Hans Wennborg3a2fb61f2020-05-11 15:51:1617#include "base/check_op.h"
David Jean5ca263c2021-08-18 09:19:3018#import "base/mac/foundation_util.h"
Sylvain Defresne8327a2f2019-01-17 14:19:1819#include "base/no_destructor.h"
sdefresne14900ee2015-11-27 14:43:2120#include "base/strings/stringprintf.h"
21#include "base/strings/sys_string_conversions.h"
Sebastien Marchand75a7cdf2018-11-13 23:47:0322#include "base/system/sys_info.h"
Mohamad Ahmadic4df81f2017-12-20 04:41:5923#include "components/autofill/core/common/autofill_features.h"
Jared Sauld998539f2019-03-19 15:11:1724#include "components/autofill/core/common/autofill_payments_features.h"
Moe Ahmadid6d5d172018-06-20 17:20:2325#include "components/autofill/core/common/autofill_switches.h"
Olivier Robin3d60411622018-02-23 10:03:2226#include "components/autofill/ios/browser/autofill_switches.h"
Jesse McKenna85c1a59f2021-05-05 19:08:3027#include "components/breadcrumbs/core/features.h"
Matt Jones125dfb42022-02-11 17:23:4228#include "components/commerce/core/commerce_feature_list.h"
29#include "components/commerce/core/flag_descriptions.h"
Robbie Gibson5e3436632020-04-27 15:48:0430#include "components/content_settings/core/common/features.h"
sdefresne14900ee2015-11-27 14:43:2131#include "components/dom_distiller/core/dom_distiller_switches.h"
Guillaume Jenkins4e6ac1e2020-11-11 16:57:4032#include "components/enterprise/browser/enterprise_switches.h"
Tommy Nyquistc1d6dea12017-07-26 20:37:2333#include "components/feature_engagement/public/feature_constants.h"
34#include "components/feature_engagement/public/feature_list.h"
edchind847c0962021-03-03 18:17:0535#include "components/feed/feed_feature_list.h"
sdefresne14900ee2015-11-27 14:43:2136#include "components/flags_ui/feature_entry.h"
37#include "components/flags_ui/feature_entry_macros.h"
38#include "components/flags_ui/flags_storage.h"
39#include "components/flags_ui/flags_ui_switches.h"
Tanja Gornakb0985dd2018-10-11 17:24:4040#include "components/invalidation/impl/invalidation_switches.h"
noyau4cfb1332016-10-25 17:05:4241#include "components/ntp_tiles/switches.h"
Justin Donnelly33d712e2017-08-23 21:32:5142#include "components/omnibox/browser/omnibox_field_trial.h"
Tomasz Wiszkowskid938a1112019-03-06 18:01:5743#include "components/omnibox/common/omnibox_features.h"
Raj T3898f032021-08-19 23:51:2744#include "components/optimization_guide/core/optimization_guide_features.h"
Ioana Pandeled14ce9e2017-11-28 14:41:4645#include "components/password_manager/core/common/password_manager_features.h"
mathp9b4c11d2017-07-06 20:24:1346#include "components/payments/core/features.h"
Guillaume Jenkinseeb7007c2020-06-25 22:55:4047#import "components/policy/core/common/policy_loader_ios_constants.h"
48#include "components/policy/policy_constants.h"
Joemer Ramos34175732022-02-14 18:59:1649#include "components/safe_browsing/core/common/features.h"
Victor Hugo Vianna Silva0399402f2021-09-07 21:41:2550#import "components/send_tab_to_self/features.h"
Tommy Martino0caf3362021-01-13 20:29:5851#include "components/shared_highlighting/core/common/shared_highlighting_features.h"
Valeriya Sinevicha79dc612018-09-25 14:49:0952#include "components/signin/core/browser/account_reconcilor.h"
Jérôme Lebelc374fdd2019-09-27 10:36:4853#include "components/signin/ios/browser/features.h"
Colin Blundell3517170e2019-07-11 08:16:3454#include "components/signin/public/base/signin_switches.h"
sdefresne36579782016-02-05 11:08:2555#include "components/strings/grit/components_strings.h"
Victor Hugo Vianna Silvaa48aa01c2022-02-09 20:38:2356#include "components/sync/base/command_line_switches.h"
57#include "components/sync/base/features.h"
Ewann570a6302021-08-17 07:22:4258#include "components/sync/base/pref_names.h"
Moe Ahmadie4cce1f2018-12-18 23:48:0159#include "components/translate/core/browser/translate_prefs.h"
Olivier Robinffe767c2022-04-21 13:13:2360#include "components/translate/core/common/translate_util.h"
Sylvain Defresneae6987e2018-03-01 13:21:4061#include "ios/chrome/browser/browsing_data/browsing_data_features.h"
sdefresne14900ee2015-11-27 14:43:2162#include "ios/chrome/browser/chrome_switches.h"
Eugene But2823dc7e2020-07-21 18:10:3763#include "ios/chrome/browser/crash_report/features.h"
Nazerke21bdc45a2019-07-11 09:02:0564#include "ios/chrome/browser/flags/ios_chrome_flag_descriptions.h"
Ed Chin100660bf2022-04-26 16:59:1365#import "ios/chrome/browser/ntp/features.h"
Vincent Boisselled042d552022-04-09 01:22:5966#include "ios/chrome/browser/policy/cloud/user_policy_switch.h"
Vincent Boisselle19200bc2021-09-01 17:58:2567#include "ios/chrome/browser/policy/policy_util.h"
Sylvain Defresne9c107082020-10-27 16:39:1368#include "ios/chrome/browser/screen_time/screen_time_buildflags.h"
Olivier Robin3a957df2021-12-21 18:04:3469#import "ios/chrome/browser/sessions/session_features.h"
Gauthier Ambard33e03302019-02-21 13:28:5870#include "ios/chrome/browser/system_flags.h"
Louis Romeroac04f786a2022-04-19 09:39:3071#include "ios/chrome/browser/ui/bubble/bubble_features.h"
adamta22a4d502020-05-21 03:12:2172#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h"
Javier Ernesto Flores Robles209b2822021-03-25 19:16:5073#import "ios/chrome/browser/ui/default_promo/default_browser_utils.h"
Ewann1a9d33d2021-06-14 11:12:2474#import "ios/chrome/browser/ui/download/features.h"
Aliona DANGLAebfd7d022021-10-08 14:15:4575#include "ios/chrome/browser/ui/first_run/fre_field_trial.h"
Kurt Horimoto4da682b022018-04-12 07:43:3576#import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h"
adamta273568472020-12-04 23:53:5777#import "ios/chrome/browser/ui/ntp/new_tab_page_feature.h"
Christian Xub8c06cd2022-04-29 20:55:0178#import "ios/chrome/browser/ui/omnibox/omnibox_ui_features.h"
Tina Wang17514e2f2021-09-24 23:57:1879#import "ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_features.h"
Robbie Gibson686c56732021-10-04 17:11:4580#import "ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.h"
gogerald0ff29e52021-02-03 18:56:1981#import "ios/chrome/browser/ui/start_surface/start_surface_features.h"
Nazerke0bf10c42020-11-12 11:17:3282#import "ios/chrome/browser/ui/tab_switcher/tab_grid/features.h"
Kurt Horimoto79d590b2018-09-12 19:09:2883#import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h"
Justin Cohen2d81c582018-01-22 14:46:4484#include "ios/chrome/browser/ui/ui_feature_flags.h"
Louis Romerofbfbd932022-04-15 18:04:5085#include "ios/chrome/browser/ui/util/features.h"
Yi Su392b3032018-06-05 07:26:4786#include "ios/chrome/browser/web/features.h"
sdefresne14900ee2015-11-27 14:43:2187#include "ios/chrome/grit/ios_strings.h"
Mustafa Emre Acer4de8863a2022-05-03 22:17:0188#include "ios/components/security_interstitials/https_only_mode/feature.h"
Sylvain Defresne559ce5f2022-01-13 17:14:5889#include "ios/public/provider/chrome/browser/app_utils/app_utils_api.h"
Eugene But61818bc2019-04-15 21:04:0790#include "ios/web/common/features.h"
Eugene Bute79f2742019-07-26 17:07:2291#include "ios/web/common/user_agent.h"
Eugene Butb1416232019-07-22 17:31:5892#include "ios/web/common/web_view_creation_util.h"
sdefresne14900ee2015-11-27 14:43:2193
Sylvain Defresne9c107082020-10-27 16:39:1394#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
95#include "ios/chrome/browser/screen_time/features.h"
96#endif
97
sdefresne14900ee2015-11-27 14:43:2198#if !defined(OFFICIAL_BUILD)
99#include "components/variations/variations_switches.h"
vitaliii489217aa2017-01-30 14:50:22100#endif
stkhapuginc1be1792016-12-13 14:30:53101
102#if !defined(__has_feature) || !__has_feature(objc_arc)
103#error "This file requires ARC support."
104#endif
sdefresne14900ee2015-11-27 14:43:21105
elawrence816f6790e2017-06-16 18:19:28106using flags_ui::FeatureEntry;
107
sdefresne14900ee2015-11-27 14:43:21108namespace {
Emily Starkbafa9062017-12-27 15:22:46109
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
Nohemi Fernandez222d6d42020-09-30 20:35:57122const FeatureEntry::Choice kDelayThresholdMinutesToUpdateGaiaCookieChoices[] = {
123 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
124 {"0", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "0"},
125 {"10", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "10"},
126 {"60", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "60"},
127};
128
Nohemi Fernandezc00842a2021-07-26 11:47:34129const FeatureEntry::Choice
130 kWaitThresholdMillisecondsForCapabilitiesApiChoices[] = {
131 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
132 {"200", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "200"},
133 {"500", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "500"},
134 {"5000", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "5000"},
135};
136
Stepan Khapugincc4e9842019-01-23 13:38:13137const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = {
138 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}};
139const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = {
140 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}};
141const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = {
142 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}};
143const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = {
144 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}};
145const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = {
146 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}};
147const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = {
148 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}};
149const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = {
150 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}};
151
152const FeatureEntry::FeatureVariation
153 kOmniboxUIMaxAutocompleteMatchesVariations[] = {
154 {"3 matches", kOmniboxUIMaxAutocompleteMatches3,
Daniel Cheng1f047a82022-02-26 10:04:53155 std::size(kOmniboxUIMaxAutocompleteMatches3), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13156 {"4 matches", kOmniboxUIMaxAutocompleteMatches4,
Daniel Cheng1f047a82022-02-26 10:04:53157 std::size(kOmniboxUIMaxAutocompleteMatches4), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13158 {"5 matches", kOmniboxUIMaxAutocompleteMatches5,
Daniel Cheng1f047a82022-02-26 10:04:53159 std::size(kOmniboxUIMaxAutocompleteMatches5), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13160 {"6 matches", kOmniboxUIMaxAutocompleteMatches6,
Daniel Cheng1f047a82022-02-26 10:04:53161 std::size(kOmniboxUIMaxAutocompleteMatches6), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13162 {"8 matches", kOmniboxUIMaxAutocompleteMatches8,
Daniel Cheng1f047a82022-02-26 10:04:53163 std::size(kOmniboxUIMaxAutocompleteMatches8), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13164 {"10 matches", kOmniboxUIMaxAutocompleteMatches10,
Daniel Cheng1f047a82022-02-26 10:04:53165 std::size(kOmniboxUIMaxAutocompleteMatches10), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13166 {"12 matches", kOmniboxUIMaxAutocompleteMatches12,
Daniel Cheng1f047a82022-02-26 10:04:53167 std::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}};
Stepan Khapugincc4e9842019-01-23 13:38:13168
Stepan Khapuginbac467e2022-05-06 21:11:54169const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches6[] = {
170 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "6"}};
171const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches15[] = {
172 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "15"}};
173const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches20[] = {
174 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "20"}};
175
176const FeatureEntry::FeatureVariation kOmniboxMaxZPSMatchesVariations[] = {
177 {"6 matches", kOmniboxMaxZPSMatches6, std::size(kOmniboxMaxZPSMatches6),
178 nullptr},
179 {"15 matches", kOmniboxMaxZPSMatches15, std::size(kOmniboxMaxZPSMatches15),
180 nullptr},
181 {"20 matches", kOmniboxMaxZPSMatches20, std::size(kOmniboxMaxZPSMatches20),
182 nullptr},
183};
184
Caitlin Fischer37e01232019-05-24 13:05:45185const FeatureEntry::FeatureParam
186 kAutofillUseMobileLabelDisambiguationShowAll[] = {
187 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
188 autofill::features::
189 kAutofillUseMobileLabelDisambiguationParameterShowAll}};
190const FeatureEntry::FeatureParam
191 kAutofillUseMobileLabelDisambiguationShowOne[] = {
192 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
193 autofill::features::
194 kAutofillUseMobileLabelDisambiguationParameterShowOne}};
195
196const FeatureEntry::FeatureVariation
197 kAutofillUseMobileLabelDisambiguationVariations[] = {
198 {"(show all)", kAutofillUseMobileLabelDisambiguationShowAll,
Daniel Cheng1f047a82022-02-26 10:04:53199 std::size(kAutofillUseMobileLabelDisambiguationShowAll), nullptr},
Caitlin Fischer37e01232019-05-24 13:05:45200 {"(show one)", kAutofillUseMobileLabelDisambiguationShowOne,
Daniel Cheng1f047a82022-02-26 10:04:53201 std::size(kAutofillUseMobileLabelDisambiguationShowOne), nullptr}};
Caitlin Fischer37e01232019-05-24 13:05:45202
Javier Ernesto Flores Roblese85f4a12021-02-23 18:10:10203const FeatureEntry::FeatureParam
Javier Ernesto Flores Robles159414232021-06-16 14:29:59204 kDefaultBrowserFullscreenPromoExperimentRemindMeLater[] = {
205 {kDefaultBrowserFullscreenPromoExperimentRemindMeGroupParam, "true"}};
206const FeatureEntry::FeatureVariation
207 kDefaultBrowserFullscreenPromoExperimentVariations[] = {
208 {"Remind me later",
209 kDefaultBrowserFullscreenPromoExperimentRemindMeLater,
Daniel Cheng1f047a82022-02-26 10:04:53210 std::size(kDefaultBrowserFullscreenPromoExperimentRemindMeLater),
Javier Ernesto Flores Robles159414232021-06-16 14:29:59211 nullptr}};
212
gogeralddb0d8ae2020-11-13 03:56:58213const FeatureEntry::FeatureParam kDiscoverFeedInNtpEnableNativeUI[] = {
214 {kDiscoverFeedIsNativeUIEnabled, "true"}};
215const FeatureEntry::FeatureVariation kDiscoverFeedInNtpVariations[] = {
216 {"Native UI", kDiscoverFeedInNtpEnableNativeUI,
Daniel Cheng1f047a82022-02-26 10:04:53217 std::size(kDiscoverFeedInNtpEnableNativeUI), nullptr}};
gogeralddb0d8ae2020-11-13 03:56:58218
Sergio Collazos9fcc6ed2021-10-06 00:58:03219const FeatureEntry::FeatureParam kDiscoverFeedSRSReconstructedTemplates[] = {
220 {kDiscoverFeedSRSReconstructedTemplatesEnabled, "true"}};
221const FeatureEntry::FeatureParam kDiscoverFeedSRSPreloadTemplates[] = {
222 {kDiscoverFeedSRSPreloadTemplatesEnabled, "true"}};
223const FeatureEntry::FeatureVariation
224 kEnableDiscoverFeedStaticResourceServingVariations[] = {
225 {"Reconstruct Templates", kDiscoverFeedSRSReconstructedTemplates,
Daniel Cheng1f047a82022-02-26 10:04:53226 std::size(kDiscoverFeedSRSReconstructedTemplates), nullptr},
Sergio Collazos9fcc6ed2021-10-06 00:58:03227 {"Preload Templates", kDiscoverFeedSRSPreloadTemplates,
Daniel Cheng1f047a82022-02-26 10:04:53228 std::size(kDiscoverFeedSRSPreloadTemplates), nullptr},
Sergio Collazos9fcc6ed2021-10-06 00:58:03229};
230
Mohammad Refaatab6bee62022-05-16 16:31:15231const FeatureEntry::FeatureParam kDiscoverFeedTopSyncPromoFullWithTitle[] = {
232 {kDiscoverFeedTopSyncPromoStyleParam,
233 kDiscoverFeedTopSyncPromoStyleFullWithTitle}};
234const FeatureEntry::FeatureParam kDiscoverFeedTopSyncPromoCompact[] = {
235 {kDiscoverFeedTopSyncPromoStyleParam,
236 kDiscoverFeedTopSyncPromoStyleCompact}};
237const FeatureEntry::FeatureVariation kDiscoverFeedTopSyncPromoVariations[] = {
238 {"Full with title", kDiscoverFeedTopSyncPromoFullWithTitle,
239 std::size(kDiscoverFeedTopSyncPromoFullWithTitle), nullptr},
240 {"Compact", kDiscoverFeedTopSyncPromoCompact,
241 std::size(kDiscoverFeedTopSyncPromoCompact), nullptr}};
242
Robbie Gibson46351032022-03-31 19:46:23243const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion1[] = {
244 {kIOSOmniboxUpdatedPopupUIVariationName,
245 kIOSOmniboxUpdatedPopupUIVariation1}};
246const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion2[] = {
247 {kIOSOmniboxUpdatedPopupUIVariationName,
248 kIOSOmniboxUpdatedPopupUIVariation2}};
249const FeatureEntry::FeatureVariation kiOSOmniboxUpdatedPopupUIVariations[] = {
250 {"Version 1", kiOSOmniboxUpdatedPopupUIVersion1,
251 std::size(kiOSOmniboxUpdatedPopupUIVersion1), nullptr},
252 {"Version 2", kiOSOmniboxUpdatedPopupUIVersion2,
253 std::size(kiOSOmniboxUpdatedPopupUIVersion2), nullptr}};
254
gogerald53c6e7a2021-04-15 22:07:35255const FeatureEntry::FeatureParam kStartSurfaceTenSecondsShrinkLogo[] = {
Chris Lu5470417c2021-03-03 18:43:08256 {kStartSurfaceShrinkLogoParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35257 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
258const FeatureEntry::FeatureParam kStartSurfaceTenSecondsHideShortcuts[] = {
Chris Lu5470417c2021-03-03 18:43:08259 {kStartSurfaceHideShortcutsParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35260 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
261const FeatureEntry::FeatureParam kStartSurfaceTenSecondsReturnToRecentTab[] = {
Chris Lu5470417c2021-03-03 18:43:08262 {kStartSurfaceReturnToRecentTabParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35263 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
264const FeatureEntry::FeatureParam
265 kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab[] = {
266 {kStartSurfaceShrinkLogoParam, "true"},
267 {kStartSurfaceReturnToRecentTabParam, "true"},
268 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
269const FeatureEntry::FeatureParam
270 kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab[] = {
271 {kStartSurfaceHideShortcutsParam, "true"},
272 {kStartSurfaceReturnToRecentTabParam, "true"},
273 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
274const FeatureEntry::FeatureParam kStartSurfaceOneHourShrinkLogo[] = {
Chris Lu5470417c2021-03-03 18:43:08275 {kStartSurfaceShrinkLogoParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35276 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
277const FeatureEntry::FeatureParam kStartSurfaceOneHourHideShortcuts[] = {
278 {kStartSurfaceHideShortcutsParam, "true"},
279 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
280const FeatureEntry::FeatureParam kStartSurfaceOneHourReturnToRecentTab[] = {
Chris Lu5470417c2021-03-03 18:43:08281 {kStartSurfaceReturnToRecentTabParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35282 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
283const FeatureEntry::FeatureParam
284 kStartSurfaceOneHourShrinkLogoReturnToRecentTab[] = {
285 {kStartSurfaceShrinkLogoParam, "true"},
286 {kStartSurfaceReturnToRecentTabParam, "true"},
287 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
288const FeatureEntry::FeatureParam
289 kStartSurfaceOneHourHideShortcutsReturnToRecentTab[] = {
290 {kStartSurfaceHideShortcutsParam, "true"},
291 {kStartSurfaceReturnToRecentTabParam, "true"},
292 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
Chris Lu5470417c2021-03-03 18:43:08293
gogerald0e39e3aa2021-02-10 18:41:23294const FeatureEntry::FeatureVariation kStartSurfaceVariations[] = {
gogerald53c6e7a2021-04-15 22:07:35295 {"10s:Show Return to Recent Tab tile",
296 kStartSurfaceTenSecondsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53297 std::size(kStartSurfaceTenSecondsReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35298 {"10s:Shrink Logo", kStartSurfaceTenSecondsShrinkLogo,
Daniel Cheng1f047a82022-02-26 10:04:53299 std::size(kStartSurfaceTenSecondsShrinkLogo), nullptr},
gogerald53c6e7a2021-04-15 22:07:35300 {"10s:Hide Shortcuts", kStartSurfaceTenSecondsHideShortcuts,
Daniel Cheng1f047a82022-02-26 10:04:53301 std::size(kStartSurfaceTenSecondsHideShortcuts), nullptr},
gogerald53c6e7a2021-04-15 22:07:35302 {"10s:Shrink Logo and show Return to Recent Tab tile",
303 kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53304 std::size(kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35305 {"10s:Hide Shortcuts and show Return to Recent Tab tile",
306 kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53307 std::size(kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35308 {"1h:Show Return to Recent Tab tile", kStartSurfaceOneHourReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53309 std::size(kStartSurfaceOneHourReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35310 {"1h:Shrink Logo", kStartSurfaceOneHourShrinkLogo,
Daniel Cheng1f047a82022-02-26 10:04:53311 std::size(kStartSurfaceOneHourShrinkLogo), nullptr},
gogerald53c6e7a2021-04-15 22:07:35312 {"1h:Hide Shortcuts", kStartSurfaceOneHourHideShortcuts,
Daniel Cheng1f047a82022-02-26 10:04:53313 std::size(kStartSurfaceOneHourHideShortcuts), nullptr},
gogerald53c6e7a2021-04-15 22:07:35314 {"1h:Shrink Logo and show Return to Recent Tab tile",
315 kStartSurfaceOneHourShrinkLogoReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53316 std::size(kStartSurfaceOneHourShrinkLogoReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35317 {"1h:Hide Shortcuts and show Return to Recent Tab tile",
318 kStartSurfaceOneHourHideShortcutsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53319 std::size(kStartSurfaceOneHourHideShortcutsReturnToRecentTab), nullptr},
Chris Lu5470417c2021-03-03 18:43:08320};
gogerald0e39e3aa2021-02-10 18:41:23321
ginnnnnnny46435132022-06-01 16:06:04322const FeatureEntry::FeatureParam kFREDefaultBrowserPromoDefaultDelay[] = {
323 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoDefaultDelayParam}};
324const FeatureEntry::FeatureParam kFREDefaultBrowserPromoFirstRunOnly[] = {
325 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoFirstRunOnlyParam}};
326const FeatureEntry::FeatureParam kFREDefaultBrowserPromoShortDelay[] = {
327 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoShortDelayParam}};
328const FeatureEntry::FeatureVariation kFREDefaultBrowserPromoVariations[] = {
Aliona DANGLA8fae66f02021-10-06 15:47:11329 {"Wait 14 days after FRE default browser promo",
ginnnnnnny46435132022-06-01 16:06:04330 kFREDefaultBrowserPromoDefaultDelay,
331 std::size(kFREDefaultBrowserPromoDefaultDelay), nullptr},
332 {"FRE default browser promo only", kFREDefaultBrowserPromoFirstRunOnly,
333 std::size(kFREDefaultBrowserPromoFirstRunOnly), nullptr},
Aliona DANGLA8fae66f02021-10-06 15:47:11334 {"Wait 3 days after FRE default browser promo",
ginnnnnnny46435132022-06-01 16:06:04335 kFREDefaultBrowserPromoShortDelay,
336 std::size(kFREDefaultBrowserPromoShortDelay), nullptr},
Aliona DANGLA8fae66f02021-10-06 15:47:11337};
338
jlebel041fc1c2022-03-04 12:53:30339const FeatureEntry::FeatureParam kNewMICEFREWithUMADialog[] = {
340 {kNewMobileIdentityConsistencyFREParam,
341 kNewMobileIdentityConsistencyFREParamUMADialog}};
342const FeatureEntry::FeatureParam kNewMICEFREWithThreeSteps[] = {
343 {kNewMobileIdentityConsistencyFREParam,
344 kNewMobileIdentityConsistencyFREParamThreeSteps}};
345const FeatureEntry::FeatureParam kNewMICEFREWithTwoSteps[] = {
346 {kNewMobileIdentityConsistencyFREParam,
347 kNewMobileIdentityConsistencyFREParamTwoSteps}};
348const FeatureEntry::FeatureVariation
349 kNewMobileIdentityConsistencyFREVariations[] = {
350 {"New FRE with UMA dialog", kNewMICEFREWithUMADialog,
351 std::size(kNewMICEFREWithUMADialog), nullptr},
352 {"new FRE with 3 steps", kNewMICEFREWithThreeSteps,
353 std::size(kNewMICEFREWithThreeSteps), nullptr},
354 {"new FRE with 2 steps", kNewMICEFREWithTwoSteps,
355 std::size(kNewMICEFREWithTwoSteps), nullptr}};
356
Louis Romero023cc5052022-04-08 23:29:39357const FeatureEntry::FeatureParam kBubbleRichIPHTargetHighlight[] = {
358 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterTargetHighlight}};
Christian Xubd60c4b72022-03-22 15:25:01359const FeatureEntry::FeatureParam kBubbleRichIPHExplicitDismissal[] = {
360 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterExplicitDismissal}};
361const FeatureEntry::FeatureParam kBubbleRichIPHRich[] = {
362 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRich}};
363const FeatureEntry::FeatureParam kBubbleRichIPHRichWithSnooze[] = {
364 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRichWithSnooze}};
365const FeatureEntry::FeatureVariation kBubbleRichIPHVariations[] = {
Louis Romero023cc5052022-04-08 23:29:39366 {"Target Highlight", kBubbleRichIPHTargetHighlight,
367 std::size(kBubbleRichIPHTargetHighlight), nullptr},
Christian Xubd60c4b72022-03-22 15:25:01368 {"Explicit dismissal", kBubbleRichIPHExplicitDismissal,
369 std::size(kBubbleRichIPHExplicitDismissal), nullptr},
370 {"Dismissal and rich content", kBubbleRichIPHRich,
371 std::size(kBubbleRichIPHRich), nullptr},
Louis Romero023cc5052022-04-08 23:29:39372 {"Dismissal, rich content, and snooze", kBubbleRichIPHRichWithSnooze,
Christian Xubd60c4b72022-03-22 15:25:01373 std::size(kBubbleRichIPHRichWithSnooze), nullptr},
374};
375
Cooper Knaak1e026562017-07-26 05:22:28376// To add a new entry, add to the end of kFeatureEntries. There are four
sdefresne14900ee2015-11-27 14:43:21377// distinct types of entries:
Cooper Knaak1e026562017-07-26 05:22:28378// . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the
379// default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE
sdefresne14900ee2015-11-27 14:43:21380// macro for this type supplying the command line to the macro.
381// . MULTI_VALUE: a list of choices, the first of which should correspond to a
382// deactivated state for this lab (i.e. no command line option). To specify
383// this type of entry use the macro MULTI_VALUE_TYPE supplying it the
384// array of choices.
Cooper Knaak1e026562017-07-26 05:22:28385// . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is
386// either enabled, disabled, or uses the default value of the associated
387// base::Feature instance. To specify this type of entry use the macro
388// FEATURE_VALUE_TYPE supplying it the base::Feature instance.
389// . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a
390// base::Feature instance. Choices corresponding to the default state, a
391// universally enabled state, and a universally disabled state are
392// automatically included. To specify this type of entry use the macro
393// FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and
394// the array of choices.
395//
sdefresne14900ee2015-11-27 14:43:21396// See the documentation of FeatureEntry for details on the fields.
397//
398// When adding a new choice, add it to the end of the list.
399const flags_ui::FeatureEntry kFeatureEntries[] = {
Cooper Knaak1e026562017-07-26 05:22:28400 {"in-product-help-demo-mode-choice",
401 flag_descriptions::kInProductHelpDemoModeName,
402 flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos,
403 FEATURE_WITH_PARAMS_VALUE_TYPE(
Tommy Nyquistc1d6dea12017-07-26 20:37:23404 feature_engagement::kIPHDemoMode,
405 feature_engagement::kIPHDemoModeChoiceVariations,
Marc Treib2752e8b2017-08-04 14:12:09406 "IPH_DemoMode")},
Moe Ahmadic3fd7cd2018-05-11 21:40:22407 {"enable-autofill-credit-card-upload",
408 flag_descriptions::kAutofillCreditCardUploadName,
409 flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos,
Anne Lim579b5732018-08-30 18:24:24410 FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)},
Tina Wang41d431c2021-06-21 21:04:13411 {"enable-discover-feed-preview",
412 flag_descriptions::kEnableDiscoverFeedPreviewName,
413 flag_descriptions::kEnableDiscoverFeedPreviewDescription, flags_ui::kOsIos,
414 FEATURE_VALUE_TYPE(kEnableDiscoverFeedPreview)},
Moe Ahmadid6d5d172018-06-20 17:20:23415 {"use-sync-sandbox", flag_descriptions::kSyncSandboxName,
416 flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos,
417 SINGLE_VALUE_TYPE_AND_VALUE(
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51418 syncer::kSyncServiceURL,
Moe Ahmadid6d5d172018-06-20 17:20:23419 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")},
420 {"wallet-service-use-sandbox",
421 flag_descriptions::kWalletServiceUseSandboxName,
422 flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos,
423 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
424 autofill::switches::kWalletServiceUseSandbox,
425 "1",
426 autofill::switches::kWalletServiceUseSandbox,
427 "0")},
Mohamad Ahmadic4df81f2017-12-20 04:41:59428 {"show-autofill-type-predictions",
429 flag_descriptions::kShowAutofillTypePredictionsName,
430 flag_descriptions::kShowAutofillTypePredictionsDescription,
431 flags_ui::kOsIos,
Gauthier Ambardcfd85182018-01-05 10:37:46432 FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)},
Olivier Robin3d60411622018-02-23 10:03:22433 {"autofill-ios-delay-between-fields",
434 flag_descriptions::kAutofillIOSDelayBetweenFieldsName,
435 flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription,
436 flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)},
Kurt Horimotodc33af32018-05-01 01:39:14437 {"fullscreen-viewport-adjustment-experiment",
Chris Lu481a9322019-09-25 22:16:53438 flag_descriptions::kFullscreenSmoothScrollingName,
439 flag_descriptions::kFullscreenSmoothScrollingDescription, flags_ui::kOsIos,
440 FEATURE_VALUE_TYPE(fullscreen::features::kSmoothScrollingDefault)},
Robbie Gibson1f37a5e2020-08-06 17:03:06441 {"webpage-default-zoom-from-dynamic-type",
442 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeName,
443 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeDescription,
444 flags_ui::kOsIos,
445 FEATURE_VALUE_TYPE(web::kWebPageDefaultZoomFromDynamicType)},
Robbie Gibson88f23962020-09-28 14:35:56446 {"webpage-alternative-text-zoom",
447 flag_descriptions::kWebPageAlternativeTextZoomName,
448 flag_descriptions::kWebPageAlternativeTextZoomDescription,
449 flags_ui::kOsIos, FEATURE_VALUE_TYPE(web::kWebPageAlternativeTextZoom)},
Robbie Gibson1095b72c2022-06-06 17:03:34450 {"webpage-text-zoom-ipad", flag_descriptions::kWebPageTextZoomIPadName,
451 flag_descriptions::kWebPageTextZoomIPadDescription, flags_ui::kOsIos,
452 FEATURE_VALUE_TYPE(web::kWebPageTextZoomIPad)},
Kurt Horimoto79d590b2018-09-12 19:09:28453 {"toolbar-container", flag_descriptions::kToolbarContainerName,
454 flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos,
455 FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)},
Stepan Khapugincc4e9842019-01-23 13:38:13456 {"omnibox-ui-max-autocomplete-matches",
457 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName,
458 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription,
459 flags_ui::kOsIos,
460 FEATURE_WITH_PARAMS_VALUE_TYPE(
461 omnibox::kUIExperimentMaxAutocompleteMatches,
462 kOmniboxUIMaxAutocompleteMatchesVariations,
463 "OmniboxUIMaxAutocompleteVariations")},
Stepan Khapuginbac467e2022-05-06 21:11:54464 {"omnibox-max-zps-matches", flag_descriptions::kOmniboxMaxZPSMatchesName,
465 flag_descriptions::kOmniboxMaxZPSMatchesDescription, flags_ui::kOsIos,
466 FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kMaxZeroSuggestMatches,
467 kOmniboxMaxZPSMatchesVariations,
468 "OmniboxMaxZPSVariations")},
Robbie Gibson84f1ddc2020-12-10 21:41:28469 {"omnibox-local-history-zero-suggest",
470 flag_descriptions::kOmniboxLocalHistoryZeroSuggestName,
471 flag_descriptions::kOmniboxLocalHistoryZeroSuggestDescription,
472 flags_ui::kOsIos, FEATURE_VALUE_TYPE(omnibox::kLocalHistoryZeroSuggest)},
Justin Cohen20b6f072019-01-16 01:38:50473#if defined(DCHECK_IS_CONFIGURABLE)
474 {"dcheck-is-fatal", flag_descriptions::kDcheckIsFatalName,
475 flag_descriptions::kDcheckIsFatalDescription, flags_ui::kOsIos,
476 FEATURE_VALUE_TYPE(base::kDCheckIsFatalFeature)},
477#endif // defined(DCHECK_IS_CONFIGURABLE)
Caitlin Fischer43edd90a2019-05-01 13:24:30478 {"autofill-use-mobile-label-disambiguation",
479 flag_descriptions::kAutofillUseMobileLabelDisambiguationName,
480 flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription,
481 flags_ui::kOsIos,
Caitlin Fischer37e01232019-05-24 13:05:45482 FEATURE_WITH_PARAMS_VALUE_TYPE(
483 autofill::features::kAutofillUseMobileLabelDisambiguation,
484 kAutofillUseMobileLabelDisambiguationVariations,
485 "AutofillUseMobileLabelDisambiguation")},
Olivier Robin43814bb2021-06-22 15:25:45486 {"metrickit-crash-reports", flag_descriptions::kMetrickitCrashReportName,
487 flag_descriptions::kMetrickitCrashReportDescription, flags_ui::kOsIos,
488 FEATURE_VALUE_TYPE(kMetrickitCrashReport)},
Mike Doughertyb6c770d2019-09-13 22:56:46489 {"ios-breadcrumbs", flag_descriptions::kLogBreadcrumbsName,
490 flag_descriptions::kLogBreadcrumbsDescription, flags_ui::kOsIos,
Jesse McKenna85c1a59f2021-05-05 19:08:30491 FEATURE_VALUE_TYPE(breadcrumbs::kLogBreadcrumbs)},
Eugene But2823dc7e2020-07-21 18:10:37492 {"ios-synthetic-crash-reports",
493 flag_descriptions::kSyntheticCrashReportsForUteName,
494 flag_descriptions::kSyntheticCrashReportsForUteDescription,
495 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSyntheticCrashReportsForUte)},
Jérôme Lebelc374fdd2019-09-27 10:36:48496 {"force-startup-signin-promo",
497 flag_descriptions::kForceStartupSigninPromoName,
498 flag_descriptions::kForceStartupSigninPromoDescription, flags_ui::kOsIos,
Alice Wang345e09442021-07-05 09:03:29499 FEATURE_VALUE_TYPE(switches::kForceStartupSigninPromo)},
Yoichi Osato7ae11752021-03-16 03:27:22500 {"restore-session-from-cache",
501 flag_descriptions::kRestoreSessionFromCacheName,
502 flag_descriptions::kRestoreSessionFromCacheDescription, flags_ui::kOsIos,
Justin Cohen3ec2522c2021-04-23 18:23:49503 FEATURE_VALUE_TYPE(web::kRestoreSessionFromCache)},
sczs4622e6e2019-11-06 01:17:59504 {"autofill-save-card-dismiss-on-navigation",
505 flag_descriptions::kAutofillSaveCardDismissOnNavigationName,
506 flag_descriptions::kAutofillSaveCardDismissOnNavigationDescription,
507 flags_ui::kOsIos,
508 FEATURE_VALUE_TYPE(
509 autofill::features::kAutofillSaveCardDismissOnNavigation)},
sczs37d9c132020-07-18 06:06:33510 {"new-content-suggestions-feed", flag_descriptions::kDiscoverFeedInNtpName,
adamta22a4d502020-05-21 03:12:21511 flag_descriptions::kDiscoverFeedInNtpDescription, flags_ui::kOsIos,
gogeralddb0d8ae2020-11-13 03:56:58512 FEATURE_WITH_PARAMS_VALUE_TYPE(kDiscoverFeedInNtp,
513 kDiscoverFeedInNtpVariations,
514 "IOSDiscoverFeed")},
Roberto Mourab87b9722020-06-17 17:12:09515 {"expanded-tab-strip", flag_descriptions::kExpandedTabStripName,
516 flag_descriptions::kExpandedTabStripDescription, flags_ui::kOsIos,
517 FEATURE_VALUE_TYPE(kExpandedTabStrip)},
Tommy Martino6b4eb7e2020-06-25 18:25:41518 {"shared-highlighting-ios", flag_descriptions::kSharedHighlightingIOSName,
519 flag_descriptions::kSharedHighlightingIOSDescription, flags_ui::kOsIos,
520 FEATURE_VALUE_TYPE(kSharedHighlightingIOS)},
Veronique Nguyen6593c762021-11-30 17:28:56521 {"enable-fre-ui-module-ios-with-options",
522 flag_descriptions::kEnableFREUIModuleIOSName,
Tina Wanga252ca42021-04-01 17:14:23523 flag_descriptions::kEnableFREUIModuleIOSDescription, flags_ui::kOsIos,
ginnnnnnny429b5522022-05-05 03:50:06524 FEATURE_VALUE_TYPE(kEnableFREUIModuleIOS)},
jlebel041fc1c2022-03-04 12:53:30525 {"new-mobile-identity-consistency-fre",
526 flag_descriptions::kNewMobileIdentityConsistencyFREName,
527 flag_descriptions::kNewMobileIdentityConsistencyFREDescription,
528 flags_ui::kOsIos,
529 FEATURE_WITH_PARAMS_VALUE_TYPE(signin::kNewMobileIdentityConsistencyFRE,
530 kNewMobileIdentityConsistencyFREVariations,
ginnnnnnny46435132022-06-01 16:06:04531 kIOSMICeAndDefaultBrowserTrialName)},
Tina Wang17514e2f2021-09-24 23:57:18532 {"enable-long-message-duration",
533 flag_descriptions::kEnableLongMessageDurationName,
534 flag_descriptions::kEnableLongMessageDurationDescription, flags_ui::kOsIos,
535 FEATURE_VALUE_TYPE(kEnableLongMessageDuration)},
Sylvain Defresne9c107082020-10-27 16:39:13536#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
edchin81467b82020-09-03 19:31:45537 {"screen-time-integration-ios",
538 flag_descriptions::kScreenTimeIntegrationName,
539 flag_descriptions::kScreenTimeIntegrationDescription, flags_ui::kOsIos,
540 FEATURE_VALUE_TYPE(kScreenTimeIntegration)},
Sylvain Defresne9c107082020-10-27 16:39:13541#endif
Nazerke3e993f72020-09-21 13:00:06542 {"modern-tab-strip", flag_descriptions::kModernTabStripName,
543 flag_descriptions::kModernTabStripDescription, flags_ui::kOsIos,
544 FEATURE_VALUE_TYPE(kModernTabStrip)},
Nohemi Fernandez222d6d42020-09-30 20:35:57545 {"minutes-delay-to-restore-gaia-cookies-if-deleted",
546 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieName,
547 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieDescription,
548 flags_ui::kOsIos,
549 MULTI_VALUE_TYPE(kDelayThresholdMinutesToUpdateGaiaCookieChoices)},
Vidhan Jainb4de5c52021-08-30 17:08:02550 {"add-passwords-in-settings",
551 flag_descriptions::kAddPasswordsInSettingsName,
552 flag_descriptions::kAddPasswordsInSettingsDescription, flags_ui::kOsIos,
553 FEATURE_VALUE_TYPE(
554 password_manager::features::kSupportForAddPasswordsInSettings)},
Eugene Butf869bff2020-12-10 01:16:55555 {"record-snapshot-size", flag_descriptions::kRecordSnapshotSizeName,
556 flag_descriptions::kRecordSnapshotSizeDescription, flags_ui::kOsIos,
557 FEATURE_VALUE_TYPE(web::features::kRecordSnapshotSize)},
Chris Lub17195f2020-12-10 20:49:14558 {"default-browser-fullscreen-promo-experiment",
559 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentName,
560 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentDescription,
561 flags_ui::kOsIos,
Javier Ernesto Flores Robles159414232021-06-16 14:29:59562 FEATURE_WITH_PARAMS_VALUE_TYPE(
563 kDefaultBrowserFullscreenPromoExperiment,
564 kDefaultBrowserFullscreenPromoExperimentVariations,
565 "IOSDefaultBrowserFullscreenPromoExperiment")},
Cheick Cisse76ade3d2020-12-16 00:15:11566 {"ios-shared-highlighting-color-change",
567 flag_descriptions::kIOSSharedHighlightingColorChangeName,
568 flag_descriptions::kIOSSharedHighlightingColorChangeDescription,
Cheick Cissed0b5bfe2021-02-11 14:23:07569 flags_ui::kOsIos,
570 FEATURE_VALUE_TYPE(web::features::kIOSSharedHighlightingColorChange)},
Cheick Cissefe994862021-12-15 16:01:34571 {"ios-shared-highlighting-v2",
572 flag_descriptions::kIOSSharedHighlightingV2Name,
573 flag_descriptions::kIOSSharedHighlightingV2Description, flags_ui::kOsIos,
574 FEATURE_VALUE_TYPE(shared_highlighting::kIOSSharedHighlightingV2)},
Stepan Khapugin04341202021-01-07 12:22:45575 {"omnibox-new-textfield-implementation",
576 flag_descriptions::kOmniboxNewImplementationName,
577 flag_descriptions::kOmniboxNewImplementationDescription, flags_ui::kOsIos,
578 FEATURE_VALUE_TYPE(kIOSNewOmniboxImplementation)},
Stepan Khapugin422f08d2022-02-18 16:19:44579 {"omnibox-new-popup-ui", flag_descriptions::kIOSOmniboxUpdatedPopupUIName,
580 flag_descriptions::kIOSOmniboxUpdatedPopupUIDescription, flags_ui::kOsIos,
Robbie Gibson46351032022-03-31 19:46:23581 FEATURE_WITH_PARAMS_VALUE_TYPE(kIOSOmniboxUpdatedPopupUI,
582 kiOSOmniboxUpdatedPopupUIVariations,
Stepan Khapugina45baed2022-05-13 19:15:43583 "IOSOmniboxUpdatedPopupUI")},
gogerald0ff29e52021-02-03 18:56:19584 {"start-surface", flag_descriptions::kStartSurfaceName,
585 flag_descriptions::kStartSurfaceDescription, flags_ui::kOsIos,
gogerald0e39e3aa2021-02-10 18:41:23586 FEATURE_WITH_PARAMS_VALUE_TYPE(kStartSurface,
587 kStartSurfaceVariations,
588 "StartSurface")},
Justin Cohen13ac7a202021-02-04 18:27:28589 {"ios-crashpad", flag_descriptions::kCrashpadIOSName,
590 flag_descriptions::kCrashpadIOSDescription, flags_ui::kOsIos,
591 FEATURE_VALUE_TYPE(kCrashpadIOS)},
Vidhan Jain451b4752021-07-15 10:16:42592 {"autofill-address-verification-in-save-prompt",
593 flag_descriptions::kEnableAutofillAddressSavePromptAddressVerificationName,
594 flag_descriptions::
595 kEnableAutofillAddressSavePromptAddressVerificationDescription,
596 flags_ui::kOsIos,
597 FEATURE_VALUE_TYPE(
598 autofill::features::
599 kAutofillAddressProfileSavePromptAddressVerificationSupport)},
Vidhan Jaina65741552021-03-09 17:18:27600 {"autofill-address-save-prompt",
601 flag_descriptions::kEnableAutofillAddressSavePromptName,
602 flag_descriptions::kEnableAutofillAddressSavePromptDescription,
603 flags_ui::kOsIos,
604 FEATURE_VALUE_TYPE(autofill::features::kAutofillAddressProfileSavePrompt)},
Viktor Semeniuk68e794a2021-03-24 10:23:25605 {"filling-across-affiliated-websites",
606 flag_descriptions::kFillingAcrossAffiliatedWebsitesName,
607 flag_descriptions::kFillingAcrossAffiliatedWebsitesDescription,
608 flags_ui::kOsIos,
609 FEATURE_VALUE_TYPE(
610 password_manager::features::kFillingAcrossAffiliatedWebsites)},
Jared Sauld47c2b72021-03-25 22:47:31611 {"autofill-parse-merchant-promo-code-fields",
612 flag_descriptions::kAutofillParseMerchantPromoCodeFieldsName,
613 flag_descriptions::kAutofillParseMerchantPromoCodeFieldsDescription,
614 flags_ui::kOsIos,
615 FEATURE_VALUE_TYPE(
616 autofill::features::kAutofillParseMerchantPromoCodeFields)},
edchin257cea2f2021-04-07 13:07:13617 {"interest-feed-v2-clicks-and-views-cond-upload",
618 flag_descriptions::kInterestFeedV2ClickAndViewActionsConditionalUploadName,
619 flag_descriptions::
620 kInterestFeedV2ClickAndViewActionsConditionalUploadDescription,
621 flags_ui::kOsIos,
622 FEATURE_VALUE_TYPE(feed::kInterestFeedV2ClicksAndViewsConditionalUpload)},
Mohammad Refaat76b14f542021-10-27 14:46:55623 {"tabs-search-ios", flag_descriptions::kTabsSearchName,
624 flag_descriptions::kTabsSearchDescription, flags_ui::kOsIos,
625 FEATURE_VALUE_TYPE(kTabsSearch)},
Mohammad Refaat95410082022-02-23 02:01:02626 {"tabs-search-regular-results-suggested-actions-ios",
627 flag_descriptions::kTabsSearchRegularResultsSuggestedActionsName,
628 flag_descriptions::kTabsSearchRegularResultsSuggestedActionsDescription,
629 flags_ui::kOsIos,
630 FEATURE_VALUE_TYPE(kTabsSearchRegularResultsSuggestedActions)},
Side Yilmaz0e6c15a2021-04-26 12:55:09631 {"incognito-brand-consistency-for-ios",
632 flag_descriptions::kIncognitoBrandConsistencyForIOSName,
633 flag_descriptions::kIncognitoBrandConsistencyForIOSDescription,
634 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kIncognitoBrandConsistencyForIOS)},
Side Yilmaz6c53f7102021-09-07 13:26:19635 {"incognito-ntp-revamp", flag_descriptions::kIncognitoNtpRevampName,
636 flag_descriptions::kIncognitoNtpRevampDescription, flags_ui::kOsIos,
637 FEATURE_VALUE_TYPE(kIncognitoNtpRevamp)},
Side YILMAZ4b40a3082022-04-11 10:13:33638 {"update-history-entry-points-in-incognito",
639 flag_descriptions::kUpdateHistoryEntryPointsInIncognitoName,
640 flag_descriptions::kUpdateHistoryEntryPointsInIncognitoDescription,
641 flags_ui::kOsIos,
642 FEATURE_VALUE_TYPE(kUpdateHistoryEntryPointsInIncognito)},
jlebeld95434d652021-06-22 10:32:48643 {"sync-trusted-vault-passphrase-ios-rpc",
644 flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCName,
645 flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCDescription,
646 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51647 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseiOSRPC)},
Mikel Astiz850b0fe2021-06-16 09:47:27648 {"sync-trusted-vault-passphrase-promo",
649 flag_descriptions::kSyncTrustedVaultPassphrasePromoName,
650 flag_descriptions::kSyncTrustedVaultPassphrasePromoDescription,
651 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51652 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphrasePromo)},
Mikel Astiz850b0fe2021-06-16 09:47:27653 {"sync-trusted-vault-passphrase-recovery",
654 flag_descriptions::kSyncTrustedVaultPassphraseRecoveryName,
655 flag_descriptions::kSyncTrustedVaultPassphraseRecoveryDescription,
656 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51657 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseRecovery)},
Nohemi Fernandezc00842a2021-07-26 11:47:34658 {"wait-threshold-seconds-for-capabilities-api",
659 flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiName,
660 flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiDescription,
661 flags_ui::kOsIos,
662 MULTI_VALUE_TYPE(kWaitThresholdMillisecondsForCapabilitiesApiChoices)},
Jared Saul2188f762021-08-02 21:22:23663 {"autofill-fill-merchant-promo-code-fields",
664 flag_descriptions::kAutofillFillMerchantPromoCodeFieldsName,
665 flag_descriptions::kAutofillFillMerchantPromoCodeFieldsDescription,
666 flags_ui::kOsIos,
667 FEATURE_VALUE_TYPE(
668 autofill::features::kAutofillFillMerchantPromoCodeFields)},
Gauthier Ambard14d3a262021-08-09 18:09:23669 {"default-wkwebview-context-menu",
670 flag_descriptions::kDefaultWebViewContextMenuName,
671 flag_descriptions::kDefaultWebViewContextMenuDescription, flags_ui::kOsIos,
672 FEATURE_VALUE_TYPE(web::features::kDefaultWebViewContextMenu)},
Sylvain Defresnedff67e42021-09-24 09:43:03673 {"new-overflow-menu", flag_descriptions::kNewOverflowMenuName,
674 flag_descriptions::kNewOverflowMenuDescription, flags_ui::kOsIos,
675 FEATURE_VALUE_TYPE(kNewOverflowMenu)},
Robbie Gibsonfe748e52022-05-09 18:20:46676 {"new-overflow-menu-settings-action",
677 flag_descriptions::kNewOverflowMenuSettingsActionName,
Robbie Gibsone2ad5632022-05-16 20:46:10678 flag_descriptions::kNewOverflowMenuSettingsActionDescription,
679 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kNewOverflowMenuSettingsAction)},
680 {"new-overflow-menu-simple-destination-icons",
681 flag_descriptions::kNewOverflowMenuSimpleDestinationIconsName,
682 flag_descriptions::kNewOverflowMenuSimpleDestinationIconsDescription,
683 flags_ui::kOsIos,
684 FEATURE_VALUE_TYPE(kNewOverflowMenuSimpleDestinationIcons)},
Robbie Gibson640bccb32022-05-10 18:43:35685 {"new-overflow-menu-cbd-action",
686 flag_descriptions::kNewOverflowMenuCBDActionName,
687 flag_descriptions::kNewOverflowMenuCBDActionDescription, flags_ui::kOsIos,
688 FEATURE_VALUE_TYPE(kNewOverflowMenuCBDAction)},
Sylvain Defresnedff67e42021-09-24 09:43:03689 {"enable-new-download-api", flag_descriptions::kEnableNewDownloadAPIName,
690 flag_descriptions::kEnableNewDownloadAPIDescription, flags_ui::kOsIos,
691 FEATURE_VALUE_TYPE(web::features::kEnableNewDownloadAPI)},
Evan Bernstein0a85f332021-09-29 19:07:24692 {"use-lens-to-search-for-image",
693 flag_descriptions::kUseLensToSearchForImageName,
694 flag_descriptions::kUseLensToSearchForImageDescription, flags_ui::kOsIos,
Ali Juma02a9b7b2021-10-01 13:44:44695 FEATURE_VALUE_TYPE(kUseLensToSearchForImage)},
Benjamin Williamsbee6ab62022-02-28 18:09:40696 {"use-load-simulated-request-for-error-page-navigation",
Gauthier Ambard33cceaf2022-05-05 14:00:23697 flag_descriptions::kUseLoadSimulatedRequestForOfflinePageName,
698 flag_descriptions::kUseLoadSimulatedRequestForOfflinePageDescription,
Benjamin Williamsbee6ab62022-02-28 18:09:40699 flags_ui::kOsIos,
Gauthier Ambard33cceaf2022-05-05 14:00:23700 FEATURE_VALUE_TYPE(web::features::kUseLoadSimulatedRequestForOfflinePage)},
Sergio Collazos9fcc6ed2021-10-06 00:58:03701 {"enable-discover-feed-static-resource-serving",
702 flag_descriptions::kEnableDiscoverFeedStaticResourceServingName,
703 flag_descriptions::kEnableDiscoverFeedStaticResourceServingDescription,
704 flags_ui::kOsIos,
705 FEATURE_WITH_PARAMS_VALUE_TYPE(
706 kEnableDiscoverFeedStaticResourceServing,
707 kEnableDiscoverFeedStaticResourceServingVariations,
708 "IOSDiscoverFeedStaticResourceServing")},
709 {"enable-disco-feed-endpoint",
710 flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointName,
711 flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointDescription,
712 flags_ui::kOsIos,
Aliona DANGLA8fae66f02021-10-06 15:47:11713 FEATURE_VALUE_TYPE(kEnableDiscoverFeedDiscoFeedEndpoint)},
Mohammad Refaatab6bee62022-05-16 16:31:15714 {"enable-discover-feed-top-sync-promo",
715 flag_descriptions::kEnableDiscoverFeedTopSyncPromoName,
716 flag_descriptions::kEnableDiscoverFeedTopSyncPromoDescription,
717 flags_ui::kOsIos,
718 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableDiscoverFeedTopSyncPromo,
719 kDiscoverFeedTopSyncPromoVariations,
720 "EnableDiscoverFeedTopSyncPromo")},
Aliona DANGLA8fae66f02021-10-06 15:47:11721 {"enable-fre-default-browser-screen-testing",
ginnnnnnny46435132022-06-01 16:06:04722 flag_descriptions::kEnableFREDefaultBrowserPromoScreenName,
723 flag_descriptions::kEnableFREDefaultBrowserPromoScreenDescription,
Aliona DANGLA8fae66f02021-10-06 15:47:11724 flags_ui::kOsIos,
ginnnnnnny46435132022-06-01 16:06:04725 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFREDefaultBrowserPromoScreen,
726 kFREDefaultBrowserPromoVariations,
727 kIOSMICeAndDefaultBrowserTrialName)},
edchin1313f2b2021-10-11 08:08:47728 {"enable-discover-feed-shorter-cache",
729 flag_descriptions::kEnableDiscoverFeedShorterCacheName,
730 flag_descriptions::kEnableDiscoverFeedShorterCacheDescription,
731 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableDiscoverFeedShorterCache)},
Tommy Martino7393d762021-10-12 17:59:28732 {"shared-highlighting-amp",
733 flag_descriptions::kIOSSharedHighlightingAmpName,
734 flag_descriptions::kIOSSharedHighlightingAmpDescription, flags_ui::kOsIos,
735 FEATURE_VALUE_TYPE(shared_highlighting::kSharedHighlightingAmp)},
David Maunderf4a5e1e2021-10-18 17:24:28736 {"enable-commerce-price-tracking",
Matt Jones125dfb42022-02-11 17:23:42737 commerce::flag_descriptions::kCommercePriceTrackingName,
738 commerce::flag_descriptions::kCommercePriceTrackingDescription,
739 flags_ui::kOsIos,
740 FEATURE_WITH_PARAMS_VALUE_TYPE(commerce::kCommercePriceTracking,
741 commerce::kCommercePriceTrackingVariations,
adamta67b6c5812021-10-19 17:02:15742 "CommercePriceTracking")},
Tina Wang8058d5f2021-11-04 20:06:06743 {"web-feed-ios", flag_descriptions::kEnableWebChannelsName,
744 flag_descriptions::kEnableWebChannelsDescription, flags_ui::kOsIos,
745 FEATURE_VALUE_TYPE(kEnableWebChannels)},
adamta39331592021-11-01 20:18:54746 {"ntp-view-hierarchy-repair",
747 flag_descriptions::kNTPViewHierarchyRepairName,
748 flag_descriptions::kNTPViewHierarchyRepairDescription, flags_ui::kOsIos,
749 FEATURE_VALUE_TYPE(kNTPViewHierarchyRepair)},
Chris Lu37588a92021-11-02 21:19:45750 {"single-ntp", flag_descriptions::kSingleNtpName,
751 flag_descriptions::kSingleNtpDescription, flags_ui::kOsIos,
752 FEATURE_VALUE_TYPE(kSingleNtp)},
Justin Cohen69cec682021-11-04 20:10:26753 {"synthesized-restore-session",
754 flag_descriptions::kSynthesizedRestoreSessionName,
755 flag_descriptions::kSynthesizedRestoreSessionDescription, flags_ui::kOsIos,
756 FEATURE_VALUE_TYPE(web::features::kSynthesizedRestoreSession)},
Chris Lu4723b822021-11-05 21:47:44757 {"remove-extra-ntps", flag_descriptions::kRemoveExcessNTPsExperimentName,
758 flag_descriptions::kRemoveExcessNTPsExperimentDescription,
Sylvain Defresne1619dd002021-11-06 10:09:48759 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kRemoveExcessNTPs)},
760 {"lazily-create-web-state-on-restoration",
761 flag_descriptions::kLazilyCreateWebStateOnRestorationName,
762 flag_descriptions::kLazilyCreateWebStateOnRestorationDescription,
763 flags_ui::kOsIos,
764 FEATURE_VALUE_TYPE(web::features::kEnableUnrealizedWebStates)},
ginny huang1f1755c2021-11-11 23:38:23765 {"enable-shortened-password-auto-fill-instruction",
766 flag_descriptions::kEnableShortenedPasswordAutoFillInstructionName,
767 flag_descriptions::kEnableShortenedPasswordAutoFillInstructionDescription,
768 flags_ui::kOsIos,
769 FEATURE_VALUE_TYPE(kEnableShortenedPasswordAutoFillInstruction)},
Benjamin Williams0e7e2fb2021-11-17 03:03:41770 {"enable-password-manager-branding-update",
771 flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateName,
772 flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateDescription,
773 flags_ui::kOsIos,
Aliona DANGLAe5b0b6e52021-11-30 11:58:19774 FEATURE_VALUE_TYPE(
775 password_manager::features::kIOSEnablePasswordManagerBrandingUpdate)},
Gauthier Ambard1d326e22021-12-16 10:57:53776 {"default-mode-ua", flag_descriptions::kAddSettingForDefaultPageModeName,
777 flag_descriptions::kAddSettingForDefaultPageModeDescription,
778 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kAddSettingForDefaultPageMode)},
ginnnnnnny1532d872021-12-20 15:57:37779 {"ios-media-permissions-control",
780 flag_descriptions::kMediaPermissionsControlName,
781 flag_descriptions::kMediaPermissionsControlDescription, flags_ui::kOsIos,
782 FEATURE_VALUE_TYPE(web::features::kMediaPermissionsControl)},
Olivier Robin3a957df2021-12-21 18:04:34783 {"enable-save-session-tabs-in-separate-files",
784 flag_descriptions::kSaveSessionTabsToSeparateFilesName,
785 flag_descriptions::kSaveSessionTabsToSeparateFilesDescription,
786 flags_ui::kOsIos,
787 FEATURE_VALUE_TYPE(sessions::kSaveSessionTabsToSeparateFiles)},
Ewann8c7aadc2022-05-19 15:41:05788 {"use-sf-symbols", flag_descriptions::kUseSFSymbolsName,
789 flag_descriptions::kUseSFSymbolsDescription, flags_ui::kOsIos,
790 FEATURE_VALUE_TYPE(kUseSFSymbols)},
Nohemi Fernandez76f54802022-01-10 18:23:32791 {"enable-unicorn-account-support",
792 flag_descriptions::kEnableUnicornAccountSupportName,
793 flag_descriptions::kEnableUnicornAccountSupportDescription,
794 flags_ui::kOsIos,
795 FEATURE_VALUE_TYPE(signin::kEnableUnicornAccountSupport)},
Chris Lu411bea82022-01-12 18:19:22796 {"single-cell-content-suggestions",
797 flag_descriptions::kSingleCellContentSuggestionsName,
798 flag_descriptions::kSingleCellContentSuggestionsDescription,
799 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSingleCellContentSuggestions)},
Chris Lue5211052022-02-02 20:44:04800 {"content-suggestions-header-migration",
801 flag_descriptions::kContentSuggestionsHeaderMigrationName,
802 flag_descriptions::kContentSuggestionsHeaderMigrationDescription,
803 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kContentSuggestionsHeaderMigration)},
rgod90cca8b2022-02-04 12:38:27804 {"leak-detection-unauthenticated",
805 flag_descriptions::kLeakDetectionUnauthenticatedName,
806 flag_descriptions::kLeakDetectionUnauthenticatedDescription,
807 flags_ui::kOsIos,
808 FEATURE_VALUE_TYPE(
809 password_manager::features::kLeakDetectionUnauthenticated)},
Veronique Nguyenfc9824b2022-02-10 17:12:53810 {"mute-compromised-passwords",
811 flag_descriptions::kMuteCompromisedPasswordsName,
812 flag_descriptions::kMuteCompromisedPasswordsDescription, flags_ui::kOsIos,
813 FEATURE_VALUE_TYPE(password_manager::features::kMuteCompromisedPasswords)},
Veronique Nguyen00ba26ea2022-02-25 14:57:17814 {"enable-favicon-passwords",
815 flag_descriptions::kEnableFaviconForPasswordsName,
816 flag_descriptions::kEnableFaviconForPasswordsDescription, flags_ui::kOsIos,
817 FEATURE_VALUE_TYPE(
818 password_manager::features::kEnableFaviconForPasswords)},
Shivani Chauhanbf97b0d2022-02-08 22:21:28819 {"autofill-enable-sending-bcn-in-get-upload-details",
820 flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsName,
821 flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsDescription,
822 flags_ui::kOsIos,
823 FEATURE_VALUE_TYPE(
824 autofill::features::kAutofillEnableSendingBcnInGetUploadDetails)},
Ali Juma1429cf8a2022-02-09 15:31:01825 {"enable-fullscreen-api", flag_descriptions::kEnableFullscreenAPIName,
826 flag_descriptions::kEnableFullscreenAPIDescription, flags_ui::kOsIos,
827 FEATURE_VALUE_TYPE(web::features::kEnableFullscreenAPI)},
Joemer Ramos34175732022-02-14 18:59:16828 {"enable-enhanced-safe-browsing",
829 flag_descriptions::kEnhancedProtectionName,
830 flag_descriptions::kEnhancedProtectionDescription, flags_ui::kOsIos,
831 FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtection)},
Joemer Ramos26e2b512022-05-24 17:26:41832 {"enable-enhanced-safe-browsing-phase-2",
833 flag_descriptions::kEnhancedProtectionPhase2Name,
834 flag_descriptions::kEnhancedProtectionPhase2Description, flags_ui::kOsIos,
835 FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtectionPhase2IOS)},
Shivani Chauhanaf1eb74d2022-02-11 21:13:19836 {"autofill-enable-unmask-card-request-set-instrument-id",
837 flag_descriptions::kAutofillEnableUnmaskCardRequestSetInstrumentIdName,
838 flag_descriptions::
839 kAutofillEnableUnmaskCardRequestSetInstrumentIdDescription,
840 flags_ui::kOsIos,
841 FEATURE_VALUE_TYPE(
842 autofill::features::kAutofillEnableUnmaskCardRequestSetInstrumentId)},
Victor Hugo Vianna Silvaf0a44002022-02-16 10:38:00843 {"send-tab-to-self-signin-promo",
844 flag_descriptions::kSendTabToSelfSigninPromoName,
845 flag_descriptions::kSendTabToSelfSigninPromoDescription, flags_ui::kOsIos,
846 FEATURE_VALUE_TYPE(send_tab_to_self::kSendTabToSelfSigninPromo)},
Chris Lu7f560f72022-03-01 18:19:01847 {"content-suggestions-uiviewcontroller-migration",
848 flag_descriptions::kContentSuggestionsUIViewControllerMigrationName,
849 flag_descriptions::kContentSuggestionsUIViewControllerMigrationDescription,
850 flags_ui::kOsIos,
851 FEATURE_VALUE_TYPE(kContentSuggestionsUIViewControllerMigration)},
Christian Xubd60c4b72022-03-22 15:25:01852 {"bubble-rich-iph", flag_descriptions::kBubbleRichIPHName,
853 flag_descriptions::kBubbleRichIPHDescription, flags_ui::kOsIos,
854 FEATURE_WITH_PARAMS_VALUE_TYPE(kBubbleRichIPH,
855 kBubbleRichIPHVariations,
856 "BubbleRichIPH")},
Siyu Anff02e742022-04-07 19:08:22857 {"autofill-enforce-delays-in-strike-database",
858 flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseName,
859 flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseDescription,
860 flags_ui::kOsIos,
861 FEATURE_VALUE_TYPE(
862 autofill::features::kAutofillEnforceDelaysInStrikeDatabase)},
Ewann4f260562022-04-11 13:37:19863 {"download-calendar", flag_descriptions::kDownloadCalendarName,
864 flag_descriptions::kDownloadCalendarDescription, flags_ui::kOsIos,
865 FEATURE_VALUE_TYPE(kDownloadCalendar)},
Louis Romerofbfbd932022-04-15 18:04:50866 {"uiview-window-observing", flag_descriptions::kUIViewWindowObservingName,
867 flag_descriptions::kUIViewWindowObservingDescription, flags_ui::kOsIos,
868 FEATURE_VALUE_TYPE(kUIViewWindowObserving)},
Jared Saulb0473bd2022-04-20 00:03:41869 {"autofill-upstream-allow-additional-email-domains",
870 flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsName,
871 flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsDescription,
872 flags_ui::kOsIos,
873 FEATURE_VALUE_TYPE(
874 autofill::features::kAutofillUpstreamAllowAdditionalEmailDomains)},
875 {"autofill-upstream-allow-all-email-domains",
876 flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsName,
877 flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsDescription,
878 flags_ui::kOsIos,
879 FEATURE_VALUE_TYPE(
880 autofill::features::kAutofillUpstreamAllowAllEmailDomains)},
Olivier Robinffe767c2022-04-21 13:13:23881 {"enable-tflite-language-detection",
882 flag_descriptions::kTFLiteLanguageDetectionName,
883 flag_descriptions::kTFLiteLanguageDetectionDescription, flags_ui::kOsIos,
884 FEATURE_VALUE_TYPE(translate::kTFLiteLanguageDetectionEnabled)},
885 {"optimization-guide-model-downloading",
886 flag_descriptions::kOptimizationGuideModelDownloadingName,
887 flag_descriptions::kOptimizationGuideModelDownloadingDescription,
888 flags_ui::kOsIos,
889 FEATURE_VALUE_TYPE(
890 optimization_guide::features::kOptimizationGuideModelDownloading)},
891 {"optimization-target-prediction",
892 flag_descriptions::kOptimizationTargetPredictionName,
893 flag_descriptions::kOptimizationTargetPredictionDescription,
894 flags_ui::kOsIos,
895 FEATURE_VALUE_TYPE(
896 optimization_guide::features::kOptimizationTargetPrediction)},
Rushan Suleymanov727309602022-04-28 20:08:54897 {"sync-standalone-invalidations", flag_descriptions::kSyncInvalidationsName,
898 flag_descriptions::kSyncInvalidationsDescription, flags_ui::kOsIos,
899 FEATURE_VALUE_TYPE(::syncer::kUseSyncInvalidations)},
900 {"sync-standalone-invalidations-wallet-and-offer",
901 flag_descriptions::kSyncInvalidationsWalletAndOfferName,
902 flag_descriptions::kSyncInvalidationsWalletAndOfferDescription,
903 flags_ui::kOsIos,
904 FEATURE_VALUE_TYPE(::syncer::kUseSyncInvalidationsForWalletAndOffer)},
Christian Xub8c06cd2022-04-29 20:55:01905 {"suggestions-scrolling-ipad",
906 flag_descriptions::kEnableSuggestionsScrollingOnIPadName,
907 flag_descriptions::kEnableSuggestionsScrollingOnIPadDescription,
908 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableSuggestionsScrollingOnIPad)},
David Jean7a8fa702022-05-02 15:21:22909 {"experience-kit-calendar", flag_descriptions::kCalendarExperienceKitName,
910 flag_descriptions::kCalendarExperienceKitDescription, flags_ui::kOsIos,
911 FEATURE_VALUE_TYPE(kCalendarExperienceKit)},
Mustafa Emre Acer4de8863a2022-05-03 22:17:01912 {"https-only-mode", flag_descriptions::kHttpsOnlyModeName,
913 flag_descriptions::kHttpsOnlyModeDescription, flags_ui::kOsIos,
914 FEATURE_VALUE_TYPE(security_interstitials::features::kHttpsOnlyMode)},
Benjamin Williams419c81e2022-05-04 18:33:22915 {"smart-sorting-new-overflow-menu",
916 flag_descriptions::kSmartSortingNewOverflowMenuName,
917 flag_descriptions::kSmartSortingNewOverflowMenuDescription,
918 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSmartSortingNewOverflowMenu)},
Alexander Tekled46a36982022-05-09 20:32:42919 {"autofill-enable-ranking-formula",
920 flag_descriptions::kAutofillEnableRankingFormulaName,
921 flag_descriptions::kAutofillEnableRankingFormulaDescription,
922 flags_ui::kOsIos,
923 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableRankingFormula)},
Siyu An4f658a92022-05-13 22:59:02924 {"autofill-remove-card-expiry-from-downstream-suggestion",
925 flag_descriptions::kAutofillRemoveCardExpiryFromDownstreamSuggestionName,
926 flag_descriptions::
927 kAutofillRemoveCardExpiryFromDownstreamSuggestionDescription,
928 flags_ui::kOsIos,
929 FEATURE_VALUE_TYPE(autofill::features::
930 kAutofillRemoveCardExpiryFromDownstreamSuggestion)},
Sergio Collazos58558712022-05-18 17:24:02931 {"enable-feed-ablation", flag_descriptions::kEnableFeedAblationName,
932 flag_descriptions::kEnableFeedAblationDescription, flags_ui::kOsIos,
933 FEATURE_VALUE_TYPE(kEnableFeedAblation)},
Chris Lu7f024ed2c2022-05-27 23:11:27934 {"content-suggestions-ui-module-refresh",
935 flag_descriptions::kContentSuggestionsUIModuleRefreshName,
936 flag_descriptions::kContentSuggestionsUIModuleRefreshDescription,
937 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kContentSuggestionsUIModuleRefresh)},
Quentin Pubertd7546ae2022-05-30 14:28:57938 {"3p-intents-in-incognito", flag_descriptions::kIOS3PIntentsInIncognitoName,
939 flag_descriptions::kIOS3PIntentsInIncognitoDescription, flags_ui::kOsIos,
940 FEATURE_VALUE_TYPE(kIOS3PIntentsInIncognito)},
Olivier Robin058c1fad2022-05-31 18:24:06941 {"default-browser-intents-show-settings",
942 flag_descriptions::kDefaultBrowserIntentsShowSettingsName,
943 flag_descriptions::kDefaultBrowserIntentsShowSettingsDescription,
944 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDefaultBrowserIntentsShowSettings)},
Ed Chin76b1b35e2022-06-08 23:01:17945 {"enable-discover-feed-ghost-cards",
946 flag_descriptions::kEnableDiscoverFeedGhostCardsName,
947 flag_descriptions::kEnableDiscoverFeedGhostCardsDescription,
948 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDiscoverFeedGhostCardsEnabled)},
Sylvain Defresne1619dd002021-11-06 10:09:48949};
sdefresne14900ee2015-11-27 14:43:21950
Rohit Raobed794c2020-04-27 15:27:45951bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
952 return false;
953}
954
955flags_ui::FlagsState& GetGlobalFlagsState() {
956 static base::NoDestructor<flags_ui::FlagsState> flags_state(kFeatureEntries,
957 nullptr);
958 return *flags_state;
959}
David Jean5ca263c2021-08-18 09:19:30960// Creates the experimental test policies map, used by AsyncPolicyLoader and
961// PolicyLoaderIOS to locally enable policies.
Vincent Boisselleed0e6f1a2021-11-09 06:47:34962NSMutableDictionary* CreateExperimentalTestingPolicies() {
sdefresne14900ee2015-11-27 14:43:21963 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
964
Guillaume Jenkins25e9bd72020-08-27 17:39:06965 // Shared variables for all enterprise experimental flags.
Guillaume Jenkins57606d72020-08-13 17:32:55966 NSMutableDictionary* testing_policies = [[NSMutableDictionary alloc] init];
Guillaume Jenkins25e9bd72020-08-27 17:39:06967 NSMutableArray* allowed_experimental_policies = [[NSMutableArray alloc] init];
Guillaume Jenkins57606d72020-08-13 17:32:55968
Guillaume Jenkins25e9bd72020-08-27 17:39:06969 // Set some sample policy values for testing if EnableSamplePolicies is set to
970 // true.
Guillaume Jenkinseeb7007c2020-06-25 22:55:40971 if ([defaults boolForKey:@"EnableSamplePolicies"]) {
Guillaume Jenkins57606d72020-08-13 17:32:55972 [testing_policies addEntriesFromDictionary:@{
Tina Wang59d0b7e2020-08-11 04:41:01973 base::SysUTF8ToNSString(policy::key::kAutofillAddressEnabled) : @NO,
974
Guillaume Jenkinseeb7007c2020-06-25 22:55:40975 base::SysUTF8ToNSString(policy::key::kAutofillCreditCardEnabled) : @NO,
976
977 // 2 = Disable all variations
978 base::SysUTF8ToNSString(policy::key::kChromeVariations) : @2,
979
980 // 2 = Do not allow any site to show popups
981 base::SysUTF8ToNSString(policy::key::kDefaultPopupsSetting) : @2,
982
Tina Wang5abee802020-07-29 23:09:52983 // Set default search engine.
984 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderEnabled) :
985 @YES,
986 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderSearchURL) :
987 @"http://www.google.com/search?q={searchTerms}",
988 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderName) :
Tina Wang7cd0a062020-09-15 21:31:02989 @"TestEngine",
Tina Wang5abee802020-07-29 23:09:52990
Tina Wang89068c842020-10-29 15:51:50991 base::SysUTF8ToNSString(policy::key::kEditBookmarksEnabled) : @NO,
992
Gauthier Ambard21b23702021-04-16 16:11:27993 base::SysUTF8ToNSString(policy::key::kNTPContentSuggestionsEnabled) : @NO,
994
Guillaume Jenkinseeb7007c2020-06-25 22:55:40995 base::SysUTF8ToNSString(policy::key::kPasswordManagerEnabled) : @NO,
Tina Wang59d0b7e2020-08-11 04:41:01996
997 base::SysUTF8ToNSString(policy::key::kTranslateEnabled) : @NO,
Tina Wang54dddfc22020-08-20 22:34:53998
999 // 2 = Enhanced safe browsing protection
1000 base::SysUTF8ToNSString(policy::key::kSafeBrowsingProtectionLevel) : @2,
1001
1002 base::SysUTF8ToNSString(policy::key::kSearchSuggestEnabled) : @YES,
Guillaume Jenkins57606d72020-08-13 17:32:551003 }];
1004 }
1005
Ewann227a3c02021-04-19 12:04:541006 if ([defaults boolForKey:@"EnableSyncDisabledPolicy"]) {
Guillaume Jenkinsfe46d3a2021-04-26 19:51:041007 NSString* sync_policy_key =
1008 base::SysUTF8ToNSString(policy::key::kSyncDisabled);
David Jean5ca263c2021-08-18 09:19:301009 [testing_policies addEntriesFromDictionary:@{sync_policy_key : @YES}];
Ewann227a3c02021-04-19 12:04:541010 }
Ewann227a3c02021-04-19 12:04:541011
Ewann570a6302021-08-17 07:22:421012 // SyncTypesListDisabled policy.
1013 NSString* Sync_types_list_disabled_key =
1014 base::SysUTF8ToNSString(policy::key::kSyncTypesListDisabled);
1015 NSMutableArray* Sync_types_list_disabled_values =
1016 [[NSMutableArray alloc] init];
1017 if ([defaults boolForKey:@"SyncTypesListBookmarks"]) {
1018 [Sync_types_list_disabled_values addObject:@"bookmarks"];
1019 }
1020 if ([defaults boolForKey:@"SyncTypesListReadingList"]) {
1021 [Sync_types_list_disabled_values addObject:@"readingList"];
1022 }
1023 if ([defaults boolForKey:@"SyncTypesListPreferences"]) {
1024 [Sync_types_list_disabled_values addObject:@"preferences"];
1025 }
1026 if ([defaults boolForKey:@"SyncTypesListPasswords"]) {
1027 [Sync_types_list_disabled_values addObject:@"passwords"];
1028 }
1029 if ([defaults boolForKey:@"SyncTypesListAutofill"]) {
1030 [Sync_types_list_disabled_values addObject:@"autofill"];
1031 }
1032 if ([defaults boolForKey:@"SyncTypesListTypedUrls"]) {
1033 [Sync_types_list_disabled_values addObject:@"typedUrls"];
1034 }
1035 if ([defaults boolForKey:@"SyncTypesListTabs"]) {
1036 [Sync_types_list_disabled_values addObject:@"tabs"];
1037 }
1038 if ([Sync_types_list_disabled_values count]) {
1039 [testing_policies addEntriesFromDictionary:@{
1040 Sync_types_list_disabled_key : Sync_types_list_disabled_values
1041 }];
Ewann570a6302021-08-17 07:22:421042 }
1043
Gauthier Ambard073eaa92021-11-22 15:24:131044 // If an incognito mode availability is set, set the value.
Tina Wangc6bcf572021-01-27 18:15:521045 NSString* incognito_policy_key =
1046 base::SysUTF8ToNSString(policy::key::kIncognitoModeAvailability);
1047 NSInteger incognito_mode_availability =
1048 [defaults integerForKey:incognito_policy_key];
1049 if (incognito_mode_availability) {
Tina Wangc6bcf572021-01-27 18:15:521050 [testing_policies addEntriesFromDictionary:@{
1051 incognito_policy_key : @(incognito_mode_availability),
1052 }];
1053 }
1054
Ewann40a8f8a2021-07-29 10:01:201055 NSString* restriction_pattern =
1056 [defaults stringForKey:@"RestrictAccountsToPatterns"];
1057 if ([restriction_pattern length] > 0) {
Ewannb3bee382021-08-16 09:12:291058 NSString* restrict_key =
1059 base::SysUTF8ToNSString(policy::key::kRestrictAccountsToPatterns);
Ewann40a8f8a2021-07-29 10:01:201060 [testing_policies addEntriesFromDictionary:@{
Ewannb3bee382021-08-16 09:12:291061 restrict_key : @[ restriction_pattern ]
Ewann40a8f8a2021-07-29 10:01:201062 }];
1063 }
1064
Vincent Boisselle19200bc2021-09-01 17:58:251065 // If the sign-in policy is set (not "None"), add the policy key to the list
1066 // of enabled experimental policies, and set the value.
1067 NSString* const kSigninPolicyKey = @"BrowserSignin";
1068 NSInteger signin_policy_mode = [defaults integerForKey:kSigninPolicyKey];
1069 if (signin_policy_mode) {
1070 // Remove the mode offset that was used to represent the unset policy.
1071 --signin_policy_mode;
1072 DCHECK(signin_policy_mode >= 0);
1073
Vincent Boisselle19200bc2021-09-01 17:58:251074 [testing_policies addEntriesFromDictionary:@{
1075 kSigninPolicyKey : @(signin_policy_mode),
1076 }];
1077 }
1078
Veronique Nguyen9b1044f2022-01-11 14:41:131079 // If the New Tab Page URL is set (not empty) add the value to the list of
1080 // test policies.
1081 NSString* ntp_location = [defaults stringForKey:@"NTPLocation"];
1082 if ([ntp_location length] > 0) {
1083 NSString* ntp_location_key =
1084 base::SysUTF8ToNSString(policy::key::kNewTabPageLocation);
1085 [testing_policies
1086 addEntriesFromDictionary:@{ntp_location_key : ntp_location}];
Veronique Nguyen302d8702022-01-12 21:18:571087 [allowed_experimental_policies addObject:ntp_location_key];
Veronique Nguyen9b1044f2022-01-11 14:41:131088 }
1089
Ali Juma9ec36d2b2022-03-28 14:53:121090 if ([defaults boolForKey:@"DisallowChromeDataInBackups"]) {
1091 NSString* allow_backups_key =
1092 base::SysUTF8ToNSString(policy::key::kAllowChromeDataInBackups);
1093 [testing_policies addEntriesFromDictionary:@{allow_backups_key : @NO}];
1094 [allowed_experimental_policies addObject:allow_backups_key];
1095 }
1096
Guillaume Jenkins25e9bd72020-08-27 17:39:061097 // If any experimental policy was allowed, set the EnableExperimentalPolicies
1098 // policy.
1099 if ([allowed_experimental_policies count] > 0) {
1100 [testing_policies setValue:allowed_experimental_policies
1101 forKey:base::SysUTF8ToNSString(
1102 policy::key::kEnableExperimentalPolicies)];
1103 }
1104
jlebel2eb40222022-05-06 11:15:421105 NSString* metrics_reporting_key = @"MetricsReportingEnabled";
1106 switch ([defaults integerForKey:metrics_reporting_key]) {
1107 case 1:
1108 // Metrics reporting forced.
1109 [testing_policies setValue:@(YES) forKey:metrics_reporting_key];
1110 break;
1111 case 2:
1112 // Metrics reporting disabled.
1113 [testing_policies setValue:@(NO) forKey:metrics_reporting_key];
1114 break;
1115 default:
1116 // Metrics reporting not managed.
1117 break;
1118 }
1119
David Jean6f85d44f2021-08-19 08:08:451120 // Warning: Add new flags to TestingPoliciesHash() below.
1121
David Jean5ca263c2021-08-18 09:19:301122 return testing_policies;
1123}
David Jean6f85d44f2021-08-19 08:08:451124
1125// Generates a unique NSString based on currently monitored policies from
1126// NSUserDefaults standardUserDefaults.
1127NSString* TestingPoliciesHash() {
1128 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1129 return [NSString
jlebel2eb40222022-05-06 11:15:421130 stringWithFormat:@"%d|%d|%d|%d|%@|%d|%d|%d|%d|%d|%d|%d|%d|%@|%d",
Ali Juma9ec36d2b2022-03-28 14:53:121131 [defaults boolForKey:@"DisallowChromeDataInBackups"],
David Jean6f85d44f2021-08-19 08:08:451132 [defaults boolForKey:@"EnableSyncDisabledPolicy"],
1133 [defaults boolForKey:@"EnableSamplePolicies"],
jlebel2eb40222022-05-06 11:15:421134 static_cast<int>([defaults
1135 integerForKey:@"IncognitoModeAvailability"]),
David Jean6f85d44f2021-08-19 08:08:451136 [defaults stringForKey:@"RestrictAccountsToPatterns"],
1137 [defaults boolForKey:@"SyncTypesListBookmarks"],
1138 [defaults boolForKey:@"SyncTypesListReadingList"],
1139 [defaults boolForKey:@"SyncTypesListPreferences"],
1140 [defaults boolForKey:@"SyncTypesListPasswords"],
1141 [defaults boolForKey:@"SyncTypesListAutofill"],
1142 [defaults boolForKey:@"SyncTypesListTypedUrls"],
jlebel2eb40222022-05-06 11:15:421143 [defaults boolForKey:@"SyncTypesListTabs"],
1144 static_cast<int>(
1145 [defaults integerForKey:@"BrowserSignin"]),
1146 [defaults stringForKey:@"NTPLocation"],
1147 static_cast<int>([defaults
1148 integerForKey:@"MetricsReportingEnabled"])];
David Jean6f85d44f2021-08-19 08:08:451149}
David Jean5ca263c2021-08-18 09:19:301150} // namespace
1151
1152// Add all switches from experimental flags to |command_line|.
1153void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) {
1154 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1155
1156 // Set the UA flag if UseMobileSafariUA is enabled.
1157 if ([defaults boolForKey:@"UseMobileSafariUA"]) {
1158 // Safari uses "Vesion/", followed by the OS version excluding bugfix, where
1159 // Chrome puts its product token.
1160 int32_t major = 0;
1161 int32_t minor = 0;
1162 int32_t bugfix = 0;
1163 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix);
1164 std::string product = base::StringPrintf("Version/%d.%d", major, minor);
1165
1166 command_line->AppendSwitchASCII(switches::kUserAgent,
1167 web::BuildMobileUserAgent(product));
1168 }
1169
1170 // Shared variables for all enterprise experimental flags.
Vincent Boisselleed0e6f1a2021-11-09 06:47:341171 NSMutableDictionary* testing_policies = CreateExperimentalTestingPolicies();
David Jean5ca263c2021-08-18 09:19:301172
1173 // If a CBCM enrollment token is provided, force Chrome Browser Cloud
1174 // Management to enabled and add the token to the list of policies.
1175 NSString* token_key =
1176 base::SysUTF8ToNSString(policy::key::kCloudManagementEnrollmentToken);
1177 NSString* token = [defaults stringForKey:token_key];
1178
1179 if ([token length] > 0) {
1180 command_line->AppendSwitch(switches::kEnableChromeBrowserCloudManagement);
1181 [testing_policies setValue:token forKey:token_key];
1182 }
1183
Vincent Boisselled042d552022-04-09 01:22:591184 if ([defaults boolForKey:@"EnableUserPolicy"]) {
1185 policy::EnableUserPolicy();
1186 }
1187
Guillaume Jenkins57606d72020-08-13 17:32:551188 // If some policies were set, commit them to the app's registration defaults.
1189 if ([testing_policies count] > 0) {
Guillaume Jenkinseeb7007c2020-06-25 22:55:401190 NSDictionary* registration_defaults =
1191 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
1192 [defaults registerDefaults:registration_defaults];
1193 }
1194
sdefresne14900ee2015-11-27 14:43:211195 // Freeform commandline flags. These are added last, so that any flags added
1196 // earlier in this function take precedence.
1197 if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) {
1198 base::CommandLine::StringVector flags;
1199 // Append an empty "program" argument.
1200 flags.push_back("");
1201
1202 // The number of flags corresponds to the number of text fields in
1203 // Experimental.plist.
1204 const int kNumFreeformFlags = 5;
1205 for (int i = 1; i <= kNumFreeformFlags; ++i) {
1206 NSString* key =
1207 [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i];
1208 NSString* flag = [defaults stringForKey:key];
1209 if ([flag length]) {
Robbie Gibsonc91ce622019-05-20 14:44:331210 // iOS keyboard replaces -- with —, so undo that.
1211 flag = [flag stringByReplacingOccurrencesOfString:@"—"
1212 withString:@"--"
1213 options:0
1214 range:NSMakeRange(0, 1)];
1215 // To make things easier, allow flags with no dashes by prepending them
1216 // here. This also allows for flags that just have one dash if they
1217 // exist.
1218 if (![flag hasPrefix:@"-"]) {
1219 flag = [@"--" stringByAppendingString:flag];
1220 }
sdefresne14900ee2015-11-27 14:43:211221 flags.push_back(base::SysNSStringToUTF8(flag));
1222 }
1223 }
1224
1225 base::CommandLine temp_command_line(flags);
1226 command_line->AppendArguments(temp_command_line, false);
1227 }
msardafc76f662017-02-24 12:46:281228
justincohendacc85d2017-06-28 23:34:101229 // Populate command line flag for 3rd party keyboard omnibox workaround.
1230 NSString* enableThirdPartyKeyboardWorkaround =
1231 [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"];
1232 if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) {
1233 command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround);
1234 } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) {
1235 command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround);
1236 }
1237
Sylvain Defresned3cd8d92022-01-18 13:35:081238 ios::provider::AppendSwitchesFromExperimentalSettings(defaults, command_line);
sdefresne14900ee2015-11-27 14:43:211239}
1240
David Jean5ca263c2021-08-18 09:19:301241void MonitorExperimentalSettingsChanges() {
David Jean5ca263c2021-08-18 09:19:301242 // Startup values for settings to be observed.
David Jean6f85d44f2021-08-19 08:08:451243 __block NSString* hash = TestingPoliciesHash();
David Jeane83ed652021-08-25 14:52:481244 static std::atomic_bool pending_check(false);
David Jean5ca263c2021-08-18 09:19:301245
1246 auto monitor = ^(NSNotification* notification) {
David Jeane83ed652021-08-25 14:52:481247 bool has_pending_check = pending_check.exchange(true);
1248 if (has_pending_check)
1249 return;
1250
David Jeanbc0fae32021-08-25 10:31:391251 // Can be called from any thread from where the notification was sent,
1252 // but since it may change standardUserDefaults, and that has to be on main
1253 // thread, dispatch to main thread.
1254 dispatch_async(dispatch_get_main_queue(), ^{
1255 // Check if observed settings have changed. Since source and destination
1256 // are both user defaults, this is required to avoid cycling back here.
1257 NSString* newHash = TestingPoliciesHash();
1258 if (![newHash isEqualToString:hash]) {
1259 hash = newHash;
David Jean5ca263c2021-08-18 09:19:301260
David Jeanbc0fae32021-08-25 10:31:391261 // Publish update.
1262 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1263 NSMutableDictionary* testing_policies =
Vincent Boisselleed0e6f1a2021-11-09 06:47:341264 CreateExperimentalTestingPolicies();
David Jeanbc0fae32021-08-25 10:31:391265 NSDictionary* registration_defaults =
1266 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
1267 [defaults registerDefaults:registration_defaults];
1268 }
David Jeane83ed652021-08-25 14:52:481269
1270 pending_check.store(false);
David Jeanbc0fae32021-08-25 10:31:391271 });
David Jean5ca263c2021-08-18 09:19:301272 };
1273
1274 NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
1275 [center addObserverForName:NSUserDefaultsDidChangeNotification
1276 object:nil
David Jeanbc0fae32021-08-25 10:31:391277 queue:nil
David Jean5ca263c2021-08-18 09:19:301278 usingBlock:monitor];
1279}
1280
sdefresne14900ee2015-11-27 14:43:211281void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage,
1282 base::CommandLine* command_line) {
Sylvain Defresne8327a2f2019-01-17 14:19:181283 GetGlobalFlagsState().ConvertFlagsToSwitches(
sdefresnec9763902015-12-02 10:30:111284 flags_storage, command_line, flags_ui::kAddSentinels,
Gregory Chatzinofff6523722017-11-21 01:33:531285 switches::kEnableFeatures, switches::kDisableFeatures);
sdefresne14900ee2015-11-27 14:43:211286}
1287
jkrcalbf073372016-07-29 07:21:311288std::vector<std::string> RegisterAllFeatureVariationParameters(
1289 flags_ui::FlagsStorage* flags_storage,
1290 base::FeatureList* feature_list) {
Justin Cohen2e2adb52019-10-25 17:00:021291 // Occasionally DCHECK crashes on canary can be very distuptive. An
1292 // experimental flag was added to aid in temporarily disabling this for
1293 // canary testers.
1294#if defined(DCHECK_IS_CONFIGURABLE)
1295 if (experimental_flags::AreDCHECKCrashesDisabled()) {
1296 std::vector<base::FeatureList::FeatureOverrideInfo> overrides;
1297 overrides.push_back(
1298 {std::cref(base::kDCheckIsFatalFeature),
1299 base::FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE});
1300 feature_list->RegisterExtraFeatureOverrides(std::move(overrides));
1301 }
1302#endif // defined(DCHECK_IS_CONFIGURABLE)
1303
Sylvain Defresne8327a2f2019-01-17 14:19:181304 return GetGlobalFlagsState().RegisterAllFeatureVariationParameters(
1305 flags_storage, feature_list);
jkrcalbf073372016-07-29 07:21:311306}
1307
sdefresne14900ee2015-11-27 14:43:211308void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage,
1309 flags_ui::FlagAccess access,
Morten Stenshorne7afa5802021-07-15 10:04:431310 base::Value::ListStorage& supported_entries,
1311 base::Value::ListStorage& unsupported_entries) {
Sylvain Defresne8327a2f2019-01-17 14:19:181312 GetGlobalFlagsState().GetFlagFeatureEntries(
sdefresne14900ee2015-11-27 14:43:211313 flags_storage, access, supported_entries, unsupported_entries,
Renjie Tang208c8192020-11-03 00:46:511314 base::BindRepeating(&SkipConditionalFeatureEntry));
sdefresne14900ee2015-11-27 14:43:211315}
1316
1317void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage,
1318 const std::string& internal_name,
1319 bool enable) {
Sylvain Defresne8327a2f2019-01-17 14:19:181320 GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name,
1321 enable);
sdefresne14900ee2015-11-27 14:43:211322}
1323
1324void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) {
Sylvain Defresne8327a2f2019-01-17 14:19:181325 GetGlobalFlagsState().ResetAllFlags(flags_storage);
sdefresne14900ee2015-11-27 14:43:211326}
1327
1328namespace testing {
1329
Elly Fong-Jones323ab1092021-08-23 22:36:311330base::span<const flags_ui::FeatureEntry> GetFeatureEntries() {
1331 return base::span<const flags_ui::FeatureEntry>(kFeatureEntries,
Daniel Cheng1f047a82022-02-26 10:04:531332 std::size(kFeatureEntries));
sdefresne14900ee2015-11-27 14:43:211333}
1334
1335} // namespace testing