blob: f064d4e842c30415466fddb668922098fb2fea08 [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"
Igor Ruvinova43a66dc2022-06-09 21:57:4547#include "components/policy/core/common/features.h"
Guillaume Jenkinseeb7007c2020-06-25 22:55:4048#import "components/policy/core/common/policy_loader_ios_constants.h"
49#include "components/policy/policy_constants.h"
Joemer Ramos34175732022-02-14 18:59:1650#include "components/safe_browsing/core/common/features.h"
Victor Hugo Vianna Silva0399402f2021-09-07 21:41:2551#import "components/send_tab_to_self/features.h"
Tommy Martino0caf3362021-01-13 20:29:5852#include "components/shared_highlighting/core/common/shared_highlighting_features.h"
Valeriya Sinevicha79dc612018-09-25 14:49:0953#include "components/signin/core/browser/account_reconcilor.h"
Jérôme Lebelc374fdd2019-09-27 10:36:4854#include "components/signin/ios/browser/features.h"
Colin Blundell3517170e2019-07-11 08:16:3455#include "components/signin/public/base/signin_switches.h"
sdefresne36579782016-02-05 11:08:2556#include "components/strings/grit/components_strings.h"
Victor Hugo Vianna Silvaa48aa01c2022-02-09 20:38:2357#include "components/sync/base/command_line_switches.h"
58#include "components/sync/base/features.h"
Ewann570a6302021-08-17 07:22:4259#include "components/sync/base/pref_names.h"
Moe Ahmadie4cce1f2018-12-18 23:48:0160#include "components/translate/core/browser/translate_prefs.h"
Olivier Robinffe767c2022-04-21 13:13:2361#include "components/translate/core/common/translate_util.h"
Sylvain Defresneae6987e2018-03-01 13:21:4062#include "ios/chrome/browser/browsing_data/browsing_data_features.h"
sdefresne14900ee2015-11-27 14:43:2163#include "ios/chrome/browser/chrome_switches.h"
Eugene But2823dc7e2020-07-21 18:10:3764#include "ios/chrome/browser/crash_report/features.h"
Nazerke21bdc45a2019-07-11 09:02:0565#include "ios/chrome/browser/flags/ios_chrome_flag_descriptions.h"
Ed Chin100660bf2022-04-26 16:59:1366#import "ios/chrome/browser/ntp/features.h"
Vincent Boisselled042d552022-04-09 01:22:5967#include "ios/chrome/browser/policy/cloud/user_policy_switch.h"
Vincent Boisselle19200bc2021-09-01 17:58:2568#include "ios/chrome/browser/policy/policy_util.h"
Sylvain Defresne9c107082020-10-27 16:39:1369#include "ios/chrome/browser/screen_time/screen_time_buildflags.h"
Olivier Robin3a957df2021-12-21 18:04:3470#import "ios/chrome/browser/sessions/session_features.h"
Gauthier Ambard33e03302019-02-21 13:28:5871#include "ios/chrome/browser/system_flags.h"
Louis Romeroac04f786a2022-04-19 09:39:3072#include "ios/chrome/browser/ui/bubble/bubble_features.h"
adamta22a4d502020-05-21 03:12:2173#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h"
Javier Ernesto Flores Robles209b2822021-03-25 19:16:5074#import "ios/chrome/browser/ui/default_promo/default_browser_utils.h"
Ewann1a9d33d2021-06-14 11:12:2475#import "ios/chrome/browser/ui/download/features.h"
Aliona DANGLAebfd7d022021-10-08 14:15:4576#include "ios/chrome/browser/ui/first_run/fre_field_trial.h"
Kurt Horimoto4da682b022018-04-12 07:43:3577#import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h"
adamta273568472020-12-04 23:53:5778#import "ios/chrome/browser/ui/ntp/new_tab_page_feature.h"
Christian Xub8c06cd2022-04-29 20:55:0179#import "ios/chrome/browser/ui/omnibox/omnibox_ui_features.h"
Robbie Gibson686c56732021-10-04 17:11:4580#import "ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.h"
Gauthier Ambard30ad9ca2022-06-09 14:15:2681#import "ios/chrome/browser/ui/popup_menu/public/features.h"
gogerald0ff29e52021-02-03 18:56:1982#import "ios/chrome/browser/ui/start_surface/start_surface_features.h"
Nazerke0bf10c42020-11-12 11:17:3283#import "ios/chrome/browser/ui/tab_switcher/tab_grid/features.h"
Kurt Horimoto79d590b2018-09-12 19:09:2884#import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h"
Justin Cohen2d81c582018-01-22 14:46:4485#include "ios/chrome/browser/ui/ui_feature_flags.h"
Louis Romerofbfbd932022-04-15 18:04:5086#include "ios/chrome/browser/ui/util/features.h"
Yi Su392b3032018-06-05 07:26:4787#include "ios/chrome/browser/web/features.h"
sdefresne14900ee2015-11-27 14:43:2188#include "ios/chrome/grit/ios_strings.h"
Mustafa Emre Acer4de8863a2022-05-03 22:17:0189#include "ios/components/security_interstitials/https_only_mode/feature.h"
Sylvain Defresne559ce5f2022-01-13 17:14:5890#include "ios/public/provider/chrome/browser/app_utils/app_utils_api.h"
Eugene But61818bc2019-04-15 21:04:0791#include "ios/web/common/features.h"
Eugene Bute79f2742019-07-26 17:07:2292#include "ios/web/common/user_agent.h"
Eugene Butb1416232019-07-22 17:31:5893#include "ios/web/common/web_view_creation_util.h"
sdefresne14900ee2015-11-27 14:43:2194
Sylvain Defresne9c107082020-10-27 16:39:1395#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
96#include "ios/chrome/browser/screen_time/features.h"
97#endif
98
sdefresne14900ee2015-11-27 14:43:2199#if !defined(OFFICIAL_BUILD)
100#include "components/variations/variations_switches.h"
vitaliii489217aa2017-01-30 14:50:22101#endif
stkhapuginc1be1792016-12-13 14:30:53102
103#if !defined(__has_feature) || !__has_feature(objc_arc)
104#error "This file requires ARC support."
105#endif
sdefresne14900ee2015-11-27 14:43:21106
elawrence816f6790e2017-06-16 18:19:28107using flags_ui::FeatureEntry;
108
sdefresne14900ee2015-11-27 14:43:21109namespace {
Emily Starkbafa9062017-12-27 15:22:46110
Olivier Robin3d60411622018-02-23 10:03:22111const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = {
112 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
113 {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"},
114 {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"},
115 {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"},
116 {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"},
117 {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"},
118 {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"},
119 {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"},
120 {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"},
121};
122
Nohemi Fernandez222d6d42020-09-30 20:35:57123const FeatureEntry::Choice kDelayThresholdMinutesToUpdateGaiaCookieChoices[] = {
124 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
125 {"0", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "0"},
126 {"10", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "10"},
127 {"60", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "60"},
128};
129
Nohemi Fernandezc00842a2021-07-26 11:47:34130const FeatureEntry::Choice
131 kWaitThresholdMillisecondsForCapabilitiesApiChoices[] = {
132 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
133 {"200", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "200"},
134 {"500", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "500"},
135 {"5000", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "5000"},
136};
137
Stepan Khapugincc4e9842019-01-23 13:38:13138const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = {
139 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}};
140const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = {
141 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}};
142const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = {
143 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}};
144const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = {
145 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}};
146const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = {
147 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}};
148const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = {
149 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}};
150const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = {
151 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}};
152
153const FeatureEntry::FeatureVariation
154 kOmniboxUIMaxAutocompleteMatchesVariations[] = {
155 {"3 matches", kOmniboxUIMaxAutocompleteMatches3,
Daniel Cheng1f047a82022-02-26 10:04:53156 std::size(kOmniboxUIMaxAutocompleteMatches3), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13157 {"4 matches", kOmniboxUIMaxAutocompleteMatches4,
Daniel Cheng1f047a82022-02-26 10:04:53158 std::size(kOmniboxUIMaxAutocompleteMatches4), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13159 {"5 matches", kOmniboxUIMaxAutocompleteMatches5,
Daniel Cheng1f047a82022-02-26 10:04:53160 std::size(kOmniboxUIMaxAutocompleteMatches5), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13161 {"6 matches", kOmniboxUIMaxAutocompleteMatches6,
Daniel Cheng1f047a82022-02-26 10:04:53162 std::size(kOmniboxUIMaxAutocompleteMatches6), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13163 {"8 matches", kOmniboxUIMaxAutocompleteMatches8,
Daniel Cheng1f047a82022-02-26 10:04:53164 std::size(kOmniboxUIMaxAutocompleteMatches8), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13165 {"10 matches", kOmniboxUIMaxAutocompleteMatches10,
Daniel Cheng1f047a82022-02-26 10:04:53166 std::size(kOmniboxUIMaxAutocompleteMatches10), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13167 {"12 matches", kOmniboxUIMaxAutocompleteMatches12,
Daniel Cheng1f047a82022-02-26 10:04:53168 std::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}};
Stepan Khapugincc4e9842019-01-23 13:38:13169
Stepan Khapuginbac467e2022-05-06 21:11:54170const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches6[] = {
171 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "6"}};
172const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches15[] = {
173 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "15"}};
174const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches20[] = {
175 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "20"}};
176
177const FeatureEntry::FeatureVariation kOmniboxMaxZPSMatchesVariations[] = {
178 {"6 matches", kOmniboxMaxZPSMatches6, std::size(kOmniboxMaxZPSMatches6),
179 nullptr},
180 {"15 matches", kOmniboxMaxZPSMatches15, std::size(kOmniboxMaxZPSMatches15),
181 nullptr},
182 {"20 matches", kOmniboxMaxZPSMatches20, std::size(kOmniboxMaxZPSMatches20),
183 nullptr},
184};
185
Caitlin Fischer37e01232019-05-24 13:05:45186const FeatureEntry::FeatureParam
187 kAutofillUseMobileLabelDisambiguationShowAll[] = {
188 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
189 autofill::features::
190 kAutofillUseMobileLabelDisambiguationParameterShowAll}};
191const FeatureEntry::FeatureParam
192 kAutofillUseMobileLabelDisambiguationShowOne[] = {
193 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
194 autofill::features::
195 kAutofillUseMobileLabelDisambiguationParameterShowOne}};
196
197const FeatureEntry::FeatureVariation
198 kAutofillUseMobileLabelDisambiguationVariations[] = {
199 {"(show all)", kAutofillUseMobileLabelDisambiguationShowAll,
Daniel Cheng1f047a82022-02-26 10:04:53200 std::size(kAutofillUseMobileLabelDisambiguationShowAll), nullptr},
Caitlin Fischer37e01232019-05-24 13:05:45201 {"(show one)", kAutofillUseMobileLabelDisambiguationShowOne,
Daniel Cheng1f047a82022-02-26 10:04:53202 std::size(kAutofillUseMobileLabelDisambiguationShowOne), nullptr}};
Caitlin Fischer37e01232019-05-24 13:05:45203
Javier Ernesto Flores Roblese85f4a12021-02-23 18:10:10204const FeatureEntry::FeatureParam
Javier Ernesto Flores Robles159414232021-06-16 14:29:59205 kDefaultBrowserFullscreenPromoExperimentRemindMeLater[] = {
206 {kDefaultBrowserFullscreenPromoExperimentRemindMeGroupParam, "true"}};
207const FeatureEntry::FeatureVariation
208 kDefaultBrowserFullscreenPromoExperimentVariations[] = {
209 {"Remind me later",
210 kDefaultBrowserFullscreenPromoExperimentRemindMeLater,
Daniel Cheng1f047a82022-02-26 10:04:53211 std::size(kDefaultBrowserFullscreenPromoExperimentRemindMeLater),
Javier Ernesto Flores Robles159414232021-06-16 14:29:59212 nullptr}};
213
gogeralddb0d8ae2020-11-13 03:56:58214const FeatureEntry::FeatureParam kDiscoverFeedInNtpEnableNativeUI[] = {
215 {kDiscoverFeedIsNativeUIEnabled, "true"}};
216const FeatureEntry::FeatureVariation kDiscoverFeedInNtpVariations[] = {
217 {"Native UI", kDiscoverFeedInNtpEnableNativeUI,
Daniel Cheng1f047a82022-02-26 10:04:53218 std::size(kDiscoverFeedInNtpEnableNativeUI), nullptr}};
gogeralddb0d8ae2020-11-13 03:56:58219
Sergio Collazos9fcc6ed2021-10-06 00:58:03220const FeatureEntry::FeatureParam kDiscoverFeedSRSReconstructedTemplates[] = {
221 {kDiscoverFeedSRSReconstructedTemplatesEnabled, "true"}};
222const FeatureEntry::FeatureParam kDiscoverFeedSRSPreloadTemplates[] = {
223 {kDiscoverFeedSRSPreloadTemplatesEnabled, "true"}};
224const FeatureEntry::FeatureVariation
225 kEnableDiscoverFeedStaticResourceServingVariations[] = {
226 {"Reconstruct Templates", kDiscoverFeedSRSReconstructedTemplates,
Daniel Cheng1f047a82022-02-26 10:04:53227 std::size(kDiscoverFeedSRSReconstructedTemplates), nullptr},
Sergio Collazos9fcc6ed2021-10-06 00:58:03228 {"Preload Templates", kDiscoverFeedSRSPreloadTemplates,
Daniel Cheng1f047a82022-02-26 10:04:53229 std::size(kDiscoverFeedSRSPreloadTemplates), nullptr},
Sergio Collazos9fcc6ed2021-10-06 00:58:03230};
231
Mohammad Refaatab6bee62022-05-16 16:31:15232const FeatureEntry::FeatureParam kDiscoverFeedTopSyncPromoFullWithTitle[] = {
233 {kDiscoverFeedTopSyncPromoStyleParam,
234 kDiscoverFeedTopSyncPromoStyleFullWithTitle}};
235const FeatureEntry::FeatureParam kDiscoverFeedTopSyncPromoCompact[] = {
236 {kDiscoverFeedTopSyncPromoStyleParam,
237 kDiscoverFeedTopSyncPromoStyleCompact}};
238const FeatureEntry::FeatureVariation kDiscoverFeedTopSyncPromoVariations[] = {
239 {"Full with title", kDiscoverFeedTopSyncPromoFullWithTitle,
240 std::size(kDiscoverFeedTopSyncPromoFullWithTitle), nullptr},
241 {"Compact", kDiscoverFeedTopSyncPromoCompact,
242 std::size(kDiscoverFeedTopSyncPromoCompact), nullptr}};
243
Robbie Gibson46351032022-03-31 19:46:23244const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion1[] = {
245 {kIOSOmniboxUpdatedPopupUIVariationName,
246 kIOSOmniboxUpdatedPopupUIVariation1}};
247const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion2[] = {
248 {kIOSOmniboxUpdatedPopupUIVariationName,
249 kIOSOmniboxUpdatedPopupUIVariation2}};
250const FeatureEntry::FeatureVariation kiOSOmniboxUpdatedPopupUIVariations[] = {
251 {"Version 1", kiOSOmniboxUpdatedPopupUIVersion1,
252 std::size(kiOSOmniboxUpdatedPopupUIVersion1), nullptr},
253 {"Version 2", kiOSOmniboxUpdatedPopupUIVersion2,
254 std::size(kiOSOmniboxUpdatedPopupUIVersion2), nullptr}};
255
gogerald53c6e7a2021-04-15 22:07:35256const FeatureEntry::FeatureParam kStartSurfaceTenSecondsShrinkLogo[] = {
Chris Lu5470417c2021-03-03 18:43:08257 {kStartSurfaceShrinkLogoParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35258 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
259const FeatureEntry::FeatureParam kStartSurfaceTenSecondsHideShortcuts[] = {
Chris Lu5470417c2021-03-03 18:43:08260 {kStartSurfaceHideShortcutsParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35261 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
262const FeatureEntry::FeatureParam kStartSurfaceTenSecondsReturnToRecentTab[] = {
Chris Lu5470417c2021-03-03 18:43:08263 {kStartSurfaceReturnToRecentTabParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35264 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
265const FeatureEntry::FeatureParam
266 kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab[] = {
267 {kStartSurfaceShrinkLogoParam, "true"},
268 {kStartSurfaceReturnToRecentTabParam, "true"},
269 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
270const FeatureEntry::FeatureParam
271 kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab[] = {
272 {kStartSurfaceHideShortcutsParam, "true"},
273 {kStartSurfaceReturnToRecentTabParam, "true"},
274 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
275const FeatureEntry::FeatureParam kStartSurfaceOneHourShrinkLogo[] = {
Chris Lu5470417c2021-03-03 18:43:08276 {kStartSurfaceShrinkLogoParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35277 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
278const FeatureEntry::FeatureParam kStartSurfaceOneHourHideShortcuts[] = {
279 {kStartSurfaceHideShortcutsParam, "true"},
280 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
281const FeatureEntry::FeatureParam kStartSurfaceOneHourReturnToRecentTab[] = {
Chris Lu5470417c2021-03-03 18:43:08282 {kStartSurfaceReturnToRecentTabParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35283 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
284const FeatureEntry::FeatureParam
285 kStartSurfaceOneHourShrinkLogoReturnToRecentTab[] = {
286 {kStartSurfaceShrinkLogoParam, "true"},
287 {kStartSurfaceReturnToRecentTabParam, "true"},
288 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
289const FeatureEntry::FeatureParam
290 kStartSurfaceOneHourHideShortcutsReturnToRecentTab[] = {
291 {kStartSurfaceHideShortcutsParam, "true"},
292 {kStartSurfaceReturnToRecentTabParam, "true"},
293 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
Chris Lu5470417c2021-03-03 18:43:08294
gogerald0e39e3aa2021-02-10 18:41:23295const FeatureEntry::FeatureVariation kStartSurfaceVariations[] = {
gogerald53c6e7a2021-04-15 22:07:35296 {"10s:Show Return to Recent Tab tile",
297 kStartSurfaceTenSecondsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53298 std::size(kStartSurfaceTenSecondsReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35299 {"10s:Shrink Logo", kStartSurfaceTenSecondsShrinkLogo,
Daniel Cheng1f047a82022-02-26 10:04:53300 std::size(kStartSurfaceTenSecondsShrinkLogo), nullptr},
gogerald53c6e7a2021-04-15 22:07:35301 {"10s:Hide Shortcuts", kStartSurfaceTenSecondsHideShortcuts,
Daniel Cheng1f047a82022-02-26 10:04:53302 std::size(kStartSurfaceTenSecondsHideShortcuts), nullptr},
gogerald53c6e7a2021-04-15 22:07:35303 {"10s:Shrink Logo and show Return to Recent Tab tile",
304 kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53305 std::size(kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35306 {"10s:Hide Shortcuts and show Return to Recent Tab tile",
307 kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53308 std::size(kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35309 {"1h:Show Return to Recent Tab tile", kStartSurfaceOneHourReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53310 std::size(kStartSurfaceOneHourReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35311 {"1h:Shrink Logo", kStartSurfaceOneHourShrinkLogo,
Daniel Cheng1f047a82022-02-26 10:04:53312 std::size(kStartSurfaceOneHourShrinkLogo), nullptr},
gogerald53c6e7a2021-04-15 22:07:35313 {"1h:Hide Shortcuts", kStartSurfaceOneHourHideShortcuts,
Daniel Cheng1f047a82022-02-26 10:04:53314 std::size(kStartSurfaceOneHourHideShortcuts), nullptr},
gogerald53c6e7a2021-04-15 22:07:35315 {"1h:Shrink Logo and show Return to Recent Tab tile",
316 kStartSurfaceOneHourShrinkLogoReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53317 std::size(kStartSurfaceOneHourShrinkLogoReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35318 {"1h:Hide Shortcuts and show Return to Recent Tab tile",
319 kStartSurfaceOneHourHideShortcutsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53320 std::size(kStartSurfaceOneHourHideShortcutsReturnToRecentTab), nullptr},
Chris Lu5470417c2021-03-03 18:43:08321};
gogerald0e39e3aa2021-02-10 18:41:23322
ginnnnnnny46435132022-06-01 16:06:04323const FeatureEntry::FeatureParam kFREDefaultBrowserPromoDefaultDelay[] = {
324 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoDefaultDelayParam}};
325const FeatureEntry::FeatureParam kFREDefaultBrowserPromoFirstRunOnly[] = {
326 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoFirstRunOnlyParam}};
327const FeatureEntry::FeatureParam kFREDefaultBrowserPromoShortDelay[] = {
328 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoShortDelayParam}};
329const FeatureEntry::FeatureVariation kFREDefaultBrowserPromoVariations[] = {
Aliona DANGLA8fae66f02021-10-06 15:47:11330 {"Wait 14 days after FRE default browser promo",
ginnnnnnny46435132022-06-01 16:06:04331 kFREDefaultBrowserPromoDefaultDelay,
332 std::size(kFREDefaultBrowserPromoDefaultDelay), nullptr},
333 {"FRE default browser promo only", kFREDefaultBrowserPromoFirstRunOnly,
334 std::size(kFREDefaultBrowserPromoFirstRunOnly), nullptr},
Aliona DANGLA8fae66f02021-10-06 15:47:11335 {"Wait 3 days after FRE default browser promo",
ginnnnnnny46435132022-06-01 16:06:04336 kFREDefaultBrowserPromoShortDelay,
337 std::size(kFREDefaultBrowserPromoShortDelay), nullptr},
Aliona DANGLA8fae66f02021-10-06 15:47:11338};
339
jlebel041fc1c2022-03-04 12:53:30340const FeatureEntry::FeatureParam kNewMICEFREWithUMADialog[] = {
341 {kNewMobileIdentityConsistencyFREParam,
342 kNewMobileIdentityConsistencyFREParamUMADialog}};
343const FeatureEntry::FeatureParam kNewMICEFREWithThreeSteps[] = {
344 {kNewMobileIdentityConsistencyFREParam,
345 kNewMobileIdentityConsistencyFREParamThreeSteps}};
346const FeatureEntry::FeatureParam kNewMICEFREWithTwoSteps[] = {
347 {kNewMobileIdentityConsistencyFREParam,
348 kNewMobileIdentityConsistencyFREParamTwoSteps}};
349const FeatureEntry::FeatureVariation
350 kNewMobileIdentityConsistencyFREVariations[] = {
351 {"New FRE with UMA dialog", kNewMICEFREWithUMADialog,
352 std::size(kNewMICEFREWithUMADialog), nullptr},
353 {"new FRE with 3 steps", kNewMICEFREWithThreeSteps,
354 std::size(kNewMICEFREWithThreeSteps), nullptr},
355 {"new FRE with 2 steps", kNewMICEFREWithTwoSteps,
356 std::size(kNewMICEFREWithTwoSteps), nullptr}};
357
Louis Romero023cc5052022-04-08 23:29:39358const FeatureEntry::FeatureParam kBubbleRichIPHTargetHighlight[] = {
359 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterTargetHighlight}};
Christian Xubd60c4b72022-03-22 15:25:01360const FeatureEntry::FeatureParam kBubbleRichIPHExplicitDismissal[] = {
361 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterExplicitDismissal}};
362const FeatureEntry::FeatureParam kBubbleRichIPHRich[] = {
363 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRich}};
364const FeatureEntry::FeatureParam kBubbleRichIPHRichWithSnooze[] = {
365 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRichWithSnooze}};
366const FeatureEntry::FeatureVariation kBubbleRichIPHVariations[] = {
Louis Romero023cc5052022-04-08 23:29:39367 {"Target Highlight", kBubbleRichIPHTargetHighlight,
368 std::size(kBubbleRichIPHTargetHighlight), nullptr},
Christian Xubd60c4b72022-03-22 15:25:01369 {"Explicit dismissal", kBubbleRichIPHExplicitDismissal,
370 std::size(kBubbleRichIPHExplicitDismissal), nullptr},
371 {"Dismissal and rich content", kBubbleRichIPHRich,
372 std::size(kBubbleRichIPHRich), nullptr},
Louis Romero023cc5052022-04-08 23:29:39373 {"Dismissal, rich content, and snooze", kBubbleRichIPHRichWithSnooze,
Christian Xubd60c4b72022-03-22 15:25:01374 std::size(kBubbleRichIPHRichWithSnooze), nullptr},
375};
376
Gauthier Ambard30ad9ca2022-06-09 14:15:26377const FeatureEntry::FeatureParam kPopupMenuBookmarkStringAddABookmark[] = {
378 {kPopupMenuBookmarkStringParamName,
379 kPopupMenuBookmarkStringParamAddABookmark}};
380const FeatureEntry::FeatureParam kPopupMenuBookmarkStringAddToBookmarks[] = {
381 {kPopupMenuBookmarkStringParamName,
382 kPopupMenuBookmarkStringParamAddToBookmarks}};
383const FeatureEntry::FeatureParam kPopupMenuBookmarkStringBookmarkThisPage[] = {
384 {kPopupMenuBookmarkStringParamName,
385 kPopupMenuBookmarkStringParamBookmarkThisPage}};
386
387const FeatureEntry::FeatureVariation kPopupMenuBookmarkStringVarations[] = {
388 {"(Add A Bookmark)", kPopupMenuBookmarkStringAddABookmark,
389 std::size(kPopupMenuBookmarkStringAddABookmark), nullptr},
390 {"(Add To Bookmarks)", kPopupMenuBookmarkStringAddToBookmarks,
391 std::size(kPopupMenuBookmarkStringAddToBookmarks), nullptr},
392 {"(Bookmark This Page)", kPopupMenuBookmarkStringBookmarkThisPage,
393 std::size(kPopupMenuBookmarkStringBookmarkThisPage), nullptr}};
394
Igor Ruvinov44fed9f2022-06-10 22:51:42395const FeatureEntry::FeatureParam kDmTokenDeletionParam[] = {{"forced", "true"}};
396const FeatureEntry::FeatureVariation kDmTokenDeletionVariation[] = {
397 {"(Forced)", kDmTokenDeletionParam, std::size(kDmTokenDeletionParam),
398 nullptr}};
399
Cooper Knaak1e026562017-07-26 05:22:28400// To add a new entry, add to the end of kFeatureEntries. There are four
sdefresne14900ee2015-11-27 14:43:21401// distinct types of entries:
Cooper Knaak1e026562017-07-26 05:22:28402// . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the
403// default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE
sdefresne14900ee2015-11-27 14:43:21404// macro for this type supplying the command line to the macro.
405// . MULTI_VALUE: a list of choices, the first of which should correspond to a
406// deactivated state for this lab (i.e. no command line option). To specify
407// this type of entry use the macro MULTI_VALUE_TYPE supplying it the
408// array of choices.
Cooper Knaak1e026562017-07-26 05:22:28409// . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is
410// either enabled, disabled, or uses the default value of the associated
411// base::Feature instance. To specify this type of entry use the macro
412// FEATURE_VALUE_TYPE supplying it the base::Feature instance.
413// . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a
414// base::Feature instance. Choices corresponding to the default state, a
415// universally enabled state, and a universally disabled state are
416// automatically included. To specify this type of entry use the macro
417// FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and
418// the array of choices.
419//
sdefresne14900ee2015-11-27 14:43:21420// See the documentation of FeatureEntry for details on the fields.
421//
422// When adding a new choice, add it to the end of the list.
423const flags_ui::FeatureEntry kFeatureEntries[] = {
Cooper Knaak1e026562017-07-26 05:22:28424 {"in-product-help-demo-mode-choice",
425 flag_descriptions::kInProductHelpDemoModeName,
426 flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos,
427 FEATURE_WITH_PARAMS_VALUE_TYPE(
Tommy Nyquistc1d6dea12017-07-26 20:37:23428 feature_engagement::kIPHDemoMode,
429 feature_engagement::kIPHDemoModeChoiceVariations,
Marc Treib2752e8b2017-08-04 14:12:09430 "IPH_DemoMode")},
Moe Ahmadic3fd7cd2018-05-11 21:40:22431 {"enable-autofill-credit-card-upload",
432 flag_descriptions::kAutofillCreditCardUploadName,
433 flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos,
Anne Lim579b5732018-08-30 18:24:24434 FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)},
Tina Wang41d431c2021-06-21 21:04:13435 {"enable-discover-feed-preview",
436 flag_descriptions::kEnableDiscoverFeedPreviewName,
437 flag_descriptions::kEnableDiscoverFeedPreviewDescription, flags_ui::kOsIos,
438 FEATURE_VALUE_TYPE(kEnableDiscoverFeedPreview)},
Moe Ahmadid6d5d172018-06-20 17:20:23439 {"use-sync-sandbox", flag_descriptions::kSyncSandboxName,
440 flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos,
441 SINGLE_VALUE_TYPE_AND_VALUE(
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51442 syncer::kSyncServiceURL,
Moe Ahmadid6d5d172018-06-20 17:20:23443 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")},
444 {"wallet-service-use-sandbox",
445 flag_descriptions::kWalletServiceUseSandboxName,
446 flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos,
447 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
448 autofill::switches::kWalletServiceUseSandbox,
449 "1",
450 autofill::switches::kWalletServiceUseSandbox,
451 "0")},
Mohamad Ahmadic4df81f2017-12-20 04:41:59452 {"show-autofill-type-predictions",
453 flag_descriptions::kShowAutofillTypePredictionsName,
454 flag_descriptions::kShowAutofillTypePredictionsDescription,
455 flags_ui::kOsIos,
Gauthier Ambardcfd85182018-01-05 10:37:46456 FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)},
Olivier Robin3d60411622018-02-23 10:03:22457 {"autofill-ios-delay-between-fields",
458 flag_descriptions::kAutofillIOSDelayBetweenFieldsName,
459 flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription,
460 flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)},
Kurt Horimotodc33af32018-05-01 01:39:14461 {"fullscreen-viewport-adjustment-experiment",
Chris Lu481a9322019-09-25 22:16:53462 flag_descriptions::kFullscreenSmoothScrollingName,
463 flag_descriptions::kFullscreenSmoothScrollingDescription, flags_ui::kOsIos,
464 FEATURE_VALUE_TYPE(fullscreen::features::kSmoothScrollingDefault)},
Robbie Gibson1f37a5e2020-08-06 17:03:06465 {"webpage-default-zoom-from-dynamic-type",
466 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeName,
467 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeDescription,
468 flags_ui::kOsIos,
469 FEATURE_VALUE_TYPE(web::kWebPageDefaultZoomFromDynamicType)},
Robbie Gibson88f23962020-09-28 14:35:56470 {"webpage-alternative-text-zoom",
471 flag_descriptions::kWebPageAlternativeTextZoomName,
472 flag_descriptions::kWebPageAlternativeTextZoomDescription,
473 flags_ui::kOsIos, FEATURE_VALUE_TYPE(web::kWebPageAlternativeTextZoom)},
Robbie Gibson1095b72c2022-06-06 17:03:34474 {"webpage-text-zoom-ipad", flag_descriptions::kWebPageTextZoomIPadName,
475 flag_descriptions::kWebPageTextZoomIPadDescription, flags_ui::kOsIos,
476 FEATURE_VALUE_TYPE(web::kWebPageTextZoomIPad)},
Kurt Horimoto79d590b2018-09-12 19:09:28477 {"toolbar-container", flag_descriptions::kToolbarContainerName,
478 flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos,
479 FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)},
Stepan Khapugincc4e9842019-01-23 13:38:13480 {"omnibox-ui-max-autocomplete-matches",
481 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName,
482 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription,
483 flags_ui::kOsIos,
484 FEATURE_WITH_PARAMS_VALUE_TYPE(
485 omnibox::kUIExperimentMaxAutocompleteMatches,
486 kOmniboxUIMaxAutocompleteMatchesVariations,
487 "OmniboxUIMaxAutocompleteVariations")},
Stepan Khapuginbac467e2022-05-06 21:11:54488 {"omnibox-max-zps-matches", flag_descriptions::kOmniboxMaxZPSMatchesName,
489 flag_descriptions::kOmniboxMaxZPSMatchesDescription, flags_ui::kOsIos,
490 FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kMaxZeroSuggestMatches,
491 kOmniboxMaxZPSMatchesVariations,
492 "OmniboxMaxZPSVariations")},
Robbie Gibson84f1ddc2020-12-10 21:41:28493 {"omnibox-local-history-zero-suggest",
494 flag_descriptions::kOmniboxLocalHistoryZeroSuggestName,
495 flag_descriptions::kOmniboxLocalHistoryZeroSuggestDescription,
496 flags_ui::kOsIos, FEATURE_VALUE_TYPE(omnibox::kLocalHistoryZeroSuggest)},
Justin Cohen20b6f072019-01-16 01:38:50497#if defined(DCHECK_IS_CONFIGURABLE)
498 {"dcheck-is-fatal", flag_descriptions::kDcheckIsFatalName,
499 flag_descriptions::kDcheckIsFatalDescription, flags_ui::kOsIos,
500 FEATURE_VALUE_TYPE(base::kDCheckIsFatalFeature)},
501#endif // defined(DCHECK_IS_CONFIGURABLE)
Caitlin Fischer43edd90a2019-05-01 13:24:30502 {"autofill-use-mobile-label-disambiguation",
503 flag_descriptions::kAutofillUseMobileLabelDisambiguationName,
504 flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription,
505 flags_ui::kOsIos,
Caitlin Fischer37e01232019-05-24 13:05:45506 FEATURE_WITH_PARAMS_VALUE_TYPE(
507 autofill::features::kAutofillUseMobileLabelDisambiguation,
508 kAutofillUseMobileLabelDisambiguationVariations,
509 "AutofillUseMobileLabelDisambiguation")},
Olivier Robin43814bb2021-06-22 15:25:45510 {"metrickit-crash-reports", flag_descriptions::kMetrickitCrashReportName,
511 flag_descriptions::kMetrickitCrashReportDescription, flags_ui::kOsIos,
512 FEATURE_VALUE_TYPE(kMetrickitCrashReport)},
Mike Doughertyb6c770d2019-09-13 22:56:46513 {"ios-breadcrumbs", flag_descriptions::kLogBreadcrumbsName,
514 flag_descriptions::kLogBreadcrumbsDescription, flags_ui::kOsIos,
Jesse McKenna85c1a59f2021-05-05 19:08:30515 FEATURE_VALUE_TYPE(breadcrumbs::kLogBreadcrumbs)},
Eugene But2823dc7e2020-07-21 18:10:37516 {"ios-synthetic-crash-reports",
517 flag_descriptions::kSyntheticCrashReportsForUteName,
518 flag_descriptions::kSyntheticCrashReportsForUteDescription,
519 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSyntheticCrashReportsForUte)},
Jérôme Lebelc374fdd2019-09-27 10:36:48520 {"force-startup-signin-promo",
521 flag_descriptions::kForceStartupSigninPromoName,
522 flag_descriptions::kForceStartupSigninPromoDescription, flags_ui::kOsIos,
Alice Wang345e09442021-07-05 09:03:29523 FEATURE_VALUE_TYPE(switches::kForceStartupSigninPromo)},
Yoichi Osato7ae11752021-03-16 03:27:22524 {"restore-session-from-cache",
525 flag_descriptions::kRestoreSessionFromCacheName,
526 flag_descriptions::kRestoreSessionFromCacheDescription, flags_ui::kOsIos,
Justin Cohen3ec2522c2021-04-23 18:23:49527 FEATURE_VALUE_TYPE(web::kRestoreSessionFromCache)},
sczs4622e6e2019-11-06 01:17:59528 {"autofill-save-card-dismiss-on-navigation",
529 flag_descriptions::kAutofillSaveCardDismissOnNavigationName,
530 flag_descriptions::kAutofillSaveCardDismissOnNavigationDescription,
531 flags_ui::kOsIos,
532 FEATURE_VALUE_TYPE(
533 autofill::features::kAutofillSaveCardDismissOnNavigation)},
sczs37d9c132020-07-18 06:06:33534 {"new-content-suggestions-feed", flag_descriptions::kDiscoverFeedInNtpName,
adamta22a4d502020-05-21 03:12:21535 flag_descriptions::kDiscoverFeedInNtpDescription, flags_ui::kOsIos,
gogeralddb0d8ae2020-11-13 03:56:58536 FEATURE_WITH_PARAMS_VALUE_TYPE(kDiscoverFeedInNtp,
537 kDiscoverFeedInNtpVariations,
538 "IOSDiscoverFeed")},
Roberto Mourab87b9722020-06-17 17:12:09539 {"expanded-tab-strip", flag_descriptions::kExpandedTabStripName,
540 flag_descriptions::kExpandedTabStripDescription, flags_ui::kOsIos,
541 FEATURE_VALUE_TYPE(kExpandedTabStrip)},
Tommy Martino6b4eb7e2020-06-25 18:25:41542 {"shared-highlighting-ios", flag_descriptions::kSharedHighlightingIOSName,
543 flag_descriptions::kSharedHighlightingIOSDescription, flags_ui::kOsIos,
544 FEATURE_VALUE_TYPE(kSharedHighlightingIOS)},
Veronique Nguyen6593c762021-11-30 17:28:56545 {"enable-fre-ui-module-ios-with-options",
546 flag_descriptions::kEnableFREUIModuleIOSName,
Tina Wanga252ca42021-04-01 17:14:23547 flag_descriptions::kEnableFREUIModuleIOSDescription, flags_ui::kOsIos,
ginnnnnnny429b5522022-05-05 03:50:06548 FEATURE_VALUE_TYPE(kEnableFREUIModuleIOS)},
jlebel041fc1c2022-03-04 12:53:30549 {"new-mobile-identity-consistency-fre",
550 flag_descriptions::kNewMobileIdentityConsistencyFREName,
551 flag_descriptions::kNewMobileIdentityConsistencyFREDescription,
552 flags_ui::kOsIos,
553 FEATURE_WITH_PARAMS_VALUE_TYPE(signin::kNewMobileIdentityConsistencyFRE,
554 kNewMobileIdentityConsistencyFREVariations,
ginnnnnnny46435132022-06-01 16:06:04555 kIOSMICeAndDefaultBrowserTrialName)},
Sylvain Defresne9c107082020-10-27 16:39:13556#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
edchin81467b82020-09-03 19:31:45557 {"screen-time-integration-ios",
558 flag_descriptions::kScreenTimeIntegrationName,
559 flag_descriptions::kScreenTimeIntegrationDescription, flags_ui::kOsIos,
560 FEATURE_VALUE_TYPE(kScreenTimeIntegration)},
Sylvain Defresne9c107082020-10-27 16:39:13561#endif
Nazerke3e993f72020-09-21 13:00:06562 {"modern-tab-strip", flag_descriptions::kModernTabStripName,
563 flag_descriptions::kModernTabStripDescription, flags_ui::kOsIos,
564 FEATURE_VALUE_TYPE(kModernTabStrip)},
Nohemi Fernandez222d6d42020-09-30 20:35:57565 {"minutes-delay-to-restore-gaia-cookies-if-deleted",
566 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieName,
567 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieDescription,
568 flags_ui::kOsIos,
569 MULTI_VALUE_TYPE(kDelayThresholdMinutesToUpdateGaiaCookieChoices)},
Vidhan Jainb4de5c52021-08-30 17:08:02570 {"add-passwords-in-settings",
571 flag_descriptions::kAddPasswordsInSettingsName,
572 flag_descriptions::kAddPasswordsInSettingsDescription, flags_ui::kOsIos,
573 FEATURE_VALUE_TYPE(
574 password_manager::features::kSupportForAddPasswordsInSettings)},
Eugene Butf869bff2020-12-10 01:16:55575 {"record-snapshot-size", flag_descriptions::kRecordSnapshotSizeName,
576 flag_descriptions::kRecordSnapshotSizeDescription, flags_ui::kOsIos,
577 FEATURE_VALUE_TYPE(web::features::kRecordSnapshotSize)},
Chris Lub17195f2020-12-10 20:49:14578 {"default-browser-fullscreen-promo-experiment",
579 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentName,
580 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentDescription,
581 flags_ui::kOsIos,
Javier Ernesto Flores Robles159414232021-06-16 14:29:59582 FEATURE_WITH_PARAMS_VALUE_TYPE(
583 kDefaultBrowserFullscreenPromoExperiment,
584 kDefaultBrowserFullscreenPromoExperimentVariations,
585 "IOSDefaultBrowserFullscreenPromoExperiment")},
Cheick Cisse76ade3d2020-12-16 00:15:11586 {"ios-shared-highlighting-color-change",
587 flag_descriptions::kIOSSharedHighlightingColorChangeName,
588 flag_descriptions::kIOSSharedHighlightingColorChangeDescription,
Cheick Cissed0b5bfe2021-02-11 14:23:07589 flags_ui::kOsIos,
590 FEATURE_VALUE_TYPE(web::features::kIOSSharedHighlightingColorChange)},
Cheick Cissefe994862021-12-15 16:01:34591 {"ios-shared-highlighting-v2",
592 flag_descriptions::kIOSSharedHighlightingV2Name,
593 flag_descriptions::kIOSSharedHighlightingV2Description, flags_ui::kOsIos,
594 FEATURE_VALUE_TYPE(shared_highlighting::kIOSSharedHighlightingV2)},
Stepan Khapugin04341202021-01-07 12:22:45595 {"omnibox-new-textfield-implementation",
596 flag_descriptions::kOmniboxNewImplementationName,
597 flag_descriptions::kOmniboxNewImplementationDescription, flags_ui::kOsIos,
598 FEATURE_VALUE_TYPE(kIOSNewOmniboxImplementation)},
Stepan Khapugin422f08d2022-02-18 16:19:44599 {"omnibox-new-popup-ui", flag_descriptions::kIOSOmniboxUpdatedPopupUIName,
600 flag_descriptions::kIOSOmniboxUpdatedPopupUIDescription, flags_ui::kOsIos,
Robbie Gibson46351032022-03-31 19:46:23601 FEATURE_WITH_PARAMS_VALUE_TYPE(kIOSOmniboxUpdatedPopupUI,
602 kiOSOmniboxUpdatedPopupUIVariations,
Stepan Khapugina45baed2022-05-13 19:15:43603 "IOSOmniboxUpdatedPopupUI")},
gogerald0ff29e52021-02-03 18:56:19604 {"start-surface", flag_descriptions::kStartSurfaceName,
605 flag_descriptions::kStartSurfaceDescription, flags_ui::kOsIos,
gogerald0e39e3aa2021-02-10 18:41:23606 FEATURE_WITH_PARAMS_VALUE_TYPE(kStartSurface,
607 kStartSurfaceVariations,
608 "StartSurface")},
Justin Cohen13ac7a202021-02-04 18:27:28609 {"ios-crashpad", flag_descriptions::kCrashpadIOSName,
610 flag_descriptions::kCrashpadIOSDescription, flags_ui::kOsIos,
611 FEATURE_VALUE_TYPE(kCrashpadIOS)},
Vidhan Jain451b4752021-07-15 10:16:42612 {"autofill-address-verification-in-save-prompt",
613 flag_descriptions::kEnableAutofillAddressSavePromptAddressVerificationName,
614 flag_descriptions::
615 kEnableAutofillAddressSavePromptAddressVerificationDescription,
616 flags_ui::kOsIos,
617 FEATURE_VALUE_TYPE(
618 autofill::features::
619 kAutofillAddressProfileSavePromptAddressVerificationSupport)},
Vidhan Jaina65741552021-03-09 17:18:27620 {"autofill-address-save-prompt",
621 flag_descriptions::kEnableAutofillAddressSavePromptName,
622 flag_descriptions::kEnableAutofillAddressSavePromptDescription,
623 flags_ui::kOsIos,
624 FEATURE_VALUE_TYPE(autofill::features::kAutofillAddressProfileSavePrompt)},
Viktor Semeniuk68e794a2021-03-24 10:23:25625 {"filling-across-affiliated-websites",
626 flag_descriptions::kFillingAcrossAffiliatedWebsitesName,
627 flag_descriptions::kFillingAcrossAffiliatedWebsitesDescription,
628 flags_ui::kOsIos,
629 FEATURE_VALUE_TYPE(
630 password_manager::features::kFillingAcrossAffiliatedWebsites)},
Jared Sauld47c2b72021-03-25 22:47:31631 {"autofill-parse-merchant-promo-code-fields",
632 flag_descriptions::kAutofillParseMerchantPromoCodeFieldsName,
633 flag_descriptions::kAutofillParseMerchantPromoCodeFieldsDescription,
634 flags_ui::kOsIos,
635 FEATURE_VALUE_TYPE(
636 autofill::features::kAutofillParseMerchantPromoCodeFields)},
edchin257cea2f2021-04-07 13:07:13637 {"interest-feed-v2-clicks-and-views-cond-upload",
638 flag_descriptions::kInterestFeedV2ClickAndViewActionsConditionalUploadName,
639 flag_descriptions::
640 kInterestFeedV2ClickAndViewActionsConditionalUploadDescription,
641 flags_ui::kOsIos,
642 FEATURE_VALUE_TYPE(feed::kInterestFeedV2ClicksAndViewsConditionalUpload)},
Mohammad Refaat76b14f542021-10-27 14:46:55643 {"tabs-search-ios", flag_descriptions::kTabsSearchName,
644 flag_descriptions::kTabsSearchDescription, flags_ui::kOsIos,
645 FEATURE_VALUE_TYPE(kTabsSearch)},
Mohammad Refaat95410082022-02-23 02:01:02646 {"tabs-search-regular-results-suggested-actions-ios",
647 flag_descriptions::kTabsSearchRegularResultsSuggestedActionsName,
648 flag_descriptions::kTabsSearchRegularResultsSuggestedActionsDescription,
649 flags_ui::kOsIos,
650 FEATURE_VALUE_TYPE(kTabsSearchRegularResultsSuggestedActions)},
Side Yilmaz0e6c15a2021-04-26 12:55:09651 {"incognito-brand-consistency-for-ios",
652 flag_descriptions::kIncognitoBrandConsistencyForIOSName,
653 flag_descriptions::kIncognitoBrandConsistencyForIOSDescription,
654 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kIncognitoBrandConsistencyForIOS)},
Side Yilmaz6c53f7102021-09-07 13:26:19655 {"incognito-ntp-revamp", flag_descriptions::kIncognitoNtpRevampName,
656 flag_descriptions::kIncognitoNtpRevampDescription, flags_ui::kOsIos,
657 FEATURE_VALUE_TYPE(kIncognitoNtpRevamp)},
Side YILMAZ4b40a3082022-04-11 10:13:33658 {"update-history-entry-points-in-incognito",
659 flag_descriptions::kUpdateHistoryEntryPointsInIncognitoName,
660 flag_descriptions::kUpdateHistoryEntryPointsInIncognitoDescription,
661 flags_ui::kOsIos,
662 FEATURE_VALUE_TYPE(kUpdateHistoryEntryPointsInIncognito)},
jlebeld95434d652021-06-22 10:32:48663 {"sync-trusted-vault-passphrase-ios-rpc",
664 flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCName,
665 flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCDescription,
666 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51667 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseiOSRPC)},
Mikel Astiz850b0fe2021-06-16 09:47:27668 {"sync-trusted-vault-passphrase-promo",
669 flag_descriptions::kSyncTrustedVaultPassphrasePromoName,
670 flag_descriptions::kSyncTrustedVaultPassphrasePromoDescription,
671 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51672 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphrasePromo)},
Mikel Astiz850b0fe2021-06-16 09:47:27673 {"sync-trusted-vault-passphrase-recovery",
674 flag_descriptions::kSyncTrustedVaultPassphraseRecoveryName,
675 flag_descriptions::kSyncTrustedVaultPassphraseRecoveryDescription,
676 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51677 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseRecovery)},
Nohemi Fernandezc00842a2021-07-26 11:47:34678 {"wait-threshold-seconds-for-capabilities-api",
679 flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiName,
680 flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiDescription,
681 flags_ui::kOsIos,
682 MULTI_VALUE_TYPE(kWaitThresholdMillisecondsForCapabilitiesApiChoices)},
Jared Saul2188f762021-08-02 21:22:23683 {"autofill-fill-merchant-promo-code-fields",
684 flag_descriptions::kAutofillFillMerchantPromoCodeFieldsName,
685 flag_descriptions::kAutofillFillMerchantPromoCodeFieldsDescription,
686 flags_ui::kOsIos,
687 FEATURE_VALUE_TYPE(
688 autofill::features::kAutofillFillMerchantPromoCodeFields)},
Gauthier Ambard14d3a262021-08-09 18:09:23689 {"default-wkwebview-context-menu",
690 flag_descriptions::kDefaultWebViewContextMenuName,
691 flag_descriptions::kDefaultWebViewContextMenuDescription, flags_ui::kOsIos,
692 FEATURE_VALUE_TYPE(web::features::kDefaultWebViewContextMenu)},
Sylvain Defresnedff67e42021-09-24 09:43:03693 {"new-overflow-menu", flag_descriptions::kNewOverflowMenuName,
694 flag_descriptions::kNewOverflowMenuDescription, flags_ui::kOsIos,
695 FEATURE_VALUE_TYPE(kNewOverflowMenu)},
Robbie Gibsonfe748e52022-05-09 18:20:46696 {"new-overflow-menu-settings-action",
697 flag_descriptions::kNewOverflowMenuSettingsActionName,
Robbie Gibsone2ad5632022-05-16 20:46:10698 flag_descriptions::kNewOverflowMenuSettingsActionDescription,
699 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kNewOverflowMenuSettingsAction)},
700 {"new-overflow-menu-simple-destination-icons",
701 flag_descriptions::kNewOverflowMenuSimpleDestinationIconsName,
702 flag_descriptions::kNewOverflowMenuSimpleDestinationIconsDescription,
703 flags_ui::kOsIos,
704 FEATURE_VALUE_TYPE(kNewOverflowMenuSimpleDestinationIcons)},
Robbie Gibson640bccb32022-05-10 18:43:35705 {"new-overflow-menu-cbd-action",
706 flag_descriptions::kNewOverflowMenuCBDActionName,
707 flag_descriptions::kNewOverflowMenuCBDActionDescription, flags_ui::kOsIos,
708 FEATURE_VALUE_TYPE(kNewOverflowMenuCBDAction)},
Sylvain Defresnedff67e42021-09-24 09:43:03709 {"enable-new-download-api", flag_descriptions::kEnableNewDownloadAPIName,
710 flag_descriptions::kEnableNewDownloadAPIDescription, flags_ui::kOsIos,
711 FEATURE_VALUE_TYPE(web::features::kEnableNewDownloadAPI)},
Evan Bernstein0a85f332021-09-29 19:07:24712 {"use-lens-to-search-for-image",
713 flag_descriptions::kUseLensToSearchForImageName,
714 flag_descriptions::kUseLensToSearchForImageDescription, flags_ui::kOsIos,
Ali Juma02a9b7b2021-10-01 13:44:44715 FEATURE_VALUE_TYPE(kUseLensToSearchForImage)},
Benjamin Williamsbee6ab62022-02-28 18:09:40716 {"use-load-simulated-request-for-error-page-navigation",
Gauthier Ambard33cceaf2022-05-05 14:00:23717 flag_descriptions::kUseLoadSimulatedRequestForOfflinePageName,
718 flag_descriptions::kUseLoadSimulatedRequestForOfflinePageDescription,
Benjamin Williamsbee6ab62022-02-28 18:09:40719 flags_ui::kOsIos,
Gauthier Ambard33cceaf2022-05-05 14:00:23720 FEATURE_VALUE_TYPE(web::features::kUseLoadSimulatedRequestForOfflinePage)},
Sergio Collazos9fcc6ed2021-10-06 00:58:03721 {"enable-discover-feed-static-resource-serving",
722 flag_descriptions::kEnableDiscoverFeedStaticResourceServingName,
723 flag_descriptions::kEnableDiscoverFeedStaticResourceServingDescription,
724 flags_ui::kOsIos,
725 FEATURE_WITH_PARAMS_VALUE_TYPE(
726 kEnableDiscoverFeedStaticResourceServing,
727 kEnableDiscoverFeedStaticResourceServingVariations,
728 "IOSDiscoverFeedStaticResourceServing")},
729 {"enable-disco-feed-endpoint",
730 flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointName,
731 flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointDescription,
732 flags_ui::kOsIos,
Aliona DANGLA8fae66f02021-10-06 15:47:11733 FEATURE_VALUE_TYPE(kEnableDiscoverFeedDiscoFeedEndpoint)},
Mohammad Refaatab6bee62022-05-16 16:31:15734 {"enable-discover-feed-top-sync-promo",
735 flag_descriptions::kEnableDiscoverFeedTopSyncPromoName,
736 flag_descriptions::kEnableDiscoverFeedTopSyncPromoDescription,
737 flags_ui::kOsIos,
738 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableDiscoverFeedTopSyncPromo,
739 kDiscoverFeedTopSyncPromoVariations,
740 "EnableDiscoverFeedTopSyncPromo")},
Aliona DANGLA8fae66f02021-10-06 15:47:11741 {"enable-fre-default-browser-screen-testing",
ginnnnnnny46435132022-06-01 16:06:04742 flag_descriptions::kEnableFREDefaultBrowserPromoScreenName,
743 flag_descriptions::kEnableFREDefaultBrowserPromoScreenDescription,
Aliona DANGLA8fae66f02021-10-06 15:47:11744 flags_ui::kOsIos,
ginnnnnnny46435132022-06-01 16:06:04745 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFREDefaultBrowserPromoScreen,
746 kFREDefaultBrowserPromoVariations,
747 kIOSMICeAndDefaultBrowserTrialName)},
edchin1313f2b2021-10-11 08:08:47748 {"enable-discover-feed-shorter-cache",
749 flag_descriptions::kEnableDiscoverFeedShorterCacheName,
750 flag_descriptions::kEnableDiscoverFeedShorterCacheDescription,
751 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableDiscoverFeedShorterCache)},
Tommy Martino7393d762021-10-12 17:59:28752 {"shared-highlighting-amp",
753 flag_descriptions::kIOSSharedHighlightingAmpName,
754 flag_descriptions::kIOSSharedHighlightingAmpDescription, flags_ui::kOsIos,
755 FEATURE_VALUE_TYPE(shared_highlighting::kSharedHighlightingAmp)},
David Maunderf4a5e1e2021-10-18 17:24:28756 {"enable-commerce-price-tracking",
Matt Jones125dfb42022-02-11 17:23:42757 commerce::flag_descriptions::kCommercePriceTrackingName,
758 commerce::flag_descriptions::kCommercePriceTrackingDescription,
759 flags_ui::kOsIos,
760 FEATURE_WITH_PARAMS_VALUE_TYPE(commerce::kCommercePriceTracking,
761 commerce::kCommercePriceTrackingVariations,
adamta67b6c5812021-10-19 17:02:15762 "CommercePriceTracking")},
Tina Wang8058d5f2021-11-04 20:06:06763 {"web-feed-ios", flag_descriptions::kEnableWebChannelsName,
764 flag_descriptions::kEnableWebChannelsDescription, flags_ui::kOsIos,
765 FEATURE_VALUE_TYPE(kEnableWebChannels)},
adamta39331592021-11-01 20:18:54766 {"ntp-view-hierarchy-repair",
767 flag_descriptions::kNTPViewHierarchyRepairName,
768 flag_descriptions::kNTPViewHierarchyRepairDescription, flags_ui::kOsIos,
769 FEATURE_VALUE_TYPE(kNTPViewHierarchyRepair)},
Chris Lu37588a92021-11-02 21:19:45770 {"single-ntp", flag_descriptions::kSingleNtpName,
771 flag_descriptions::kSingleNtpDescription, flags_ui::kOsIos,
772 FEATURE_VALUE_TYPE(kSingleNtp)},
Justin Cohen69cec682021-11-04 20:10:26773 {"synthesized-restore-session",
774 flag_descriptions::kSynthesizedRestoreSessionName,
775 flag_descriptions::kSynthesizedRestoreSessionDescription, flags_ui::kOsIos,
776 FEATURE_VALUE_TYPE(web::features::kSynthesizedRestoreSession)},
Chris Lu4723b822021-11-05 21:47:44777 {"remove-extra-ntps", flag_descriptions::kRemoveExcessNTPsExperimentName,
778 flag_descriptions::kRemoveExcessNTPsExperimentDescription,
Sylvain Defresne1619dd002021-11-06 10:09:48779 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kRemoveExcessNTPs)},
780 {"lazily-create-web-state-on-restoration",
781 flag_descriptions::kLazilyCreateWebStateOnRestorationName,
782 flag_descriptions::kLazilyCreateWebStateOnRestorationDescription,
783 flags_ui::kOsIos,
784 FEATURE_VALUE_TYPE(web::features::kEnableUnrealizedWebStates)},
ginny huang1f1755c2021-11-11 23:38:23785 {"enable-shortened-password-auto-fill-instruction",
786 flag_descriptions::kEnableShortenedPasswordAutoFillInstructionName,
787 flag_descriptions::kEnableShortenedPasswordAutoFillInstructionDescription,
788 flags_ui::kOsIos,
789 FEATURE_VALUE_TYPE(kEnableShortenedPasswordAutoFillInstruction)},
Benjamin Williams0e7e2fb2021-11-17 03:03:41790 {"enable-password-manager-branding-update",
791 flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateName,
792 flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateDescription,
793 flags_ui::kOsIos,
Aliona DANGLAe5b0b6e52021-11-30 11:58:19794 FEATURE_VALUE_TYPE(
795 password_manager::features::kIOSEnablePasswordManagerBrandingUpdate)},
Gauthier Ambard1d326e22021-12-16 10:57:53796 {"default-mode-ua", flag_descriptions::kAddSettingForDefaultPageModeName,
797 flag_descriptions::kAddSettingForDefaultPageModeDescription,
798 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kAddSettingForDefaultPageMode)},
ginnnnnnny1532d872021-12-20 15:57:37799 {"ios-media-permissions-control",
800 flag_descriptions::kMediaPermissionsControlName,
801 flag_descriptions::kMediaPermissionsControlDescription, flags_ui::kOsIos,
802 FEATURE_VALUE_TYPE(web::features::kMediaPermissionsControl)},
Olivier Robin3a957df2021-12-21 18:04:34803 {"enable-save-session-tabs-in-separate-files",
804 flag_descriptions::kSaveSessionTabsToSeparateFilesName,
805 flag_descriptions::kSaveSessionTabsToSeparateFilesDescription,
806 flags_ui::kOsIos,
807 FEATURE_VALUE_TYPE(sessions::kSaveSessionTabsToSeparateFiles)},
Ewann8c7aadc2022-05-19 15:41:05808 {"use-sf-symbols", flag_descriptions::kUseSFSymbolsName,
809 flag_descriptions::kUseSFSymbolsDescription, flags_ui::kOsIos,
810 FEATURE_VALUE_TYPE(kUseSFSymbols)},
Nohemi Fernandez76f54802022-01-10 18:23:32811 {"enable-unicorn-account-support",
812 flag_descriptions::kEnableUnicornAccountSupportName,
813 flag_descriptions::kEnableUnicornAccountSupportDescription,
814 flags_ui::kOsIos,
815 FEATURE_VALUE_TYPE(signin::kEnableUnicornAccountSupport)},
Chris Lu411bea82022-01-12 18:19:22816 {"single-cell-content-suggestions",
817 flag_descriptions::kSingleCellContentSuggestionsName,
818 flag_descriptions::kSingleCellContentSuggestionsDescription,
819 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSingleCellContentSuggestions)},
Chris Lue5211052022-02-02 20:44:04820 {"content-suggestions-header-migration",
821 flag_descriptions::kContentSuggestionsHeaderMigrationName,
822 flag_descriptions::kContentSuggestionsHeaderMigrationDescription,
823 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kContentSuggestionsHeaderMigration)},
rgod90cca8b2022-02-04 12:38:27824 {"leak-detection-unauthenticated",
825 flag_descriptions::kLeakDetectionUnauthenticatedName,
826 flag_descriptions::kLeakDetectionUnauthenticatedDescription,
827 flags_ui::kOsIos,
828 FEATURE_VALUE_TYPE(
829 password_manager::features::kLeakDetectionUnauthenticated)},
Veronique Nguyenfc9824b2022-02-10 17:12:53830 {"mute-compromised-passwords",
831 flag_descriptions::kMuteCompromisedPasswordsName,
832 flag_descriptions::kMuteCompromisedPasswordsDescription, flags_ui::kOsIos,
833 FEATURE_VALUE_TYPE(password_manager::features::kMuteCompromisedPasswords)},
Veronique Nguyen00ba26ea2022-02-25 14:57:17834 {"enable-favicon-passwords",
835 flag_descriptions::kEnableFaviconForPasswordsName,
836 flag_descriptions::kEnableFaviconForPasswordsDescription, flags_ui::kOsIos,
837 FEATURE_VALUE_TYPE(
838 password_manager::features::kEnableFaviconForPasswords)},
Shivani Chauhanbf97b0d2022-02-08 22:21:28839 {"autofill-enable-sending-bcn-in-get-upload-details",
840 flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsName,
841 flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsDescription,
842 flags_ui::kOsIos,
843 FEATURE_VALUE_TYPE(
844 autofill::features::kAutofillEnableSendingBcnInGetUploadDetails)},
Ali Juma1429cf8a2022-02-09 15:31:01845 {"enable-fullscreen-api", flag_descriptions::kEnableFullscreenAPIName,
846 flag_descriptions::kEnableFullscreenAPIDescription, flags_ui::kOsIos,
847 FEATURE_VALUE_TYPE(web::features::kEnableFullscreenAPI)},
Joemer Ramos34175732022-02-14 18:59:16848 {"enable-enhanced-safe-browsing",
849 flag_descriptions::kEnhancedProtectionName,
850 flag_descriptions::kEnhancedProtectionDescription, flags_ui::kOsIos,
851 FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtection)},
Joemer Ramos26e2b512022-05-24 17:26:41852 {"enable-enhanced-safe-browsing-phase-2",
853 flag_descriptions::kEnhancedProtectionPhase2Name,
854 flag_descriptions::kEnhancedProtectionPhase2Description, flags_ui::kOsIos,
855 FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtectionPhase2IOS)},
Shivani Chauhanaf1eb74d2022-02-11 21:13:19856 {"autofill-enable-unmask-card-request-set-instrument-id",
857 flag_descriptions::kAutofillEnableUnmaskCardRequestSetInstrumentIdName,
858 flag_descriptions::
859 kAutofillEnableUnmaskCardRequestSetInstrumentIdDescription,
860 flags_ui::kOsIos,
861 FEATURE_VALUE_TYPE(
862 autofill::features::kAutofillEnableUnmaskCardRequestSetInstrumentId)},
Victor Hugo Vianna Silvaf0a44002022-02-16 10:38:00863 {"send-tab-to-self-signin-promo",
864 flag_descriptions::kSendTabToSelfSigninPromoName,
865 flag_descriptions::kSendTabToSelfSigninPromoDescription, flags_ui::kOsIos,
866 FEATURE_VALUE_TYPE(send_tab_to_self::kSendTabToSelfSigninPromo)},
Chris Lu7f560f72022-03-01 18:19:01867 {"content-suggestions-uiviewcontroller-migration",
868 flag_descriptions::kContentSuggestionsUIViewControllerMigrationName,
869 flag_descriptions::kContentSuggestionsUIViewControllerMigrationDescription,
870 flags_ui::kOsIos,
871 FEATURE_VALUE_TYPE(kContentSuggestionsUIViewControllerMigration)},
Christian Xubd60c4b72022-03-22 15:25:01872 {"bubble-rich-iph", flag_descriptions::kBubbleRichIPHName,
873 flag_descriptions::kBubbleRichIPHDescription, flags_ui::kOsIos,
874 FEATURE_WITH_PARAMS_VALUE_TYPE(kBubbleRichIPH,
875 kBubbleRichIPHVariations,
876 "BubbleRichIPH")},
Siyu Anff02e742022-04-07 19:08:22877 {"autofill-enforce-delays-in-strike-database",
878 flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseName,
879 flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseDescription,
880 flags_ui::kOsIos,
881 FEATURE_VALUE_TYPE(
882 autofill::features::kAutofillEnforceDelaysInStrikeDatabase)},
Ewann4f260562022-04-11 13:37:19883 {"download-calendar", flag_descriptions::kDownloadCalendarName,
884 flag_descriptions::kDownloadCalendarDescription, flags_ui::kOsIos,
885 FEATURE_VALUE_TYPE(kDownloadCalendar)},
Louis Romerofbfbd932022-04-15 18:04:50886 {"uiview-window-observing", flag_descriptions::kUIViewWindowObservingName,
887 flag_descriptions::kUIViewWindowObservingDescription, flags_ui::kOsIos,
888 FEATURE_VALUE_TYPE(kUIViewWindowObserving)},
Jared Saulb0473bd2022-04-20 00:03:41889 {"autofill-upstream-allow-additional-email-domains",
890 flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsName,
891 flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsDescription,
892 flags_ui::kOsIos,
893 FEATURE_VALUE_TYPE(
894 autofill::features::kAutofillUpstreamAllowAdditionalEmailDomains)},
895 {"autofill-upstream-allow-all-email-domains",
896 flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsName,
897 flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsDescription,
898 flags_ui::kOsIos,
899 FEATURE_VALUE_TYPE(
900 autofill::features::kAutofillUpstreamAllowAllEmailDomains)},
Olivier Robinffe767c2022-04-21 13:13:23901 {"enable-tflite-language-detection",
902 flag_descriptions::kTFLiteLanguageDetectionName,
903 flag_descriptions::kTFLiteLanguageDetectionDescription, flags_ui::kOsIos,
904 FEATURE_VALUE_TYPE(translate::kTFLiteLanguageDetectionEnabled)},
905 {"optimization-guide-model-downloading",
906 flag_descriptions::kOptimizationGuideModelDownloadingName,
907 flag_descriptions::kOptimizationGuideModelDownloadingDescription,
908 flags_ui::kOsIos,
909 FEATURE_VALUE_TYPE(
910 optimization_guide::features::kOptimizationGuideModelDownloading)},
911 {"optimization-target-prediction",
912 flag_descriptions::kOptimizationTargetPredictionName,
913 flag_descriptions::kOptimizationTargetPredictionDescription,
914 flags_ui::kOsIos,
915 FEATURE_VALUE_TYPE(
916 optimization_guide::features::kOptimizationTargetPrediction)},
Rushan Suleymanov727309602022-04-28 20:08:54917 {"sync-standalone-invalidations", flag_descriptions::kSyncInvalidationsName,
918 flag_descriptions::kSyncInvalidationsDescription, flags_ui::kOsIos,
919 FEATURE_VALUE_TYPE(::syncer::kUseSyncInvalidations)},
920 {"sync-standalone-invalidations-wallet-and-offer",
921 flag_descriptions::kSyncInvalidationsWalletAndOfferName,
922 flag_descriptions::kSyncInvalidationsWalletAndOfferDescription,
923 flags_ui::kOsIos,
924 FEATURE_VALUE_TYPE(::syncer::kUseSyncInvalidationsForWalletAndOffer)},
Christian Xub8c06cd2022-04-29 20:55:01925 {"suggestions-scrolling-ipad",
926 flag_descriptions::kEnableSuggestionsScrollingOnIPadName,
927 flag_descriptions::kEnableSuggestionsScrollingOnIPadDescription,
928 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableSuggestionsScrollingOnIPad)},
Elmehdi Rahmaoui92f9a4a2022-06-09 18:18:36929 {"enable-expkit-apple-calendar",
930 flag_descriptions::kEnableExpKitAppleCalendarName,
931 flag_descriptions::kEnableExpKitAppleCalendarDescription, flags_ui::kOsIos,
932 FEATURE_VALUE_TYPE(kEnableExpKitAppleCalendar)},
David Jean7a8fa702022-05-02 15:21:22933 {"experience-kit-calendar", flag_descriptions::kCalendarExperienceKitName,
934 flag_descriptions::kCalendarExperienceKitDescription, flags_ui::kOsIos,
935 FEATURE_VALUE_TYPE(kCalendarExperienceKit)},
Mustafa Emre Acer4de8863a2022-05-03 22:17:01936 {"https-only-mode", flag_descriptions::kHttpsOnlyModeName,
937 flag_descriptions::kHttpsOnlyModeDescription, flags_ui::kOsIos,
938 FEATURE_VALUE_TYPE(security_interstitials::features::kHttpsOnlyMode)},
Benjamin Williams419c81e2022-05-04 18:33:22939 {"smart-sorting-new-overflow-menu",
940 flag_descriptions::kSmartSortingNewOverflowMenuName,
941 flag_descriptions::kSmartSortingNewOverflowMenuDescription,
942 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSmartSortingNewOverflowMenu)},
Alexander Tekled46a36982022-05-09 20:32:42943 {"autofill-enable-ranking-formula",
944 flag_descriptions::kAutofillEnableRankingFormulaName,
945 flag_descriptions::kAutofillEnableRankingFormulaDescription,
946 flags_ui::kOsIos,
947 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableRankingFormula)},
Siyu An4f658a92022-05-13 22:59:02948 {"autofill-remove-card-expiry-from-downstream-suggestion",
949 flag_descriptions::kAutofillRemoveCardExpiryFromDownstreamSuggestionName,
950 flag_descriptions::
951 kAutofillRemoveCardExpiryFromDownstreamSuggestionDescription,
952 flags_ui::kOsIos,
953 FEATURE_VALUE_TYPE(autofill::features::
954 kAutofillRemoveCardExpiryFromDownstreamSuggestion)},
Sergio Collazos58558712022-05-18 17:24:02955 {"enable-feed-ablation", flag_descriptions::kEnableFeedAblationName,
956 flag_descriptions::kEnableFeedAblationDescription, flags_ui::kOsIos,
957 FEATURE_VALUE_TYPE(kEnableFeedAblation)},
Chris Lu7f024ed2c2022-05-27 23:11:27958 {"content-suggestions-ui-module-refresh",
959 flag_descriptions::kContentSuggestionsUIModuleRefreshName,
960 flag_descriptions::kContentSuggestionsUIModuleRefreshDescription,
961 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kContentSuggestionsUIModuleRefresh)},
Quentin Pubertd7546ae2022-05-30 14:28:57962 {"3p-intents-in-incognito", flag_descriptions::kIOS3PIntentsInIncognitoName,
963 flag_descriptions::kIOS3PIntentsInIncognitoDescription, flags_ui::kOsIos,
964 FEATURE_VALUE_TYPE(kIOS3PIntentsInIncognito)},
Olivier Robin058c1fad2022-05-31 18:24:06965 {"default-browser-intents-show-settings",
966 flag_descriptions::kDefaultBrowserIntentsShowSettingsName,
967 flag_descriptions::kDefaultBrowserIntentsShowSettingsDescription,
968 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDefaultBrowserIntentsShowSettings)},
Ed Chin76b1b35e2022-06-08 23:01:17969 {"enable-discover-feed-ghost-cards",
970 flag_descriptions::kEnableDiscoverFeedGhostCardsName,
971 flag_descriptions::kEnableDiscoverFeedGhostCardsDescription,
972 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDiscoverFeedGhostCardsEnabled)},
Gauthier Ambard30ad9ca2022-06-09 14:15:26973 {"bookmark-string-menu", flag_descriptions::kBookmarkStringName,
974 flag_descriptions::kBookmarkStringDescription, flags_ui::kOsIos,
975 FEATURE_WITH_PARAMS_VALUE_TYPE(kBookmarkString,
976 kPopupMenuBookmarkStringVarations,
977 "BookmarkString")},
Igor Ruvinova43a66dc2022-06-09 21:57:45978 {"dm-token-deletion", flag_descriptions::kDmTokenDeletionName,
979 flag_descriptions::kDmTokenDeletionDescription, flags_ui::kOsIos,
Igor Ruvinov44fed9f2022-06-10 22:51:42980 FEATURE_WITH_PARAMS_VALUE_TYPE(policy::features::kDmTokenDeletion,
981 kDmTokenDeletionVariation,
982 "DmTokenDeletion")},
Sylvain Defresne1619dd002021-11-06 10:09:48983};
sdefresne14900ee2015-11-27 14:43:21984
Rohit Raobed794c2020-04-27 15:27:45985bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
986 return false;
987}
988
989flags_ui::FlagsState& GetGlobalFlagsState() {
990 static base::NoDestructor<flags_ui::FlagsState> flags_state(kFeatureEntries,
991 nullptr);
992 return *flags_state;
993}
David Jean5ca263c2021-08-18 09:19:30994// Creates the experimental test policies map, used by AsyncPolicyLoader and
995// PolicyLoaderIOS to locally enable policies.
Vincent Boisselleed0e6f1a2021-11-09 06:47:34996NSMutableDictionary* CreateExperimentalTestingPolicies() {
sdefresne14900ee2015-11-27 14:43:21997 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
998
Guillaume Jenkins25e9bd72020-08-27 17:39:06999 // Shared variables for all enterprise experimental flags.
Guillaume Jenkins57606d72020-08-13 17:32:551000 NSMutableDictionary* testing_policies = [[NSMutableDictionary alloc] init];
Guillaume Jenkins25e9bd72020-08-27 17:39:061001 NSMutableArray* allowed_experimental_policies = [[NSMutableArray alloc] init];
Guillaume Jenkins57606d72020-08-13 17:32:551002
Guillaume Jenkins25e9bd72020-08-27 17:39:061003 // Set some sample policy values for testing if EnableSamplePolicies is set to
1004 // true.
Guillaume Jenkinseeb7007c2020-06-25 22:55:401005 if ([defaults boolForKey:@"EnableSamplePolicies"]) {
Guillaume Jenkins57606d72020-08-13 17:32:551006 [testing_policies addEntriesFromDictionary:@{
Tina Wang59d0b7e2020-08-11 04:41:011007 base::SysUTF8ToNSString(policy::key::kAutofillAddressEnabled) : @NO,
1008
Guillaume Jenkinseeb7007c2020-06-25 22:55:401009 base::SysUTF8ToNSString(policy::key::kAutofillCreditCardEnabled) : @NO,
1010
1011 // 2 = Disable all variations
1012 base::SysUTF8ToNSString(policy::key::kChromeVariations) : @2,
1013
1014 // 2 = Do not allow any site to show popups
1015 base::SysUTF8ToNSString(policy::key::kDefaultPopupsSetting) : @2,
1016
Tina Wang5abee802020-07-29 23:09:521017 // Set default search engine.
1018 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderEnabled) :
1019 @YES,
1020 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderSearchURL) :
1021 @"http://www.google.com/search?q={searchTerms}",
1022 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderName) :
Tina Wang7cd0a062020-09-15 21:31:021023 @"TestEngine",
Tina Wang5abee802020-07-29 23:09:521024
Tina Wang89068c82020-10-29 15:51:501025 base::SysUTF8ToNSString(policy::key::kEditBookmarksEnabled) : @NO,
1026
Gauthier Ambard21b23702021-04-16 16:11:271027 base::SysUTF8ToNSString(policy::key::kNTPContentSuggestionsEnabled) : @NO,
1028
Guillaume Jenkinseeb7007c2020-06-25 22:55:401029 base::SysUTF8ToNSString(policy::key::kPasswordManagerEnabled) : @NO,
Tina Wang59d0b7e2020-08-11 04:41:011030
1031 base::SysUTF8ToNSString(policy::key::kTranslateEnabled) : @NO,
Tina Wang54dddfc22020-08-20 22:34:531032
1033 // 2 = Enhanced safe browsing protection
1034 base::SysUTF8ToNSString(policy::key::kSafeBrowsingProtectionLevel) : @2,
1035
1036 base::SysUTF8ToNSString(policy::key::kSearchSuggestEnabled) : @YES,
Guillaume Jenkins57606d72020-08-13 17:32:551037 }];
1038 }
1039
Ewann227a3c02021-04-19 12:04:541040 if ([defaults boolForKey:@"EnableSyncDisabledPolicy"]) {
Guillaume Jenkinsfe46d3a2021-04-26 19:51:041041 NSString* sync_policy_key =
1042 base::SysUTF8ToNSString(policy::key::kSyncDisabled);
David Jean5ca263c2021-08-18 09:19:301043 [testing_policies addEntriesFromDictionary:@{sync_policy_key : @YES}];
Ewann227a3c02021-04-19 12:04:541044 }
Ewann227a3c02021-04-19 12:04:541045
Ewann570a6302021-08-17 07:22:421046 // SyncTypesListDisabled policy.
1047 NSString* Sync_types_list_disabled_key =
1048 base::SysUTF8ToNSString(policy::key::kSyncTypesListDisabled);
1049 NSMutableArray* Sync_types_list_disabled_values =
1050 [[NSMutableArray alloc] init];
1051 if ([defaults boolForKey:@"SyncTypesListBookmarks"]) {
1052 [Sync_types_list_disabled_values addObject:@"bookmarks"];
1053 }
1054 if ([defaults boolForKey:@"SyncTypesListReadingList"]) {
1055 [Sync_types_list_disabled_values addObject:@"readingList"];
1056 }
1057 if ([defaults boolForKey:@"SyncTypesListPreferences"]) {
1058 [Sync_types_list_disabled_values addObject:@"preferences"];
1059 }
1060 if ([defaults boolForKey:@"SyncTypesListPasswords"]) {
1061 [Sync_types_list_disabled_values addObject:@"passwords"];
1062 }
1063 if ([defaults boolForKey:@"SyncTypesListAutofill"]) {
1064 [Sync_types_list_disabled_values addObject:@"autofill"];
1065 }
1066 if ([defaults boolForKey:@"SyncTypesListTypedUrls"]) {
1067 [Sync_types_list_disabled_values addObject:@"typedUrls"];
1068 }
1069 if ([defaults boolForKey:@"SyncTypesListTabs"]) {
1070 [Sync_types_list_disabled_values addObject:@"tabs"];
1071 }
1072 if ([Sync_types_list_disabled_values count]) {
1073 [testing_policies addEntriesFromDictionary:@{
1074 Sync_types_list_disabled_key : Sync_types_list_disabled_values
1075 }];
Ewann570a6302021-08-17 07:22:421076 }
1077
Gauthier Ambard073eaa92021-11-22 15:24:131078 // If an incognito mode availability is set, set the value.
Tina Wangc6bcf572021-01-27 18:15:521079 NSString* incognito_policy_key =
1080 base::SysUTF8ToNSString(policy::key::kIncognitoModeAvailability);
1081 NSInteger incognito_mode_availability =
1082 [defaults integerForKey:incognito_policy_key];
1083 if (incognito_mode_availability) {
Tina Wangc6bcf572021-01-27 18:15:521084 [testing_policies addEntriesFromDictionary:@{
1085 incognito_policy_key : @(incognito_mode_availability),
1086 }];
1087 }
1088
Ewann40a8f8a2021-07-29 10:01:201089 NSString* restriction_pattern =
1090 [defaults stringForKey:@"RestrictAccountsToPatterns"];
1091 if ([restriction_pattern length] > 0) {
Ewannb3bee382021-08-16 09:12:291092 NSString* restrict_key =
1093 base::SysUTF8ToNSString(policy::key::kRestrictAccountsToPatterns);
Ewann40a8f8a2021-07-29 10:01:201094 [testing_policies addEntriesFromDictionary:@{
Ewannb3bee382021-08-16 09:12:291095 restrict_key : @[ restriction_pattern ]
Ewann40a8f8a2021-07-29 10:01:201096 }];
1097 }
1098
Vincent Boisselle19200bc2021-09-01 17:58:251099 // If the sign-in policy is set (not "None"), add the policy key to the list
1100 // of enabled experimental policies, and set the value.
1101 NSString* const kSigninPolicyKey = @"BrowserSignin";
1102 NSInteger signin_policy_mode = [defaults integerForKey:kSigninPolicyKey];
1103 if (signin_policy_mode) {
1104 // Remove the mode offset that was used to represent the unset policy.
1105 --signin_policy_mode;
1106 DCHECK(signin_policy_mode >= 0);
1107
Vincent Boisselle19200bc2021-09-01 17:58:251108 [testing_policies addEntriesFromDictionary:@{
1109 kSigninPolicyKey : @(signin_policy_mode),
1110 }];
1111 }
1112
Veronique Nguyen9b1044f2022-01-11 14:41:131113 // If the New Tab Page URL is set (not empty) add the value to the list of
1114 // test policies.
1115 NSString* ntp_location = [defaults stringForKey:@"NTPLocation"];
1116 if ([ntp_location length] > 0) {
1117 NSString* ntp_location_key =
1118 base::SysUTF8ToNSString(policy::key::kNewTabPageLocation);
1119 [testing_policies
1120 addEntriesFromDictionary:@{ntp_location_key : ntp_location}];
Veronique Nguyen302d8702022-01-12 21:18:571121 [allowed_experimental_policies addObject:ntp_location_key];
Veronique Nguyen9b1044f2022-01-11 14:41:131122 }
1123
Ali Juma9ec36d22022-03-28 14:53:121124 if ([defaults boolForKey:@"DisallowChromeDataInBackups"]) {
1125 NSString* allow_backups_key =
1126 base::SysUTF8ToNSString(policy::key::kAllowChromeDataInBackups);
1127 [testing_policies addEntriesFromDictionary:@{allow_backups_key : @NO}];
1128 [allowed_experimental_policies addObject:allow_backups_key];
1129 }
1130
Guillaume Jenkins25e9bd72020-08-27 17:39:061131 // If any experimental policy was allowed, set the EnableExperimentalPolicies
1132 // policy.
1133 if ([allowed_experimental_policies count] > 0) {
1134 [testing_policies setValue:allowed_experimental_policies
1135 forKey:base::SysUTF8ToNSString(
1136 policy::key::kEnableExperimentalPolicies)];
1137 }
1138
jlebel2eb40222022-05-06 11:15:421139 NSString* metrics_reporting_key = @"MetricsReportingEnabled";
1140 switch ([defaults integerForKey:metrics_reporting_key]) {
1141 case 1:
1142 // Metrics reporting forced.
1143 [testing_policies setValue:@(YES) forKey:metrics_reporting_key];
1144 break;
1145 case 2:
1146 // Metrics reporting disabled.
1147 [testing_policies setValue:@(NO) forKey:metrics_reporting_key];
1148 break;
1149 default:
1150 // Metrics reporting not managed.
1151 break;
1152 }
1153
David Jean6f85d44f2021-08-19 08:08:451154 // Warning: Add new flags to TestingPoliciesHash() below.
1155
David Jean5ca263c2021-08-18 09:19:301156 return testing_policies;
1157}
David Jean6f85d44f2021-08-19 08:08:451158
1159// Generates a unique NSString based on currently monitored policies from
1160// NSUserDefaults standardUserDefaults.
1161NSString* TestingPoliciesHash() {
1162 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1163 return [NSString
jlebel2eb40222022-05-06 11:15:421164 stringWithFormat:@"%d|%d|%d|%d|%@|%d|%d|%d|%d|%d|%d|%d|%d|%@|%d",
Ali Juma9ec36d22022-03-28 14:53:121165 [defaults boolForKey:@"DisallowChromeDataInBackups"],
David Jean6f85d44f2021-08-19 08:08:451166 [defaults boolForKey:@"EnableSyncDisabledPolicy"],
1167 [defaults boolForKey:@"EnableSamplePolicies"],
jlebel2eb40222022-05-06 11:15:421168 static_cast<int>([defaults
1169 integerForKey:@"IncognitoModeAvailability"]),
David Jean6f85d44f2021-08-19 08:08:451170 [defaults stringForKey:@"RestrictAccountsToPatterns"],
1171 [defaults boolForKey:@"SyncTypesListBookmarks"],
1172 [defaults boolForKey:@"SyncTypesListReadingList"],
1173 [defaults boolForKey:@"SyncTypesListPreferences"],
1174 [defaults boolForKey:@"SyncTypesListPasswords"],
1175 [defaults boolForKey:@"SyncTypesListAutofill"],
1176 [defaults boolForKey:@"SyncTypesListTypedUrls"],
jlebel2eb40222022-05-06 11:15:421177 [defaults boolForKey:@"SyncTypesListTabs"],
1178 static_cast<int>(
1179 [defaults integerForKey:@"BrowserSignin"]),
1180 [defaults stringForKey:@"NTPLocation"],
1181 static_cast<int>([defaults
1182 integerForKey:@"MetricsReportingEnabled"])];
David Jean6f85d44f2021-08-19 08:08:451183}
David Jean5ca263c2021-08-18 09:19:301184} // namespace
1185
1186// Add all switches from experimental flags to |command_line|.
1187void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) {
1188 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1189
1190 // Set the UA flag if UseMobileSafariUA is enabled.
1191 if ([defaults boolForKey:@"UseMobileSafariUA"]) {
1192 // Safari uses "Vesion/", followed by the OS version excluding bugfix, where
1193 // Chrome puts its product token.
1194 int32_t major = 0;
1195 int32_t minor = 0;
1196 int32_t bugfix = 0;
1197 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix);
1198 std::string product = base::StringPrintf("Version/%d.%d", major, minor);
1199
1200 command_line->AppendSwitchASCII(switches::kUserAgent,
1201 web::BuildMobileUserAgent(product));
1202 }
1203
1204 // Shared variables for all enterprise experimental flags.
Vincent Boisselleed0e6f1a2021-11-09 06:47:341205 NSMutableDictionary* testing_policies = CreateExperimentalTestingPolicies();
David Jean5ca263c2021-08-18 09:19:301206
1207 // If a CBCM enrollment token is provided, force Chrome Browser Cloud
1208 // Management to enabled and add the token to the list of policies.
1209 NSString* token_key =
1210 base::SysUTF8ToNSString(policy::key::kCloudManagementEnrollmentToken);
1211 NSString* token = [defaults stringForKey:token_key];
1212
1213 if ([token length] > 0) {
1214 command_line->AppendSwitch(switches::kEnableChromeBrowserCloudManagement);
1215 [testing_policies setValue:token forKey:token_key];
1216 }
1217
Vincent Boisselled042d552022-04-09 01:22:591218 if ([defaults boolForKey:@"EnableUserPolicy"]) {
1219 policy::EnableUserPolicy();
1220 }
1221
Guillaume Jenkins57606d72020-08-13 17:32:551222 // If some policies were set, commit them to the app's registration defaults.
1223 if ([testing_policies count] > 0) {
Guillaume Jenkinseeb7007c2020-06-25 22:55:401224 NSDictionary* registration_defaults =
1225 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
1226 [defaults registerDefaults:registration_defaults];
1227 }
1228
sdefresne14900ee2015-11-27 14:43:211229 // Freeform commandline flags. These are added last, so that any flags added
1230 // earlier in this function take precedence.
1231 if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) {
1232 base::CommandLine::StringVector flags;
1233 // Append an empty "program" argument.
1234 flags.push_back("");
1235
1236 // The number of flags corresponds to the number of text fields in
1237 // Experimental.plist.
1238 const int kNumFreeformFlags = 5;
1239 for (int i = 1; i <= kNumFreeformFlags; ++i) {
1240 NSString* key =
1241 [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i];
1242 NSString* flag = [defaults stringForKey:key];
1243 if ([flag length]) {
Robbie Gibsonc91ce622019-05-20 14:44:331244 // iOS keyboard replaces -- with —, so undo that.
1245 flag = [flag stringByReplacingOccurrencesOfString:@"—"
1246 withString:@"--"
1247 options:0
1248 range:NSMakeRange(0, 1)];
1249 // To make things easier, allow flags with no dashes by prepending them
1250 // here. This also allows for flags that just have one dash if they
1251 // exist.
1252 if (![flag hasPrefix:@"-"]) {
1253 flag = [@"--" stringByAppendingString:flag];
1254 }
sdefresne14900ee2015-11-27 14:43:211255 flags.push_back(base::SysNSStringToUTF8(flag));
1256 }
1257 }
1258
1259 base::CommandLine temp_command_line(flags);
1260 command_line->AppendArguments(temp_command_line, false);
1261 }
msardafc76f662017-02-24 12:46:281262
justincohendacc85d2017-06-28 23:34:101263 // Populate command line flag for 3rd party keyboard omnibox workaround.
1264 NSString* enableThirdPartyKeyboardWorkaround =
1265 [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"];
1266 if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) {
1267 command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround);
1268 } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) {
1269 command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround);
1270 }
1271
Sylvain Defresned3cd8d92022-01-18 13:35:081272 ios::provider::AppendSwitchesFromExperimentalSettings(defaults, command_line);
sdefresne14900ee2015-11-27 14:43:211273}
1274
David Jean5ca263c2021-08-18 09:19:301275void MonitorExperimentalSettingsChanges() {
David Jean5ca263c2021-08-18 09:19:301276 // Startup values for settings to be observed.
David Jean6f85d44f2021-08-19 08:08:451277 __block NSString* hash = TestingPoliciesHash();
David Jeane83ed652021-08-25 14:52:481278 static std::atomic_bool pending_check(false);
David Jean5ca263c2021-08-18 09:19:301279
1280 auto monitor = ^(NSNotification* notification) {
David Jeane83ed652021-08-25 14:52:481281 bool has_pending_check = pending_check.exchange(true);
1282 if (has_pending_check)
1283 return;
1284
David Jeanbc0fae32021-08-25 10:31:391285 // Can be called from any thread from where the notification was sent,
1286 // but since it may change standardUserDefaults, and that has to be on main
1287 // thread, dispatch to main thread.
1288 dispatch_async(dispatch_get_main_queue(), ^{
1289 // Check if observed settings have changed. Since source and destination
1290 // are both user defaults, this is required to avoid cycling back here.
1291 NSString* newHash = TestingPoliciesHash();
1292 if (![newHash isEqualToString:hash]) {
1293 hash = newHash;
David Jean5ca263c2021-08-18 09:19:301294
David Jeanbc0fae32021-08-25 10:31:391295 // Publish update.
1296 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1297 NSMutableDictionary* testing_policies =
Vincent Boisselleed0e6f1a2021-11-09 06:47:341298 CreateExperimentalTestingPolicies();
David Jeanbc0fae32021-08-25 10:31:391299 NSDictionary* registration_defaults =
1300 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
1301 [defaults registerDefaults:registration_defaults];
1302 }
David Jeane83ed652021-08-25 14:52:481303
1304 pending_check.store(false);
David Jeanbc0fae32021-08-25 10:31:391305 });
David Jean5ca263c2021-08-18 09:19:301306 };
1307
1308 NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
1309 [center addObserverForName:NSUserDefaultsDidChangeNotification
1310 object:nil
David Jeanbc0fae32021-08-25 10:31:391311 queue:nil
David Jean5ca263c2021-08-18 09:19:301312 usingBlock:monitor];
1313}
1314
sdefresne14900ee2015-11-27 14:43:211315void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage,
1316 base::CommandLine* command_line) {
Sylvain Defresne8327a2f2019-01-17 14:19:181317 GetGlobalFlagsState().ConvertFlagsToSwitches(
sdefresnec9763902015-12-02 10:30:111318 flags_storage, command_line, flags_ui::kAddSentinels,
Gregory Chatzinofff6523722017-11-21 01:33:531319 switches::kEnableFeatures, switches::kDisableFeatures);
sdefresne14900ee2015-11-27 14:43:211320}
1321
jkrcalbf073372016-07-29 07:21:311322std::vector<std::string> RegisterAllFeatureVariationParameters(
1323 flags_ui::FlagsStorage* flags_storage,
1324 base::FeatureList* feature_list) {
Justin Cohen2e2adb52019-10-25 17:00:021325 // Occasionally DCHECK crashes on canary can be very distuptive. An
1326 // experimental flag was added to aid in temporarily disabling this for
1327 // canary testers.
1328#if defined(DCHECK_IS_CONFIGURABLE)
1329 if (experimental_flags::AreDCHECKCrashesDisabled()) {
1330 std::vector<base::FeatureList::FeatureOverrideInfo> overrides;
1331 overrides.push_back(
1332 {std::cref(base::kDCheckIsFatalFeature),
1333 base::FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE});
1334 feature_list->RegisterExtraFeatureOverrides(std::move(overrides));
1335 }
1336#endif // defined(DCHECK_IS_CONFIGURABLE)
1337
Sylvain Defresne8327a2f2019-01-17 14:19:181338 return GetGlobalFlagsState().RegisterAllFeatureVariationParameters(
1339 flags_storage, feature_list);
jkrcalbf073372016-07-29 07:21:311340}
1341
sdefresne14900ee2015-11-27 14:43:211342void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage,
1343 flags_ui::FlagAccess access,
Morten Stenshorne7afa5802021-07-15 10:04:431344 base::Value::ListStorage& supported_entries,
1345 base::Value::ListStorage& unsupported_entries) {
Sylvain Defresne8327a2f2019-01-17 14:19:181346 GetGlobalFlagsState().GetFlagFeatureEntries(
sdefresne14900ee2015-11-27 14:43:211347 flags_storage, access, supported_entries, unsupported_entries,
Renjie Tang208c8192020-11-03 00:46:511348 base::BindRepeating(&SkipConditionalFeatureEntry));
sdefresne14900ee2015-11-27 14:43:211349}
1350
1351void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage,
1352 const std::string& internal_name,
1353 bool enable) {
Sylvain Defresne8327a2f2019-01-17 14:19:181354 GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name,
1355 enable);
sdefresne14900ee2015-11-27 14:43:211356}
1357
1358void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) {
Sylvain Defresne8327a2f2019-01-17 14:19:181359 GetGlobalFlagsState().ResetAllFlags(flags_storage);
sdefresne14900ee2015-11-27 14:43:211360}
1361
1362namespace testing {
1363
Elly Fong-Jones323ab1092021-08-23 22:36:311364base::span<const flags_ui::FeatureEntry> GetFeatureEntries() {
1365 return base::span<const flags_ui::FeatureEntry>(kFeatureEntries,
Daniel Cheng1f047a82022-02-26 10:04:531366 std::size(kFeatureEntries));
sdefresne14900ee2015-11-27 14:43:211367}
1368
1369} // namespace testing