blob: 91270ea6efa2e84bdaee32cff72bed3fbbd5a6f7 [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 Boissellead6cbe22022-07-04 19:32:3967#import "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"
Ernesto Izquierdo Clua7f4e36e22022-07-01 09:38:3672#include "ios/chrome/browser/ui/autofill/features.h"
Louis Romeroac04f786a2022-04-19 09:39:3073#include "ios/chrome/browser/ui/bubble/bubble_features.h"
adamta22a4d502020-05-21 03:12:2174#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h"
Javier Ernesto Flores Robles209b2822021-03-25 19:16:5075#import "ios/chrome/browser/ui/default_promo/default_browser_utils.h"
Ewann1a9d33d2021-06-14 11:12:2476#import "ios/chrome/browser/ui/download/features.h"
Aliona DANGLAebfd7d022021-10-08 14:15:4577#include "ios/chrome/browser/ui/first_run/fre_field_trial.h"
Kurt Horimoto4da682b022018-04-12 07:43:3578#import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h"
adamta273568472020-12-04 23:53:5779#import "ios/chrome/browser/ui/ntp/new_tab_page_feature.h"
Christian Xub8c06cd2022-04-29 20:55:0180#import "ios/chrome/browser/ui/omnibox/omnibox_ui_features.h"
Robbie Gibson686c56732021-10-04 17:11:4581#import "ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.h"
Gauthier Ambard30ad9ca2022-06-09 14:15:2682#import "ios/chrome/browser/ui/popup_menu/public/features.h"
gogerald0ff29e52021-02-03 18:56:1983#import "ios/chrome/browser/ui/start_surface/start_surface_features.h"
Nazerke0bf10c42020-11-12 11:17:3284#import "ios/chrome/browser/ui/tab_switcher/tab_grid/features.h"
Kurt Horimoto79d590b2018-09-12 19:09:2885#import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h"
Justin Cohen2d81c582018-01-22 14:46:4486#include "ios/chrome/browser/ui/ui_feature_flags.h"
Louis Romerofbfbd932022-04-15 18:04:5087#include "ios/chrome/browser/ui/util/features.h"
Yi Su392b3032018-06-05 07:26:4788#include "ios/chrome/browser/web/features.h"
sdefresne14900ee2015-11-27 14:43:2189#include "ios/chrome/grit/ios_strings.h"
Mustafa Emre Acer4de8863a2022-05-03 22:17:0190#include "ios/components/security_interstitials/https_only_mode/feature.h"
Sylvain Defresne559ce5f2022-01-13 17:14:5891#include "ios/public/provider/chrome/browser/app_utils/app_utils_api.h"
Eugene But61818bc2019-04-15 21:04:0792#include "ios/web/common/features.h"
Eugene Bute79f2742019-07-26 17:07:2293#include "ios/web/common/user_agent.h"
Eugene Butb1416232019-07-22 17:31:5894#include "ios/web/common/web_view_creation_util.h"
sdefresne14900ee2015-11-27 14:43:2195
Sylvain Defresne9c107082020-10-27 16:39:1396#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
97#include "ios/chrome/browser/screen_time/features.h"
98#endif
99
sdefresne14900ee2015-11-27 14:43:21100#if !defined(OFFICIAL_BUILD)
101#include "components/variations/variations_switches.h"
vitaliii489217aa2017-01-30 14:50:22102#endif
stkhapuginc1be1792016-12-13 14:30:53103
104#if !defined(__has_feature) || !__has_feature(objc_arc)
105#error "This file requires ARC support."
106#endif
sdefresne14900ee2015-11-27 14:43:21107
elawrence816f6790e2017-06-16 18:19:28108using flags_ui::FeatureEntry;
109
sdefresne14900ee2015-11-27 14:43:21110namespace {
Emily Starkbafa9062017-12-27 15:22:46111
Olivier Robin3d60411622018-02-23 10:03:22112const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = {
113 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
114 {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"},
115 {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"},
116 {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"},
117 {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"},
118 {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"},
119 {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"},
120 {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"},
121 {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"},
122};
123
Nohemi Fernandez222d6d42020-09-30 20:35:57124const FeatureEntry::Choice kDelayThresholdMinutesToUpdateGaiaCookieChoices[] = {
125 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
126 {"0", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "0"},
127 {"10", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "10"},
128 {"60", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "60"},
129};
130
Nohemi Fernandezc00842a2021-07-26 11:47:34131const FeatureEntry::Choice
132 kWaitThresholdMillisecondsForCapabilitiesApiChoices[] = {
133 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
134 {"200", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "200"},
135 {"500", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "500"},
136 {"5000", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "5000"},
137};
138
Stepan Khapugincc4e9842019-01-23 13:38:13139const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = {
140 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}};
141const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = {
142 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}};
143const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = {
144 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}};
145const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = {
146 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}};
147const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = {
148 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}};
149const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = {
150 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}};
151const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = {
152 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}};
153
154const FeatureEntry::FeatureVariation
155 kOmniboxUIMaxAutocompleteMatchesVariations[] = {
156 {"3 matches", kOmniboxUIMaxAutocompleteMatches3,
Daniel Cheng1f047a82022-02-26 10:04:53157 std::size(kOmniboxUIMaxAutocompleteMatches3), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13158 {"4 matches", kOmniboxUIMaxAutocompleteMatches4,
Daniel Cheng1f047a82022-02-26 10:04:53159 std::size(kOmniboxUIMaxAutocompleteMatches4), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13160 {"5 matches", kOmniboxUIMaxAutocompleteMatches5,
Daniel Cheng1f047a82022-02-26 10:04:53161 std::size(kOmniboxUIMaxAutocompleteMatches5), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13162 {"6 matches", kOmniboxUIMaxAutocompleteMatches6,
Daniel Cheng1f047a82022-02-26 10:04:53163 std::size(kOmniboxUIMaxAutocompleteMatches6), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13164 {"8 matches", kOmniboxUIMaxAutocompleteMatches8,
Daniel Cheng1f047a82022-02-26 10:04:53165 std::size(kOmniboxUIMaxAutocompleteMatches8), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13166 {"10 matches", kOmniboxUIMaxAutocompleteMatches10,
Daniel Cheng1f047a82022-02-26 10:04:53167 std::size(kOmniboxUIMaxAutocompleteMatches10), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13168 {"12 matches", kOmniboxUIMaxAutocompleteMatches12,
Daniel Cheng1f047a82022-02-26 10:04:53169 std::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}};
Stepan Khapugincc4e9842019-01-23 13:38:13170
Stepan Khapuginbac467e2022-05-06 21:11:54171const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches6[] = {
172 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "6"}};
173const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches15[] = {
174 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "15"}};
175const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches20[] = {
176 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "20"}};
177
178const FeatureEntry::FeatureVariation kOmniboxMaxZPSMatchesVariations[] = {
179 {"6 matches", kOmniboxMaxZPSMatches6, std::size(kOmniboxMaxZPSMatches6),
180 nullptr},
181 {"15 matches", kOmniboxMaxZPSMatches15, std::size(kOmniboxMaxZPSMatches15),
182 nullptr},
183 {"20 matches", kOmniboxMaxZPSMatches20, std::size(kOmniboxMaxZPSMatches20),
184 nullptr},
185};
186
Caitlin Fischer37e01232019-05-24 13:05:45187const FeatureEntry::FeatureParam
188 kAutofillUseMobileLabelDisambiguationShowAll[] = {
189 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
190 autofill::features::
191 kAutofillUseMobileLabelDisambiguationParameterShowAll}};
192const FeatureEntry::FeatureParam
193 kAutofillUseMobileLabelDisambiguationShowOne[] = {
194 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
195 autofill::features::
196 kAutofillUseMobileLabelDisambiguationParameterShowOne}};
197
198const FeatureEntry::FeatureVariation
199 kAutofillUseMobileLabelDisambiguationVariations[] = {
200 {"(show all)", kAutofillUseMobileLabelDisambiguationShowAll,
Daniel Cheng1f047a82022-02-26 10:04:53201 std::size(kAutofillUseMobileLabelDisambiguationShowAll), nullptr},
Caitlin Fischer37e01232019-05-24 13:05:45202 {"(show one)", kAutofillUseMobileLabelDisambiguationShowOne,
Daniel Cheng1f047a82022-02-26 10:04:53203 std::size(kAutofillUseMobileLabelDisambiguationShowOne), nullptr}};
Caitlin Fischer37e01232019-05-24 13:05:45204
Javier Ernesto Flores Roblese85f4a12021-02-23 18:10:10205const FeatureEntry::FeatureParam
Javier Ernesto Flores Robles159414232021-06-16 14:29:59206 kDefaultBrowserFullscreenPromoExperimentRemindMeLater[] = {
207 {kDefaultBrowserFullscreenPromoExperimentRemindMeGroupParam, "true"}};
208const FeatureEntry::FeatureVariation
209 kDefaultBrowserFullscreenPromoExperimentVariations[] = {
210 {"Remind me later",
211 kDefaultBrowserFullscreenPromoExperimentRemindMeLater,
Daniel Cheng1f047a82022-02-26 10:04:53212 std::size(kDefaultBrowserFullscreenPromoExperimentRemindMeLater),
Javier Ernesto Flores Robles159414232021-06-16 14:29:59213 nullptr}};
214
gogeralddb0d8ae2020-11-13 03:56:58215const FeatureEntry::FeatureParam kDiscoverFeedInNtpEnableNativeUI[] = {
216 {kDiscoverFeedIsNativeUIEnabled, "true"}};
217const FeatureEntry::FeatureVariation kDiscoverFeedInNtpVariations[] = {
218 {"Native UI", kDiscoverFeedInNtpEnableNativeUI,
Daniel Cheng1f047a82022-02-26 10:04:53219 std::size(kDiscoverFeedInNtpEnableNativeUI), nullptr}};
gogeralddb0d8ae2020-11-13 03:56:58220
Sergio Collazos9fcc6ed2021-10-06 00:58:03221const FeatureEntry::FeatureParam kDiscoverFeedSRSReconstructedTemplates[] = {
222 {kDiscoverFeedSRSReconstructedTemplatesEnabled, "true"}};
223const FeatureEntry::FeatureParam kDiscoverFeedSRSPreloadTemplates[] = {
224 {kDiscoverFeedSRSPreloadTemplatesEnabled, "true"}};
225const FeatureEntry::FeatureVariation
226 kEnableDiscoverFeedStaticResourceServingVariations[] = {
227 {"Reconstruct Templates", kDiscoverFeedSRSReconstructedTemplates,
Daniel Cheng1f047a82022-02-26 10:04:53228 std::size(kDiscoverFeedSRSReconstructedTemplates), nullptr},
Sergio Collazos9fcc6ed2021-10-06 00:58:03229 {"Preload Templates", kDiscoverFeedSRSPreloadTemplates,
Daniel Cheng1f047a82022-02-26 10:04:53230 std::size(kDiscoverFeedSRSPreloadTemplates), nullptr},
Sergio Collazos9fcc6ed2021-10-06 00:58:03231};
232
Mohammad Refaatab6bee62022-05-16 16:31:15233const FeatureEntry::FeatureParam kDiscoverFeedTopSyncPromoFullWithTitle[] = {
234 {kDiscoverFeedTopSyncPromoStyleParam,
235 kDiscoverFeedTopSyncPromoStyleFullWithTitle}};
236const FeatureEntry::FeatureParam kDiscoverFeedTopSyncPromoCompact[] = {
237 {kDiscoverFeedTopSyncPromoStyleParam,
238 kDiscoverFeedTopSyncPromoStyleCompact}};
239const FeatureEntry::FeatureVariation kDiscoverFeedTopSyncPromoVariations[] = {
240 {"Full with title", kDiscoverFeedTopSyncPromoFullWithTitle,
241 std::size(kDiscoverFeedTopSyncPromoFullWithTitle), nullptr},
242 {"Compact", kDiscoverFeedTopSyncPromoCompact,
243 std::size(kDiscoverFeedTopSyncPromoCompact), nullptr}};
244
Robbie Gibson46351032022-03-31 19:46:23245const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion1[] = {
246 {kIOSOmniboxUpdatedPopupUIVariationName,
247 kIOSOmniboxUpdatedPopupUIVariation1}};
248const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion2[] = {
249 {kIOSOmniboxUpdatedPopupUIVariationName,
250 kIOSOmniboxUpdatedPopupUIVariation2}};
251const FeatureEntry::FeatureVariation kiOSOmniboxUpdatedPopupUIVariations[] = {
252 {"Version 1", kiOSOmniboxUpdatedPopupUIVersion1,
253 std::size(kiOSOmniboxUpdatedPopupUIVersion1), nullptr},
254 {"Version 2", kiOSOmniboxUpdatedPopupUIVersion2,
255 std::size(kiOSOmniboxUpdatedPopupUIVersion2), nullptr}};
256
gogerald53c6e7a2021-04-15 22:07:35257const FeatureEntry::FeatureParam kStartSurfaceTenSecondsShrinkLogo[] = {
Chris Lu5470417c2021-03-03 18:43:08258 {kStartSurfaceShrinkLogoParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35259 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
260const FeatureEntry::FeatureParam kStartSurfaceTenSecondsHideShortcuts[] = {
Chris Lu5470417c2021-03-03 18:43:08261 {kStartSurfaceHideShortcutsParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35262 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
263const FeatureEntry::FeatureParam kStartSurfaceTenSecondsReturnToRecentTab[] = {
Chris Lu5470417c2021-03-03 18:43:08264 {kStartSurfaceReturnToRecentTabParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35265 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
266const FeatureEntry::FeatureParam
267 kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab[] = {
268 {kStartSurfaceShrinkLogoParam, "true"},
269 {kStartSurfaceReturnToRecentTabParam, "true"},
270 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
271const FeatureEntry::FeatureParam
272 kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab[] = {
273 {kStartSurfaceHideShortcutsParam, "true"},
274 {kStartSurfaceReturnToRecentTabParam, "true"},
275 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
276const FeatureEntry::FeatureParam kStartSurfaceOneHourShrinkLogo[] = {
Chris Lu5470417c2021-03-03 18:43:08277 {kStartSurfaceShrinkLogoParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35278 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
279const FeatureEntry::FeatureParam kStartSurfaceOneHourHideShortcuts[] = {
280 {kStartSurfaceHideShortcutsParam, "true"},
281 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
282const FeatureEntry::FeatureParam kStartSurfaceOneHourReturnToRecentTab[] = {
Chris Lu5470417c2021-03-03 18:43:08283 {kStartSurfaceReturnToRecentTabParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35284 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
285const FeatureEntry::FeatureParam
286 kStartSurfaceOneHourShrinkLogoReturnToRecentTab[] = {
287 {kStartSurfaceShrinkLogoParam, "true"},
288 {kStartSurfaceReturnToRecentTabParam, "true"},
289 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
290const FeatureEntry::FeatureParam
291 kStartSurfaceOneHourHideShortcutsReturnToRecentTab[] = {
292 {kStartSurfaceHideShortcutsParam, "true"},
293 {kStartSurfaceReturnToRecentTabParam, "true"},
294 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
Chris Lu5470417c2021-03-03 18:43:08295
gogerald0e39e3aa2021-02-10 18:41:23296const FeatureEntry::FeatureVariation kStartSurfaceVariations[] = {
gogerald53c6e7a2021-04-15 22:07:35297 {"10s:Show Return to Recent Tab tile",
298 kStartSurfaceTenSecondsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53299 std::size(kStartSurfaceTenSecondsReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35300 {"10s:Shrink Logo", kStartSurfaceTenSecondsShrinkLogo,
Daniel Cheng1f047a82022-02-26 10:04:53301 std::size(kStartSurfaceTenSecondsShrinkLogo), nullptr},
gogerald53c6e7a2021-04-15 22:07:35302 {"10s:Hide Shortcuts", kStartSurfaceTenSecondsHideShortcuts,
Daniel Cheng1f047a82022-02-26 10:04:53303 std::size(kStartSurfaceTenSecondsHideShortcuts), nullptr},
gogerald53c6e7a2021-04-15 22:07:35304 {"10s:Shrink Logo and show Return to Recent Tab tile",
305 kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53306 std::size(kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35307 {"10s:Hide Shortcuts and show Return to Recent Tab tile",
308 kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53309 std::size(kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35310 {"1h:Show Return to Recent Tab tile", kStartSurfaceOneHourReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53311 std::size(kStartSurfaceOneHourReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35312 {"1h:Shrink Logo", kStartSurfaceOneHourShrinkLogo,
Daniel Cheng1f047a82022-02-26 10:04:53313 std::size(kStartSurfaceOneHourShrinkLogo), nullptr},
gogerald53c6e7a2021-04-15 22:07:35314 {"1h:Hide Shortcuts", kStartSurfaceOneHourHideShortcuts,
Daniel Cheng1f047a82022-02-26 10:04:53315 std::size(kStartSurfaceOneHourHideShortcuts), nullptr},
gogerald53c6e7a2021-04-15 22:07:35316 {"1h:Shrink Logo and show Return to Recent Tab tile",
317 kStartSurfaceOneHourShrinkLogoReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53318 std::size(kStartSurfaceOneHourShrinkLogoReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35319 {"1h:Hide Shortcuts and show Return to Recent Tab tile",
320 kStartSurfaceOneHourHideShortcutsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53321 std::size(kStartSurfaceOneHourHideShortcutsReturnToRecentTab), nullptr},
Chris Lu5470417c2021-03-03 18:43:08322};
gogerald0e39e3aa2021-02-10 18:41:23323
ginnnnnnny46435132022-06-01 16:06:04324const FeatureEntry::FeatureParam kFREDefaultBrowserPromoDefaultDelay[] = {
325 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoDefaultDelayParam}};
326const FeatureEntry::FeatureParam kFREDefaultBrowserPromoFirstRunOnly[] = {
327 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoFirstRunOnlyParam}};
328const FeatureEntry::FeatureParam kFREDefaultBrowserPromoShortDelay[] = {
329 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoShortDelayParam}};
330const FeatureEntry::FeatureVariation kFREDefaultBrowserPromoVariations[] = {
Aliona DANGLA8fae66f02021-10-06 15:47:11331 {"Wait 14 days after FRE default browser promo",
ginnnnnnny46435132022-06-01 16:06:04332 kFREDefaultBrowserPromoDefaultDelay,
333 std::size(kFREDefaultBrowserPromoDefaultDelay), nullptr},
334 {"FRE default browser promo only", kFREDefaultBrowserPromoFirstRunOnly,
335 std::size(kFREDefaultBrowserPromoFirstRunOnly), nullptr},
Aliona DANGLA8fae66f02021-10-06 15:47:11336 {"Wait 3 days after FRE default browser promo",
ginnnnnnny46435132022-06-01 16:06:04337 kFREDefaultBrowserPromoShortDelay,
338 std::size(kFREDefaultBrowserPromoShortDelay), nullptr},
Aliona DANGLA8fae66f02021-10-06 15:47:11339};
340
jlebel041fc1c2022-03-04 12:53:30341const FeatureEntry::FeatureParam kNewMICEFREWithUMADialog[] = {
342 {kNewMobileIdentityConsistencyFREParam,
343 kNewMobileIdentityConsistencyFREParamUMADialog}};
344const FeatureEntry::FeatureParam kNewMICEFREWithThreeSteps[] = {
345 {kNewMobileIdentityConsistencyFREParam,
346 kNewMobileIdentityConsistencyFREParamThreeSteps}};
347const FeatureEntry::FeatureParam kNewMICEFREWithTwoSteps[] = {
348 {kNewMobileIdentityConsistencyFREParam,
349 kNewMobileIdentityConsistencyFREParamTwoSteps}};
350const FeatureEntry::FeatureVariation
351 kNewMobileIdentityConsistencyFREVariations[] = {
352 {"New FRE with UMA dialog", kNewMICEFREWithUMADialog,
353 std::size(kNewMICEFREWithUMADialog), nullptr},
354 {"new FRE with 3 steps", kNewMICEFREWithThreeSteps,
355 std::size(kNewMICEFREWithThreeSteps), nullptr},
356 {"new FRE with 2 steps", kNewMICEFREWithTwoSteps,
357 std::size(kNewMICEFREWithTwoSteps), nullptr}};
358
Louis Romero023cc5052022-04-08 23:29:39359const FeatureEntry::FeatureParam kBubbleRichIPHTargetHighlight[] = {
360 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterTargetHighlight}};
Christian Xubd60c4b72022-03-22 15:25:01361const FeatureEntry::FeatureParam kBubbleRichIPHExplicitDismissal[] = {
362 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterExplicitDismissal}};
363const FeatureEntry::FeatureParam kBubbleRichIPHRich[] = {
364 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRich}};
365const FeatureEntry::FeatureParam kBubbleRichIPHRichWithSnooze[] = {
366 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRichWithSnooze}};
367const FeatureEntry::FeatureVariation kBubbleRichIPHVariations[] = {
Louis Romero023cc5052022-04-08 23:29:39368 {"Target Highlight", kBubbleRichIPHTargetHighlight,
369 std::size(kBubbleRichIPHTargetHighlight), nullptr},
Christian Xubd60c4b72022-03-22 15:25:01370 {"Explicit dismissal", kBubbleRichIPHExplicitDismissal,
371 std::size(kBubbleRichIPHExplicitDismissal), nullptr},
372 {"Dismissal and rich content", kBubbleRichIPHRich,
373 std::size(kBubbleRichIPHRich), nullptr},
Louis Romero023cc5052022-04-08 23:29:39374 {"Dismissal, rich content, and snooze", kBubbleRichIPHRichWithSnooze,
Christian Xubd60c4b72022-03-22 15:25:01375 std::size(kBubbleRichIPHRichWithSnooze), nullptr},
376};
377
Christian Xubdedabec2022-07-04 10:00:13378const FeatureEntry::FeatureParam kOmniboxPasteButtonBlueIconCapsule[] = {
379 {kOmniboxPasteButtonParameterName,
380 kOmniboxPasteButtonParameterBlueIconCapsule}};
381const FeatureEntry::FeatureParam kOmniboxPasteButtonBlueFullCapsule[] = {
382 {kOmniboxPasteButtonParameterName,
383 kOmniboxPasteButtonParameterBlueFullCapsule}};
384const FeatureEntry::FeatureVariation kOmniboxPasteButtonVariations[] = {
385 {"Icon only", kOmniboxPasteButtonBlueIconCapsule,
386 std::size(kOmniboxPasteButtonBlueIconCapsule), nullptr},
387 {"Icon and text", kOmniboxPasteButtonBlueFullCapsule,
388 std::size(kOmniboxPasteButtonBlueFullCapsule), nullptr},
389};
390
Gauthier Ambard30ad9ca2022-06-09 14:15:26391const FeatureEntry::FeatureParam kPopupMenuBookmarkStringAddABookmark[] = {
392 {kPopupMenuBookmarkStringParamName,
393 kPopupMenuBookmarkStringParamAddABookmark}};
394const FeatureEntry::FeatureParam kPopupMenuBookmarkStringAddToBookmarks[] = {
395 {kPopupMenuBookmarkStringParamName,
396 kPopupMenuBookmarkStringParamAddToBookmarks}};
397const FeatureEntry::FeatureParam kPopupMenuBookmarkStringBookmarkThisPage[] = {
398 {kPopupMenuBookmarkStringParamName,
399 kPopupMenuBookmarkStringParamBookmarkThisPage}};
400
401const FeatureEntry::FeatureVariation kPopupMenuBookmarkStringVarations[] = {
402 {"(Add A Bookmark)", kPopupMenuBookmarkStringAddABookmark,
403 std::size(kPopupMenuBookmarkStringAddABookmark), nullptr},
404 {"(Add To Bookmarks)", kPopupMenuBookmarkStringAddToBookmarks,
405 std::size(kPopupMenuBookmarkStringAddToBookmarks), nullptr},
406 {"(Bookmark This Page)", kPopupMenuBookmarkStringBookmarkThisPage,
407 std::size(kPopupMenuBookmarkStringBookmarkThisPage), nullptr}};
408
Igor Ruvinov44fed9f2022-06-10 22:51:42409const FeatureEntry::FeatureParam kDmTokenDeletionParam[] = {{"forced", "true"}};
410const FeatureEntry::FeatureVariation kDmTokenDeletionVariation[] = {
411 {"(Forced)", kDmTokenDeletionParam, std::size(kDmTokenDeletionParam),
412 nullptr}};
413
Cooper Knaak1e026562017-07-26 05:22:28414// To add a new entry, add to the end of kFeatureEntries. There are four
sdefresne14900ee2015-11-27 14:43:21415// distinct types of entries:
Cooper Knaak1e026562017-07-26 05:22:28416// . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the
417// default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE
sdefresne14900ee2015-11-27 14:43:21418// macro for this type supplying the command line to the macro.
419// . MULTI_VALUE: a list of choices, the first of which should correspond to a
420// deactivated state for this lab (i.e. no command line option). To specify
421// this type of entry use the macro MULTI_VALUE_TYPE supplying it the
422// array of choices.
Cooper Knaak1e026562017-07-26 05:22:28423// . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is
424// either enabled, disabled, or uses the default value of the associated
425// base::Feature instance. To specify this type of entry use the macro
426// FEATURE_VALUE_TYPE supplying it the base::Feature instance.
427// . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a
428// base::Feature instance. Choices corresponding to the default state, a
429// universally enabled state, and a universally disabled state are
430// automatically included. To specify this type of entry use the macro
431// FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and
432// the array of choices.
433//
sdefresne14900ee2015-11-27 14:43:21434// See the documentation of FeatureEntry for details on the fields.
435//
436// When adding a new choice, add it to the end of the list.
437const flags_ui::FeatureEntry kFeatureEntries[] = {
Cooper Knaak1e026562017-07-26 05:22:28438 {"in-product-help-demo-mode-choice",
439 flag_descriptions::kInProductHelpDemoModeName,
440 flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos,
441 FEATURE_WITH_PARAMS_VALUE_TYPE(
Tommy Nyquistc1d6dea12017-07-26 20:37:23442 feature_engagement::kIPHDemoMode,
443 feature_engagement::kIPHDemoModeChoiceVariations,
Marc Treib2752e8b2017-08-04 14:12:09444 "IPH_DemoMode")},
Moe Ahmadic3fd7cd2018-05-11 21:40:22445 {"enable-autofill-credit-card-upload",
446 flag_descriptions::kAutofillCreditCardUploadName,
447 flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos,
Anne Lim579b5732018-08-30 18:24:24448 FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)},
Tina Wang41d431c2021-06-21 21:04:13449 {"enable-discover-feed-preview",
450 flag_descriptions::kEnableDiscoverFeedPreviewName,
451 flag_descriptions::kEnableDiscoverFeedPreviewDescription, flags_ui::kOsIos,
452 FEATURE_VALUE_TYPE(kEnableDiscoverFeedPreview)},
Moe Ahmadid6d5d172018-06-20 17:20:23453 {"use-sync-sandbox", flag_descriptions::kSyncSandboxName,
454 flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos,
455 SINGLE_VALUE_TYPE_AND_VALUE(
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51456 syncer::kSyncServiceURL,
Moe Ahmadid6d5d172018-06-20 17:20:23457 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")},
458 {"wallet-service-use-sandbox",
459 flag_descriptions::kWalletServiceUseSandboxName,
460 flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos,
461 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
462 autofill::switches::kWalletServiceUseSandbox,
463 "1",
464 autofill::switches::kWalletServiceUseSandbox,
465 "0")},
Mohamad Ahmadic4df81f2017-12-20 04:41:59466 {"show-autofill-type-predictions",
467 flag_descriptions::kShowAutofillTypePredictionsName,
468 flag_descriptions::kShowAutofillTypePredictionsDescription,
469 flags_ui::kOsIos,
Gauthier Ambardcfd85182018-01-05 10:37:46470 FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)},
Olivier Robin3d60411622018-02-23 10:03:22471 {"autofill-ios-delay-between-fields",
472 flag_descriptions::kAutofillIOSDelayBetweenFieldsName,
473 flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription,
474 flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)},
Kurt Horimotodc33af32018-05-01 01:39:14475 {"fullscreen-viewport-adjustment-experiment",
Chris Lu481a9322019-09-25 22:16:53476 flag_descriptions::kFullscreenSmoothScrollingName,
477 flag_descriptions::kFullscreenSmoothScrollingDescription, flags_ui::kOsIos,
478 FEATURE_VALUE_TYPE(fullscreen::features::kSmoothScrollingDefault)},
Robbie Gibson1f37a5e2020-08-06 17:03:06479 {"webpage-default-zoom-from-dynamic-type",
480 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeName,
481 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeDescription,
482 flags_ui::kOsIos,
483 FEATURE_VALUE_TYPE(web::kWebPageDefaultZoomFromDynamicType)},
Robbie Gibson88f23962020-09-28 14:35:56484 {"webpage-alternative-text-zoom",
485 flag_descriptions::kWebPageAlternativeTextZoomName,
486 flag_descriptions::kWebPageAlternativeTextZoomDescription,
487 flags_ui::kOsIos, FEATURE_VALUE_TYPE(web::kWebPageAlternativeTextZoom)},
Robbie Gibson1095b72c2022-06-06 17:03:34488 {"webpage-text-zoom-ipad", flag_descriptions::kWebPageTextZoomIPadName,
489 flag_descriptions::kWebPageTextZoomIPadDescription, flags_ui::kOsIos,
490 FEATURE_VALUE_TYPE(web::kWebPageTextZoomIPad)},
Kurt Horimoto79d590b2018-09-12 19:09:28491 {"toolbar-container", flag_descriptions::kToolbarContainerName,
492 flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos,
493 FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)},
Stepan Khapugincc4e9842019-01-23 13:38:13494 {"omnibox-ui-max-autocomplete-matches",
495 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName,
496 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription,
497 flags_ui::kOsIos,
498 FEATURE_WITH_PARAMS_VALUE_TYPE(
499 omnibox::kUIExperimentMaxAutocompleteMatches,
500 kOmniboxUIMaxAutocompleteMatchesVariations,
501 "OmniboxUIMaxAutocompleteVariations")},
Stepan Khapuginbac467e2022-05-06 21:11:54502 {"omnibox-max-zps-matches", flag_descriptions::kOmniboxMaxZPSMatchesName,
503 flag_descriptions::kOmniboxMaxZPSMatchesDescription, flags_ui::kOsIos,
504 FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kMaxZeroSuggestMatches,
505 kOmniboxMaxZPSMatchesVariations,
506 "OmniboxMaxZPSVariations")},
Justin Cohen20b6f072019-01-16 01:38:50507#if defined(DCHECK_IS_CONFIGURABLE)
508 {"dcheck-is-fatal", flag_descriptions::kDcheckIsFatalName,
509 flag_descriptions::kDcheckIsFatalDescription, flags_ui::kOsIos,
510 FEATURE_VALUE_TYPE(base::kDCheckIsFatalFeature)},
511#endif // defined(DCHECK_IS_CONFIGURABLE)
Caitlin Fischer43edd90a2019-05-01 13:24:30512 {"autofill-use-mobile-label-disambiguation",
513 flag_descriptions::kAutofillUseMobileLabelDisambiguationName,
514 flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription,
515 flags_ui::kOsIos,
Caitlin Fischer37e01232019-05-24 13:05:45516 FEATURE_WITH_PARAMS_VALUE_TYPE(
517 autofill::features::kAutofillUseMobileLabelDisambiguation,
518 kAutofillUseMobileLabelDisambiguationVariations,
519 "AutofillUseMobileLabelDisambiguation")},
Olivier Robin43814bb2021-06-22 15:25:45520 {"metrickit-crash-reports", flag_descriptions::kMetrickitCrashReportName,
521 flag_descriptions::kMetrickitCrashReportDescription, flags_ui::kOsIos,
522 FEATURE_VALUE_TYPE(kMetrickitCrashReport)},
Mike Doughertyb6c770d2019-09-13 22:56:46523 {"ios-breadcrumbs", flag_descriptions::kLogBreadcrumbsName,
524 flag_descriptions::kLogBreadcrumbsDescription, flags_ui::kOsIos,
Jesse McKenna85c1a59f2021-05-05 19:08:30525 FEATURE_VALUE_TYPE(breadcrumbs::kLogBreadcrumbs)},
Eugene But2823dc7e2020-07-21 18:10:37526 {"ios-synthetic-crash-reports",
527 flag_descriptions::kSyntheticCrashReportsForUteName,
528 flag_descriptions::kSyntheticCrashReportsForUteDescription,
529 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSyntheticCrashReportsForUte)},
Jérôme Lebelc374fdd2019-09-27 10:36:48530 {"force-startup-signin-promo",
531 flag_descriptions::kForceStartupSigninPromoName,
532 flag_descriptions::kForceStartupSigninPromoDescription, flags_ui::kOsIos,
Alice Wang345e09442021-07-05 09:03:29533 FEATURE_VALUE_TYPE(switches::kForceStartupSigninPromo)},
Yoichi Osato7ae11752021-03-16 03:27:22534 {"restore-session-from-cache",
535 flag_descriptions::kRestoreSessionFromCacheName,
536 flag_descriptions::kRestoreSessionFromCacheDescription, flags_ui::kOsIos,
Justin Cohen3ec2522c2021-04-23 18:23:49537 FEATURE_VALUE_TYPE(web::kRestoreSessionFromCache)},
sczs4622e6e2019-11-06 01:17:59538 {"autofill-save-card-dismiss-on-navigation",
539 flag_descriptions::kAutofillSaveCardDismissOnNavigationName,
540 flag_descriptions::kAutofillSaveCardDismissOnNavigationDescription,
541 flags_ui::kOsIos,
542 FEATURE_VALUE_TYPE(
543 autofill::features::kAutofillSaveCardDismissOnNavigation)},
sczs37d9c132020-07-18 06:06:33544 {"new-content-suggestions-feed", flag_descriptions::kDiscoverFeedInNtpName,
adamta22a4d502020-05-21 03:12:21545 flag_descriptions::kDiscoverFeedInNtpDescription, flags_ui::kOsIos,
gogeralddb0d8ae2020-11-13 03:56:58546 FEATURE_WITH_PARAMS_VALUE_TYPE(kDiscoverFeedInNtp,
547 kDiscoverFeedInNtpVariations,
548 "IOSDiscoverFeed")},
Roberto Mourab87b9722020-06-17 17:12:09549 {"expanded-tab-strip", flag_descriptions::kExpandedTabStripName,
550 flag_descriptions::kExpandedTabStripDescription, flags_ui::kOsIos,
551 FEATURE_VALUE_TYPE(kExpandedTabStrip)},
Tommy Martino6b4eb7e2020-06-25 18:25:41552 {"shared-highlighting-ios", flag_descriptions::kSharedHighlightingIOSName,
553 flag_descriptions::kSharedHighlightingIOSDescription, flags_ui::kOsIos,
554 FEATURE_VALUE_TYPE(kSharedHighlightingIOS)},
Veronique Nguyen6593c762021-11-30 17:28:56555 {"enable-fre-ui-module-ios-with-options",
556 flag_descriptions::kEnableFREUIModuleIOSName,
Tina Wanga252ca42021-04-01 17:14:23557 flag_descriptions::kEnableFREUIModuleIOSDescription, flags_ui::kOsIos,
ginnnnnnny429b5522022-05-05 03:50:06558 FEATURE_VALUE_TYPE(kEnableFREUIModuleIOS)},
jlebel041fc1c2022-03-04 12:53:30559 {"new-mobile-identity-consistency-fre",
560 flag_descriptions::kNewMobileIdentityConsistencyFREName,
561 flag_descriptions::kNewMobileIdentityConsistencyFREDescription,
562 flags_ui::kOsIos,
563 FEATURE_WITH_PARAMS_VALUE_TYPE(signin::kNewMobileIdentityConsistencyFRE,
564 kNewMobileIdentityConsistencyFREVariations,
ginnnnnnny46435132022-06-01 16:06:04565 kIOSMICeAndDefaultBrowserTrialName)},
Sylvain Defresne9c107082020-10-27 16:39:13566#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
edchin81467b82020-09-03 19:31:45567 {"screen-time-integration-ios",
568 flag_descriptions::kScreenTimeIntegrationName,
569 flag_descriptions::kScreenTimeIntegrationDescription, flags_ui::kOsIos,
570 FEATURE_VALUE_TYPE(kScreenTimeIntegration)},
Sylvain Defresne9c107082020-10-27 16:39:13571#endif
Nazerke3e993f72020-09-21 13:00:06572 {"modern-tab-strip", flag_descriptions::kModernTabStripName,
573 flag_descriptions::kModernTabStripDescription, flags_ui::kOsIos,
574 FEATURE_VALUE_TYPE(kModernTabStrip)},
Nohemi Fernandez222d6d42020-09-30 20:35:57575 {"minutes-delay-to-restore-gaia-cookies-if-deleted",
576 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieName,
577 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieDescription,
578 flags_ui::kOsIos,
579 MULTI_VALUE_TYPE(kDelayThresholdMinutesToUpdateGaiaCookieChoices)},
Eugene Butf869bff2020-12-10 01:16:55580 {"record-snapshot-size", flag_descriptions::kRecordSnapshotSizeName,
581 flag_descriptions::kRecordSnapshotSizeDescription, flags_ui::kOsIos,
582 FEATURE_VALUE_TYPE(web::features::kRecordSnapshotSize)},
Chris Lub17195f2020-12-10 20:49:14583 {"default-browser-fullscreen-promo-experiment",
584 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentName,
585 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentDescription,
586 flags_ui::kOsIos,
Javier Ernesto Flores Robles159414232021-06-16 14:29:59587 FEATURE_WITH_PARAMS_VALUE_TYPE(
588 kDefaultBrowserFullscreenPromoExperiment,
589 kDefaultBrowserFullscreenPromoExperimentVariations,
590 "IOSDefaultBrowserFullscreenPromoExperiment")},
Cheick Cisse76ade3d2020-12-16 00:15:11591 {"ios-shared-highlighting-color-change",
592 flag_descriptions::kIOSSharedHighlightingColorChangeName,
593 flag_descriptions::kIOSSharedHighlightingColorChangeDescription,
Cheick Cissed0b5bfe2021-02-11 14:23:07594 flags_ui::kOsIos,
595 FEATURE_VALUE_TYPE(web::features::kIOSSharedHighlightingColorChange)},
Cheick Cissefe994862021-12-15 16:01:34596 {"ios-shared-highlighting-v2",
597 flag_descriptions::kIOSSharedHighlightingV2Name,
598 flag_descriptions::kIOSSharedHighlightingV2Description, flags_ui::kOsIos,
599 FEATURE_VALUE_TYPE(shared_highlighting::kIOSSharedHighlightingV2)},
Stepan Khapugin04341202021-01-07 12:22:45600 {"omnibox-new-textfield-implementation",
601 flag_descriptions::kOmniboxNewImplementationName,
602 flag_descriptions::kOmniboxNewImplementationDescription, flags_ui::kOsIos,
603 FEATURE_VALUE_TYPE(kIOSNewOmniboxImplementation)},
Stepan Khapugin422f08d2022-02-18 16:19:44604 {"omnibox-new-popup-ui", flag_descriptions::kIOSOmniboxUpdatedPopupUIName,
605 flag_descriptions::kIOSOmniboxUpdatedPopupUIDescription, flags_ui::kOsIos,
Robbie Gibson46351032022-03-31 19:46:23606 FEATURE_WITH_PARAMS_VALUE_TYPE(kIOSOmniboxUpdatedPopupUI,
607 kiOSOmniboxUpdatedPopupUIVariations,
Stepan Khapugina45baed2022-05-13 19:15:43608 "IOSOmniboxUpdatedPopupUI")},
gogerald0ff29e52021-02-03 18:56:19609 {"start-surface", flag_descriptions::kStartSurfaceName,
610 flag_descriptions::kStartSurfaceDescription, flags_ui::kOsIos,
gogerald0e39e3aa2021-02-10 18:41:23611 FEATURE_WITH_PARAMS_VALUE_TYPE(kStartSurface,
612 kStartSurfaceVariations,
613 "StartSurface")},
Justin Cohen13ac7a202021-02-04 18:27:28614 {"ios-crashpad", flag_descriptions::kCrashpadIOSName,
615 flag_descriptions::kCrashpadIOSDescription, flags_ui::kOsIos,
616 FEATURE_VALUE_TYPE(kCrashpadIOS)},
Vidhan Jain451b4752021-07-15 10:16:42617 {"autofill-address-verification-in-save-prompt",
618 flag_descriptions::kEnableAutofillAddressSavePromptAddressVerificationName,
619 flag_descriptions::
620 kEnableAutofillAddressSavePromptAddressVerificationDescription,
621 flags_ui::kOsIos,
622 FEATURE_VALUE_TYPE(
623 autofill::features::
624 kAutofillAddressProfileSavePromptAddressVerificationSupport)},
Vidhan Jaina65741552021-03-09 17:18:27625 {"autofill-address-save-prompt",
626 flag_descriptions::kEnableAutofillAddressSavePromptName,
627 flag_descriptions::kEnableAutofillAddressSavePromptDescription,
628 flags_ui::kOsIos,
629 FEATURE_VALUE_TYPE(autofill::features::kAutofillAddressProfileSavePrompt)},
Viktor Semeniuk68e794a2021-03-24 10:23:25630 {"filling-across-affiliated-websites",
631 flag_descriptions::kFillingAcrossAffiliatedWebsitesName,
632 flag_descriptions::kFillingAcrossAffiliatedWebsitesDescription,
633 flags_ui::kOsIos,
634 FEATURE_VALUE_TYPE(
635 password_manager::features::kFillingAcrossAffiliatedWebsites)},
Jared Sauld47c2b72021-03-25 22:47:31636 {"autofill-parse-merchant-promo-code-fields",
637 flag_descriptions::kAutofillParseMerchantPromoCodeFieldsName,
638 flag_descriptions::kAutofillParseMerchantPromoCodeFieldsDescription,
639 flags_ui::kOsIos,
640 FEATURE_VALUE_TYPE(
641 autofill::features::kAutofillParseMerchantPromoCodeFields)},
edchin257cea2f2021-04-07 13:07:13642 {"interest-feed-v2-clicks-and-views-cond-upload",
643 flag_descriptions::kInterestFeedV2ClickAndViewActionsConditionalUploadName,
644 flag_descriptions::
645 kInterestFeedV2ClickAndViewActionsConditionalUploadDescription,
646 flags_ui::kOsIos,
647 FEATURE_VALUE_TYPE(feed::kInterestFeedV2ClicksAndViewsConditionalUpload)},
Mohammad Refaat76b14f542021-10-27 14:46:55648 {"tabs-search-ios", flag_descriptions::kTabsSearchName,
649 flag_descriptions::kTabsSearchDescription, flags_ui::kOsIos,
650 FEATURE_VALUE_TYPE(kTabsSearch)},
Mohammad Refaat95410082022-02-23 02:01:02651 {"tabs-search-regular-results-suggested-actions-ios",
652 flag_descriptions::kTabsSearchRegularResultsSuggestedActionsName,
653 flag_descriptions::kTabsSearchRegularResultsSuggestedActionsDescription,
654 flags_ui::kOsIos,
655 FEATURE_VALUE_TYPE(kTabsSearchRegularResultsSuggestedActions)},
Side Yilmaz0e6c15a2021-04-26 12:55:09656 {"incognito-brand-consistency-for-ios",
657 flag_descriptions::kIncognitoBrandConsistencyForIOSName,
658 flag_descriptions::kIncognitoBrandConsistencyForIOSDescription,
659 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kIncognitoBrandConsistencyForIOS)},
Side Yilmaz6c53f7102021-09-07 13:26:19660 {"incognito-ntp-revamp", flag_descriptions::kIncognitoNtpRevampName,
661 flag_descriptions::kIncognitoNtpRevampDescription, flags_ui::kOsIos,
662 FEATURE_VALUE_TYPE(kIncognitoNtpRevamp)},
Side YILMAZ4b40a3082022-04-11 10:13:33663 {"update-history-entry-points-in-incognito",
664 flag_descriptions::kUpdateHistoryEntryPointsInIncognitoName,
665 flag_descriptions::kUpdateHistoryEntryPointsInIncognitoDescription,
666 flags_ui::kOsIos,
667 FEATURE_VALUE_TYPE(kUpdateHistoryEntryPointsInIncognito)},
jlebeld95434d652021-06-22 10:32:48668 {"sync-trusted-vault-passphrase-ios-rpc",
669 flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCName,
670 flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCDescription,
671 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51672 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseiOSRPC)},
Mikel Astiz850b0fe2021-06-16 09:47:27673 {"sync-trusted-vault-passphrase-promo",
674 flag_descriptions::kSyncTrustedVaultPassphrasePromoName,
675 flag_descriptions::kSyncTrustedVaultPassphrasePromoDescription,
676 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51677 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphrasePromo)},
Mikel Astiz850b0fe2021-06-16 09:47:27678 {"sync-trusted-vault-passphrase-recovery",
679 flag_descriptions::kSyncTrustedVaultPassphraseRecoveryName,
680 flag_descriptions::kSyncTrustedVaultPassphraseRecoveryDescription,
681 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51682 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseRecovery)},
Nohemi Fernandezc00842a2021-07-26 11:47:34683 {"wait-threshold-seconds-for-capabilities-api",
684 flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiName,
685 flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiDescription,
686 flags_ui::kOsIos,
687 MULTI_VALUE_TYPE(kWaitThresholdMillisecondsForCapabilitiesApiChoices)},
Jared Saul2188f762021-08-02 21:22:23688 {"autofill-fill-merchant-promo-code-fields",
689 flag_descriptions::kAutofillFillMerchantPromoCodeFieldsName,
690 flag_descriptions::kAutofillFillMerchantPromoCodeFieldsDescription,
691 flags_ui::kOsIos,
692 FEATURE_VALUE_TYPE(
693 autofill::features::kAutofillFillMerchantPromoCodeFields)},
Gauthier Ambard14d3a262021-08-09 18:09:23694 {"default-wkwebview-context-menu",
695 flag_descriptions::kDefaultWebViewContextMenuName,
696 flag_descriptions::kDefaultWebViewContextMenuDescription, flags_ui::kOsIos,
697 FEATURE_VALUE_TYPE(web::features::kDefaultWebViewContextMenu)},
Sylvain Defresnedff67e42021-09-24 09:43:03698 {"new-overflow-menu", flag_descriptions::kNewOverflowMenuName,
699 flag_descriptions::kNewOverflowMenuDescription, flags_ui::kOsIos,
700 FEATURE_VALUE_TYPE(kNewOverflowMenu)},
Robbie Gibsonfe748e52022-05-09 18:20:46701 {"new-overflow-menu-settings-action",
702 flag_descriptions::kNewOverflowMenuSettingsActionName,
Robbie Gibsone2ad5632022-05-16 20:46:10703 flag_descriptions::kNewOverflowMenuSettingsActionDescription,
704 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kNewOverflowMenuSettingsAction)},
705 {"new-overflow-menu-simple-destination-icons",
706 flag_descriptions::kNewOverflowMenuSimpleDestinationIconsName,
707 flag_descriptions::kNewOverflowMenuSimpleDestinationIconsDescription,
708 flags_ui::kOsIos,
709 FEATURE_VALUE_TYPE(kNewOverflowMenuSimpleDestinationIcons)},
Robbie Gibson640bccb32022-05-10 18:43:35710 {"new-overflow-menu-cbd-action",
711 flag_descriptions::kNewOverflowMenuCBDActionName,
712 flag_descriptions::kNewOverflowMenuCBDActionDescription, flags_ui::kOsIos,
713 FEATURE_VALUE_TYPE(kNewOverflowMenuCBDAction)},
Sylvain Defresnedff67e42021-09-24 09:43:03714 {"enable-new-download-api", flag_descriptions::kEnableNewDownloadAPIName,
715 flag_descriptions::kEnableNewDownloadAPIDescription, flags_ui::kOsIos,
716 FEATURE_VALUE_TYPE(web::features::kEnableNewDownloadAPI)},
Evan Bernstein0a85f332021-09-29 19:07:24717 {"use-lens-to-search-for-image",
718 flag_descriptions::kUseLensToSearchForImageName,
719 flag_descriptions::kUseLensToSearchForImageDescription, flags_ui::kOsIos,
Ali Juma02a9b7b2021-10-01 13:44:44720 FEATURE_VALUE_TYPE(kUseLensToSearchForImage)},
Benjamin Williamsbee6ab62022-02-28 18:09:40721 {"use-load-simulated-request-for-error-page-navigation",
Gauthier Ambard33cceaf2022-05-05 14:00:23722 flag_descriptions::kUseLoadSimulatedRequestForOfflinePageName,
723 flag_descriptions::kUseLoadSimulatedRequestForOfflinePageDescription,
Benjamin Williamsbee6ab62022-02-28 18:09:40724 flags_ui::kOsIos,
Gauthier Ambard33cceaf2022-05-05 14:00:23725 FEATURE_VALUE_TYPE(web::features::kUseLoadSimulatedRequestForOfflinePage)},
Sergio Collazos9fcc6ed2021-10-06 00:58:03726 {"enable-discover-feed-static-resource-serving",
727 flag_descriptions::kEnableDiscoverFeedStaticResourceServingName,
728 flag_descriptions::kEnableDiscoverFeedStaticResourceServingDescription,
729 flags_ui::kOsIos,
730 FEATURE_WITH_PARAMS_VALUE_TYPE(
731 kEnableDiscoverFeedStaticResourceServing,
732 kEnableDiscoverFeedStaticResourceServingVariations,
733 "IOSDiscoverFeedStaticResourceServing")},
734 {"enable-disco-feed-endpoint",
735 flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointName,
736 flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointDescription,
737 flags_ui::kOsIos,
Aliona DANGLA8fae66f02021-10-06 15:47:11738 FEATURE_VALUE_TYPE(kEnableDiscoverFeedDiscoFeedEndpoint)},
Mohammad Refaatab6bee62022-05-16 16:31:15739 {"enable-discover-feed-top-sync-promo",
740 flag_descriptions::kEnableDiscoverFeedTopSyncPromoName,
741 flag_descriptions::kEnableDiscoverFeedTopSyncPromoDescription,
742 flags_ui::kOsIos,
743 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableDiscoverFeedTopSyncPromo,
744 kDiscoverFeedTopSyncPromoVariations,
745 "EnableDiscoverFeedTopSyncPromo")},
Aliona DANGLA8fae66f02021-10-06 15:47:11746 {"enable-fre-default-browser-screen-testing",
ginnnnnnny46435132022-06-01 16:06:04747 flag_descriptions::kEnableFREDefaultBrowserPromoScreenName,
748 flag_descriptions::kEnableFREDefaultBrowserPromoScreenDescription,
Aliona DANGLA8fae66f02021-10-06 15:47:11749 flags_ui::kOsIos,
ginnnnnnny46435132022-06-01 16:06:04750 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFREDefaultBrowserPromoScreen,
751 kFREDefaultBrowserPromoVariations,
752 kIOSMICeAndDefaultBrowserTrialName)},
edchin1313f2b2021-10-11 08:08:47753 {"enable-discover-feed-shorter-cache",
754 flag_descriptions::kEnableDiscoverFeedShorterCacheName,
755 flag_descriptions::kEnableDiscoverFeedShorterCacheDescription,
756 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableDiscoverFeedShorterCache)},
Tommy Martino7393d762021-10-12 17:59:28757 {"shared-highlighting-amp",
758 flag_descriptions::kIOSSharedHighlightingAmpName,
759 flag_descriptions::kIOSSharedHighlightingAmpDescription, flags_ui::kOsIos,
760 FEATURE_VALUE_TYPE(shared_highlighting::kSharedHighlightingAmp)},
David Maunderf4a5e1e2021-10-18 17:24:28761 {"enable-commerce-price-tracking",
Matt Jones125dfb42022-02-11 17:23:42762 commerce::flag_descriptions::kCommercePriceTrackingName,
763 commerce::flag_descriptions::kCommercePriceTrackingDescription,
764 flags_ui::kOsIos,
765 FEATURE_WITH_PARAMS_VALUE_TYPE(commerce::kCommercePriceTracking,
766 commerce::kCommercePriceTrackingVariations,
adamta67b6c5812021-10-19 17:02:15767 "CommercePriceTracking")},
Tina Wang8058d5f2021-11-04 20:06:06768 {"web-feed-ios", flag_descriptions::kEnableWebChannelsName,
769 flag_descriptions::kEnableWebChannelsDescription, flags_ui::kOsIos,
770 FEATURE_VALUE_TYPE(kEnableWebChannels)},
adamta39331592021-11-01 20:18:54771 {"ntp-view-hierarchy-repair",
772 flag_descriptions::kNTPViewHierarchyRepairName,
773 flag_descriptions::kNTPViewHierarchyRepairDescription, flags_ui::kOsIos,
774 FEATURE_VALUE_TYPE(kNTPViewHierarchyRepair)},
Justin Cohen69cec682021-11-04 20:10:26775 {"synthesized-restore-session",
776 flag_descriptions::kSynthesizedRestoreSessionName,
777 flag_descriptions::kSynthesizedRestoreSessionDescription, flags_ui::kOsIos,
778 FEATURE_VALUE_TYPE(web::features::kSynthesizedRestoreSession)},
Chris Lu4723b822021-11-05 21:47:44779 {"remove-extra-ntps", flag_descriptions::kRemoveExcessNTPsExperimentName,
780 flag_descriptions::kRemoveExcessNTPsExperimentDescription,
Sylvain Defresne1619dd002021-11-06 10:09:48781 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kRemoveExcessNTPs)},
782 {"lazily-create-web-state-on-restoration",
783 flag_descriptions::kLazilyCreateWebStateOnRestorationName,
784 flag_descriptions::kLazilyCreateWebStateOnRestorationDescription,
785 flags_ui::kOsIos,
786 FEATURE_VALUE_TYPE(web::features::kEnableUnrealizedWebStates)},
ginny huang1f1755c2021-11-11 23:38:23787 {"enable-shortened-password-auto-fill-instruction",
788 flag_descriptions::kEnableShortenedPasswordAutoFillInstructionName,
789 flag_descriptions::kEnableShortenedPasswordAutoFillInstructionDescription,
790 flags_ui::kOsIos,
791 FEATURE_VALUE_TYPE(kEnableShortenedPasswordAutoFillInstruction)},
Benjamin Williams0e7e2fb2021-11-17 03:03:41792 {"enable-password-manager-branding-update",
793 flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateName,
794 flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateDescription,
795 flags_ui::kOsIos,
Aliona DANGLAe5b0b6e52021-11-30 11:58:19796 FEATURE_VALUE_TYPE(
797 password_manager::features::kIOSEnablePasswordManagerBrandingUpdate)},
Gauthier Ambard1d326e22021-12-16 10:57:53798 {"default-mode-ua", flag_descriptions::kAddSettingForDefaultPageModeName,
799 flag_descriptions::kAddSettingForDefaultPageModeDescription,
800 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kAddSettingForDefaultPageMode)},
ginnnnnnny1532d872021-12-20 15:57:37801 {"ios-media-permissions-control",
802 flag_descriptions::kMediaPermissionsControlName,
803 flag_descriptions::kMediaPermissionsControlDescription, flags_ui::kOsIos,
804 FEATURE_VALUE_TYPE(web::features::kMediaPermissionsControl)},
Olivier Robin3a957df2021-12-21 18:04:34805 {"enable-save-session-tabs-in-separate-files",
806 flag_descriptions::kSaveSessionTabsToSeparateFilesName,
807 flag_descriptions::kSaveSessionTabsToSeparateFilesDescription,
808 flags_ui::kOsIos,
809 FEATURE_VALUE_TYPE(sessions::kSaveSessionTabsToSeparateFiles)},
Ewann8c7aadc2022-05-19 15:41:05810 {"use-sf-symbols", flag_descriptions::kUseSFSymbolsName,
811 flag_descriptions::kUseSFSymbolsDescription, flags_ui::kOsIos,
812 FEATURE_VALUE_TYPE(kUseSFSymbols)},
Nohemi Fernandez76f54802022-01-10 18:23:32813 {"enable-unicorn-account-support",
814 flag_descriptions::kEnableUnicornAccountSupportName,
815 flag_descriptions::kEnableUnicornAccountSupportDescription,
816 flags_ui::kOsIos,
817 FEATURE_VALUE_TYPE(signin::kEnableUnicornAccountSupport)},
Chris Lu411bea82022-01-12 18:19:22818 {"single-cell-content-suggestions",
819 flag_descriptions::kSingleCellContentSuggestionsName,
820 flag_descriptions::kSingleCellContentSuggestionsDescription,
821 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSingleCellContentSuggestions)},
Chris Lue5211052022-02-02 20:44:04822 {"content-suggestions-header-migration",
823 flag_descriptions::kContentSuggestionsHeaderMigrationName,
824 flag_descriptions::kContentSuggestionsHeaderMigrationDescription,
825 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kContentSuggestionsHeaderMigration)},
rgod90cca8b2022-02-04 12:38:27826 {"leak-detection-unauthenticated",
827 flag_descriptions::kLeakDetectionUnauthenticatedName,
828 flag_descriptions::kLeakDetectionUnauthenticatedDescription,
829 flags_ui::kOsIos,
830 FEATURE_VALUE_TYPE(
831 password_manager::features::kLeakDetectionUnauthenticated)},
Veronique Nguyen00ba26ea2022-02-25 14:57:17832 {"enable-favicon-passwords",
833 flag_descriptions::kEnableFaviconForPasswordsName,
834 flag_descriptions::kEnableFaviconForPasswordsDescription, flags_ui::kOsIos,
835 FEATURE_VALUE_TYPE(
836 password_manager::features::kEnableFaviconForPasswords)},
Shivani Chauhanbf97b0d2022-02-08 22:21:28837 {"autofill-enable-sending-bcn-in-get-upload-details",
838 flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsName,
839 flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsDescription,
840 flags_ui::kOsIos,
841 FEATURE_VALUE_TYPE(
842 autofill::features::kAutofillEnableSendingBcnInGetUploadDetails)},
Ali Juma1429cf8a2022-02-09 15:31:01843 {"enable-fullscreen-api", flag_descriptions::kEnableFullscreenAPIName,
844 flag_descriptions::kEnableFullscreenAPIDescription, flags_ui::kOsIos,
845 FEATURE_VALUE_TYPE(web::features::kEnableFullscreenAPI)},
Joemer Ramos34175732022-02-14 18:59:16846 {"enable-enhanced-safe-browsing",
847 flag_descriptions::kEnhancedProtectionName,
848 flag_descriptions::kEnhancedProtectionDescription, flags_ui::kOsIos,
849 FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtection)},
Joemer Ramos26e2b512022-05-24 17:26:41850 {"enable-enhanced-safe-browsing-phase-2",
851 flag_descriptions::kEnhancedProtectionPhase2Name,
852 flag_descriptions::kEnhancedProtectionPhase2Description, flags_ui::kOsIos,
853 FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtectionPhase2IOS)},
Shivani Chauhanaf1eb74d2022-02-11 21:13:19854 {"autofill-enable-unmask-card-request-set-instrument-id",
855 flag_descriptions::kAutofillEnableUnmaskCardRequestSetInstrumentIdName,
856 flag_descriptions::
857 kAutofillEnableUnmaskCardRequestSetInstrumentIdDescription,
858 flags_ui::kOsIos,
859 FEATURE_VALUE_TYPE(
860 autofill::features::kAutofillEnableUnmaskCardRequestSetInstrumentId)},
Victor Hugo Vianna Silvaf0a44002022-02-16 10:38:00861 {"send-tab-to-self-signin-promo",
862 flag_descriptions::kSendTabToSelfSigninPromoName,
863 flag_descriptions::kSendTabToSelfSigninPromoDescription, flags_ui::kOsIos,
864 FEATURE_VALUE_TYPE(send_tab_to_self::kSendTabToSelfSigninPromo)},
Chris Lu7f560f72022-03-01 18:19:01865 {"content-suggestions-uiviewcontroller-migration",
866 flag_descriptions::kContentSuggestionsUIViewControllerMigrationName,
867 flag_descriptions::kContentSuggestionsUIViewControllerMigrationDescription,
868 flags_ui::kOsIos,
869 FEATURE_VALUE_TYPE(kContentSuggestionsUIViewControllerMigration)},
Christian Xubd60c4b72022-03-22 15:25:01870 {"bubble-rich-iph", flag_descriptions::kBubbleRichIPHName,
871 flag_descriptions::kBubbleRichIPHDescription, flags_ui::kOsIos,
872 FEATURE_WITH_PARAMS_VALUE_TYPE(kBubbleRichIPH,
873 kBubbleRichIPHVariations,
874 "BubbleRichIPH")},
Siyu Anff02e742022-04-07 19:08:22875 {"autofill-enforce-delays-in-strike-database",
876 flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseName,
877 flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseDescription,
878 flags_ui::kOsIos,
879 FEATURE_VALUE_TYPE(
880 autofill::features::kAutofillEnforceDelaysInStrikeDatabase)},
Ewann4f260562022-04-11 13:37:19881 {"download-calendar", flag_descriptions::kDownloadCalendarName,
882 flag_descriptions::kDownloadCalendarDescription, flags_ui::kOsIos,
883 FEATURE_VALUE_TYPE(kDownloadCalendar)},
Louis Romerofbfbd932022-04-15 18:04:50884 {"uiview-window-observing", flag_descriptions::kUIViewWindowObservingName,
885 flag_descriptions::kUIViewWindowObservingDescription, flags_ui::kOsIos,
886 FEATURE_VALUE_TYPE(kUIViewWindowObserving)},
Jared Saulb0473bd2022-04-20 00:03:41887 {"autofill-upstream-allow-additional-email-domains",
888 flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsName,
889 flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsDescription,
890 flags_ui::kOsIos,
891 FEATURE_VALUE_TYPE(
892 autofill::features::kAutofillUpstreamAllowAdditionalEmailDomains)},
893 {"autofill-upstream-allow-all-email-domains",
894 flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsName,
895 flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsDescription,
896 flags_ui::kOsIos,
897 FEATURE_VALUE_TYPE(
898 autofill::features::kAutofillUpstreamAllowAllEmailDomains)},
Olivier Robinffe767c2022-04-21 13:13:23899 {"enable-tflite-language-detection",
900 flag_descriptions::kTFLiteLanguageDetectionName,
901 flag_descriptions::kTFLiteLanguageDetectionDescription, flags_ui::kOsIos,
902 FEATURE_VALUE_TYPE(translate::kTFLiteLanguageDetectionEnabled)},
903 {"optimization-guide-model-downloading",
904 flag_descriptions::kOptimizationGuideModelDownloadingName,
905 flag_descriptions::kOptimizationGuideModelDownloadingDescription,
906 flags_ui::kOsIos,
907 FEATURE_VALUE_TYPE(
908 optimization_guide::features::kOptimizationGuideModelDownloading)},
909 {"optimization-target-prediction",
910 flag_descriptions::kOptimizationTargetPredictionName,
911 flag_descriptions::kOptimizationTargetPredictionDescription,
912 flags_ui::kOsIos,
913 FEATURE_VALUE_TYPE(
914 optimization_guide::features::kOptimizationTargetPrediction)},
Rushan Suleymanov727309602022-04-28 20:08:54915 {"sync-standalone-invalidations", flag_descriptions::kSyncInvalidationsName,
916 flag_descriptions::kSyncInvalidationsDescription, flags_ui::kOsIos,
917 FEATURE_VALUE_TYPE(::syncer::kUseSyncInvalidations)},
918 {"sync-standalone-invalidations-wallet-and-offer",
919 flag_descriptions::kSyncInvalidationsWalletAndOfferName,
920 flag_descriptions::kSyncInvalidationsWalletAndOfferDescription,
921 flags_ui::kOsIos,
922 FEATURE_VALUE_TYPE(::syncer::kUseSyncInvalidationsForWalletAndOffer)},
Christian Xub8c06cd2022-04-29 20:55:01923 {"suggestions-scrolling-ipad",
924 flag_descriptions::kEnableSuggestionsScrollingOnIPadName,
925 flag_descriptions::kEnableSuggestionsScrollingOnIPadDescription,
926 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableSuggestionsScrollingOnIPad)},
David Jean7a8fa702022-05-02 15:21:22927 {"experience-kit-calendar", flag_descriptions::kCalendarExperienceKitName,
928 flag_descriptions::kCalendarExperienceKitDescription, flags_ui::kOsIos,
929 FEATURE_VALUE_TYPE(kCalendarExperienceKit)},
Zhixiang Teoh82d17bb2022-06-16 21:00:39930 {"enable-expkit-calendar-text-classifier",
931 flag_descriptions::kEnableExpKitCalendarTextClassifierName,
932 flag_descriptions::kEnableExpKitCalendarTextClassifierDescription,
933 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableExpKitCalendarTextClassifier)},
Mustafa Emre Acer4de8863a2022-05-03 22:17:01934 {"https-only-mode", flag_descriptions::kHttpsOnlyModeName,
935 flag_descriptions::kHttpsOnlyModeDescription, flags_ui::kOsIos,
936 FEATURE_VALUE_TYPE(security_interstitials::features::kHttpsOnlyMode)},
Benjamin Williams419c81e2022-05-04 18:33:22937 {"smart-sorting-new-overflow-menu",
938 flag_descriptions::kSmartSortingNewOverflowMenuName,
939 flag_descriptions::kSmartSortingNewOverflowMenuDescription,
940 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSmartSortingNewOverflowMenu)},
Scott Yoder10493562022-06-28 17:37:44941 {"new-overflow-menu-share-chrome-action",
942 flag_descriptions::kNewOverflowMenuShareChromeActionName,
943 flag_descriptions::kNewOverflowMenuShareChromeActionDescription,
944 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kNewOverflowMenuShareChromeAction)},
Alexander Tekled46a36982022-05-09 20:32:42945 {"autofill-enable-ranking-formula",
946 flag_descriptions::kAutofillEnableRankingFormulaName,
947 flag_descriptions::kAutofillEnableRankingFormulaDescription,
948 flags_ui::kOsIos,
949 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableRankingFormula)},
Siyu An4f658a92022-05-13 22:59:02950 {"autofill-remove-card-expiry-from-downstream-suggestion",
951 flag_descriptions::kAutofillRemoveCardExpiryFromDownstreamSuggestionName,
952 flag_descriptions::
953 kAutofillRemoveCardExpiryFromDownstreamSuggestionDescription,
954 flags_ui::kOsIos,
955 FEATURE_VALUE_TYPE(autofill::features::
956 kAutofillRemoveCardExpiryFromDownstreamSuggestion)},
Sergio Collazos58558712022-05-18 17:24:02957 {"enable-feed-ablation", flag_descriptions::kEnableFeedAblationName,
958 flag_descriptions::kEnableFeedAblationDescription, flags_ui::kOsIos,
959 FEATURE_VALUE_TYPE(kEnableFeedAblation)},
Chris Lu7f024ed2c2022-05-27 23:11:27960 {"content-suggestions-ui-module-refresh",
961 flag_descriptions::kContentSuggestionsUIModuleRefreshName,
962 flag_descriptions::kContentSuggestionsUIModuleRefreshDescription,
963 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kContentSuggestionsUIModuleRefresh)},
Quentin Pubertd7546ae2022-05-30 14:28:57964 {"3p-intents-in-incognito", flag_descriptions::kIOS3PIntentsInIncognitoName,
965 flag_descriptions::kIOS3PIntentsInIncognitoDescription, flags_ui::kOsIos,
966 FEATURE_VALUE_TYPE(kIOS3PIntentsInIncognito)},
Olivier Robin058c1fad2022-05-31 18:24:06967 {"default-browser-intents-show-settings",
968 flag_descriptions::kDefaultBrowserIntentsShowSettingsName,
969 flag_descriptions::kDefaultBrowserIntentsShowSettingsDescription,
970 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDefaultBrowserIntentsShowSettings)},
Ed Chin76b1b35e2022-06-08 23:01:17971 {"enable-discover-feed-ghost-cards",
972 flag_descriptions::kEnableDiscoverFeedGhostCardsName,
973 flag_descriptions::kEnableDiscoverFeedGhostCardsDescription,
974 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDiscoverFeedGhostCardsEnabled)},
Gauthier Ambard30ad9ca2022-06-09 14:15:26975 {"bookmark-string-menu", flag_descriptions::kBookmarkStringName,
976 flag_descriptions::kBookmarkStringDescription, flags_ui::kOsIos,
977 FEATURE_WITH_PARAMS_VALUE_TYPE(kBookmarkString,
978 kPopupMenuBookmarkStringVarations,
979 "BookmarkString")},
Igor Ruvinova43a66dc2022-06-09 21:57:45980 {"dm-token-deletion", flag_descriptions::kDmTokenDeletionName,
981 flag_descriptions::kDmTokenDeletionDescription, flags_ui::kOsIos,
Igor Ruvinov44fed9f2022-06-10 22:51:42982 FEATURE_WITH_PARAMS_VALUE_TYPE(policy::features::kDmTokenDeletion,
983 kDmTokenDeletionVariation,
984 "DmTokenDeletion")},
Tommy Martinoad42be52022-06-13 11:51:19985 {"ios-password-ui-split", flag_descriptions::kIOSPasswordUISplitName,
986 flag_descriptions::kIOSPasswordUISplitDescription, flags_ui::kOsIos,
987 FEATURE_VALUE_TYPE(password_manager::features::kIOSPasswordUISplit)},
Christian Xud105a1352022-06-17 19:54:14988 {"omnibox-adaptive-suggestions-count",
989 flag_descriptions::kAdaptiveSuggestionsCountName,
990 flag_descriptions::kAdaptiveSuggestionsCountDescription, flags_ui::kOsIos,
991 FEATURE_VALUE_TYPE(omnibox::kAdaptiveSuggestionsCount)},
Chris Lu2fd473f2022-06-28 13:38:20992 {"trending-queries-module", flag_descriptions::kTrendingQueriesModuleName,
993 flag_descriptions::kTrendingQueriesModuleDescription, flags_ui::kOsIos,
994 FEATURE_VALUE_TYPE(kTrendingQueriesModule)},
Nakul Vaidyaddfdfbc2022-06-28 23:43:32995 {"autofill-parse-iban-fields",
996 flag_descriptions::kAutofillParseIbanFieldsName,
997 flag_descriptions::kAutofillParseIbanFieldsDescription, flags_ui::kOsIos,
998 FEATURE_VALUE_TYPE(autofill::features::kAutofillParseIbanFields)},
Ernesto Izquierdo Clua7f4e36e22022-07-01 09:38:36999 {"autofill-enable-new-card-unmask-prompt-view",
1000 flag_descriptions::kAutofillEnableNewCardUnmaskPromptViewName,
1001 flag_descriptions::kAutofillEnableNewCardUnmaskPromptViewDescription,
1002 flags_ui::kOsIos,
1003 FEATURE_VALUE_TYPE(kAutofillEnableNewCardUnmaskPromptView)},
Christian Xubdedabec2022-07-04 10:00:131004 {"omnibox-paste-button", flag_descriptions::kOmniboxPasteButtonName,
1005 flag_descriptions::kOmniboxPasteButtonDescription, flags_ui::kOsIos,
1006 FEATURE_WITH_PARAMS_VALUE_TYPE(kOmniboxPasteButton,
1007 kOmniboxPasteButtonVariations,
1008 "OmniboxPasteButton")},
Vincent Boissellead6cbe22022-07-04 19:32:391009 {"enable-user-policy", flag_descriptions::kEnableUserPolicyName,
1010 flag_descriptions::kEnableUserPolicyDescription, flags_ui::kOsIos,
1011 SINGLE_VALUE_TYPE(policy::kEnableUserPolicy)},
Sylvain Defresne1619dd002021-11-06 10:09:481012};
sdefresne14900ee2015-11-27 14:43:211013
Rohit Raobed794c2020-04-27 15:27:451014bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
1015 return false;
1016}
1017
1018flags_ui::FlagsState& GetGlobalFlagsState() {
1019 static base::NoDestructor<flags_ui::FlagsState> flags_state(kFeatureEntries,
1020 nullptr);
1021 return *flags_state;
1022}
David Jean5ca263c2021-08-18 09:19:301023// Creates the experimental test policies map, used by AsyncPolicyLoader and
1024// PolicyLoaderIOS to locally enable policies.
Vincent Boisselleed0e6f1a2021-11-09 06:47:341025NSMutableDictionary* CreateExperimentalTestingPolicies() {
sdefresne14900ee2015-11-27 14:43:211026 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1027
Guillaume Jenkins25e9bd72020-08-27 17:39:061028 // Shared variables for all enterprise experimental flags.
Guillaume Jenkins57606d72020-08-13 17:32:551029 NSMutableDictionary* testing_policies = [[NSMutableDictionary alloc] init];
Guillaume Jenkins25e9bd72020-08-27 17:39:061030 NSMutableArray* allowed_experimental_policies = [[NSMutableArray alloc] init];
Guillaume Jenkins57606d72020-08-13 17:32:551031
Guillaume Jenkins25e9bd72020-08-27 17:39:061032 // Set some sample policy values for testing if EnableSamplePolicies is set to
1033 // true.
Guillaume Jenkinseeb7007c2020-06-25 22:55:401034 if ([defaults boolForKey:@"EnableSamplePolicies"]) {
Guillaume Jenkins57606d72020-08-13 17:32:551035 [testing_policies addEntriesFromDictionary:@{
Tina Wang59d0b7e2020-08-11 04:41:011036 base::SysUTF8ToNSString(policy::key::kAutofillAddressEnabled) : @NO,
1037
Guillaume Jenkinseeb7007c2020-06-25 22:55:401038 base::SysUTF8ToNSString(policy::key::kAutofillCreditCardEnabled) : @NO,
1039
1040 // 2 = Disable all variations
1041 base::SysUTF8ToNSString(policy::key::kChromeVariations) : @2,
1042
1043 // 2 = Do not allow any site to show popups
1044 base::SysUTF8ToNSString(policy::key::kDefaultPopupsSetting) : @2,
1045
Tina Wang5abee802020-07-29 23:09:521046 // Set default search engine.
1047 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderEnabled) :
1048 @YES,
1049 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderSearchURL) :
1050 @"http://www.google.com/search?q={searchTerms}",
1051 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderName) :
Tina Wang7cd0a062020-09-15 21:31:021052 @"TestEngine",
Tina Wang5abee802020-07-29 23:09:521053
Tina Wang89068c82020-10-29 15:51:501054 base::SysUTF8ToNSString(policy::key::kEditBookmarksEnabled) : @NO,
1055
Gauthier Ambard21b23702021-04-16 16:11:271056 base::SysUTF8ToNSString(policy::key::kNTPContentSuggestionsEnabled) : @NO,
1057
Guillaume Jenkinseeb7007c2020-06-25 22:55:401058 base::SysUTF8ToNSString(policy::key::kPasswordManagerEnabled) : @NO,
Tina Wang59d0b7e2020-08-11 04:41:011059
1060 base::SysUTF8ToNSString(policy::key::kTranslateEnabled) : @NO,
Tina Wang54dddfc22020-08-20 22:34:531061
1062 // 2 = Enhanced safe browsing protection
1063 base::SysUTF8ToNSString(policy::key::kSafeBrowsingProtectionLevel) : @2,
1064
1065 base::SysUTF8ToNSString(policy::key::kSearchSuggestEnabled) : @YES,
Guillaume Jenkins57606d72020-08-13 17:32:551066 }];
1067 }
1068
Ewann227a3c02021-04-19 12:04:541069 if ([defaults boolForKey:@"EnableSyncDisabledPolicy"]) {
Guillaume Jenkinsfe46d3a2021-04-26 19:51:041070 NSString* sync_policy_key =
1071 base::SysUTF8ToNSString(policy::key::kSyncDisabled);
David Jean5ca263c2021-08-18 09:19:301072 [testing_policies addEntriesFromDictionary:@{sync_policy_key : @YES}];
Ewann227a3c02021-04-19 12:04:541073 }
Ewann227a3c02021-04-19 12:04:541074
Ewann570a6302021-08-17 07:22:421075 // SyncTypesListDisabled policy.
1076 NSString* Sync_types_list_disabled_key =
1077 base::SysUTF8ToNSString(policy::key::kSyncTypesListDisabled);
1078 NSMutableArray* Sync_types_list_disabled_values =
1079 [[NSMutableArray alloc] init];
1080 if ([defaults boolForKey:@"SyncTypesListBookmarks"]) {
1081 [Sync_types_list_disabled_values addObject:@"bookmarks"];
1082 }
1083 if ([defaults boolForKey:@"SyncTypesListReadingList"]) {
1084 [Sync_types_list_disabled_values addObject:@"readingList"];
1085 }
1086 if ([defaults boolForKey:@"SyncTypesListPreferences"]) {
1087 [Sync_types_list_disabled_values addObject:@"preferences"];
1088 }
1089 if ([defaults boolForKey:@"SyncTypesListPasswords"]) {
1090 [Sync_types_list_disabled_values addObject:@"passwords"];
1091 }
1092 if ([defaults boolForKey:@"SyncTypesListAutofill"]) {
1093 [Sync_types_list_disabled_values addObject:@"autofill"];
1094 }
1095 if ([defaults boolForKey:@"SyncTypesListTypedUrls"]) {
1096 [Sync_types_list_disabled_values addObject:@"typedUrls"];
1097 }
1098 if ([defaults boolForKey:@"SyncTypesListTabs"]) {
1099 [Sync_types_list_disabled_values addObject:@"tabs"];
1100 }
1101 if ([Sync_types_list_disabled_values count]) {
1102 [testing_policies addEntriesFromDictionary:@{
1103 Sync_types_list_disabled_key : Sync_types_list_disabled_values
1104 }];
Ewann570a6302021-08-17 07:22:421105 }
1106
Gauthier Ambard073eaa92021-11-22 15:24:131107 // If an incognito mode availability is set, set the value.
Tina Wangc6bcf572021-01-27 18:15:521108 NSString* incognito_policy_key =
1109 base::SysUTF8ToNSString(policy::key::kIncognitoModeAvailability);
1110 NSInteger incognito_mode_availability =
1111 [defaults integerForKey:incognito_policy_key];
1112 if (incognito_mode_availability) {
Tina Wangc6bcf572021-01-27 18:15:521113 [testing_policies addEntriesFromDictionary:@{
1114 incognito_policy_key : @(incognito_mode_availability),
1115 }];
1116 }
1117
Ewann40a8f8a2021-07-29 10:01:201118 NSString* restriction_pattern =
1119 [defaults stringForKey:@"RestrictAccountsToPatterns"];
1120 if ([restriction_pattern length] > 0) {
Ewannb3bee382021-08-16 09:12:291121 NSString* restrict_key =
1122 base::SysUTF8ToNSString(policy::key::kRestrictAccountsToPatterns);
Ewann40a8f8a2021-07-29 10:01:201123 [testing_policies addEntriesFromDictionary:@{
Ewannb3bee382021-08-16 09:12:291124 restrict_key : @[ restriction_pattern ]
Ewann40a8f8a2021-07-29 10:01:201125 }];
1126 }
1127
Vincent Boisselle19200bc2021-09-01 17:58:251128 // If the sign-in policy is set (not "None"), add the policy key to the list
1129 // of enabled experimental policies, and set the value.
1130 NSString* const kSigninPolicyKey = @"BrowserSignin";
1131 NSInteger signin_policy_mode = [defaults integerForKey:kSigninPolicyKey];
1132 if (signin_policy_mode) {
1133 // Remove the mode offset that was used to represent the unset policy.
1134 --signin_policy_mode;
1135 DCHECK(signin_policy_mode >= 0);
1136
Vincent Boisselle19200bc2021-09-01 17:58:251137 [testing_policies addEntriesFromDictionary:@{
1138 kSigninPolicyKey : @(signin_policy_mode),
1139 }];
1140 }
1141
Veronique Nguyen9b1044f2022-01-11 14:41:131142 // If the New Tab Page URL is set (not empty) add the value to the list of
1143 // test policies.
1144 NSString* ntp_location = [defaults stringForKey:@"NTPLocation"];
1145 if ([ntp_location length] > 0) {
1146 NSString* ntp_location_key =
1147 base::SysUTF8ToNSString(policy::key::kNewTabPageLocation);
1148 [testing_policies
1149 addEntriesFromDictionary:@{ntp_location_key : ntp_location}];
Veronique Nguyen302d8702022-01-12 21:18:571150 [allowed_experimental_policies addObject:ntp_location_key];
Veronique Nguyen9b1044f2022-01-11 14:41:131151 }
1152
Ali Juma9ec36d22022-03-28 14:53:121153 if ([defaults boolForKey:@"DisallowChromeDataInBackups"]) {
1154 NSString* allow_backups_key =
1155 base::SysUTF8ToNSString(policy::key::kAllowChromeDataInBackups);
1156 [testing_policies addEntriesFromDictionary:@{allow_backups_key : @NO}];
1157 [allowed_experimental_policies addObject:allow_backups_key];
1158 }
1159
Guillaume Jenkins25e9bd72020-08-27 17:39:061160 // If any experimental policy was allowed, set the EnableExperimentalPolicies
1161 // policy.
1162 if ([allowed_experimental_policies count] > 0) {
1163 [testing_policies setValue:allowed_experimental_policies
1164 forKey:base::SysUTF8ToNSString(
1165 policy::key::kEnableExperimentalPolicies)];
1166 }
1167
jlebel2eb40222022-05-06 11:15:421168 NSString* metrics_reporting_key = @"MetricsReportingEnabled";
1169 switch ([defaults integerForKey:metrics_reporting_key]) {
1170 case 1:
1171 // Metrics reporting forced.
1172 [testing_policies setValue:@(YES) forKey:metrics_reporting_key];
1173 break;
1174 case 2:
1175 // Metrics reporting disabled.
1176 [testing_policies setValue:@(NO) forKey:metrics_reporting_key];
1177 break;
1178 default:
1179 // Metrics reporting not managed.
1180 break;
1181 }
1182
David Jean6f85d44f2021-08-19 08:08:451183 // Warning: Add new flags to TestingPoliciesHash() below.
1184
David Jean5ca263c2021-08-18 09:19:301185 return testing_policies;
1186}
David Jean6f85d44f2021-08-19 08:08:451187
1188// Generates a unique NSString based on currently monitored policies from
1189// NSUserDefaults standardUserDefaults.
1190NSString* TestingPoliciesHash() {
1191 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1192 return [NSString
jlebel2eb40222022-05-06 11:15:421193 stringWithFormat:@"%d|%d|%d|%d|%@|%d|%d|%d|%d|%d|%d|%d|%d|%@|%d",
Ali Juma9ec36d22022-03-28 14:53:121194 [defaults boolForKey:@"DisallowChromeDataInBackups"],
David Jean6f85d44f2021-08-19 08:08:451195 [defaults boolForKey:@"EnableSyncDisabledPolicy"],
1196 [defaults boolForKey:@"EnableSamplePolicies"],
jlebel2eb40222022-05-06 11:15:421197 static_cast<int>([defaults
1198 integerForKey:@"IncognitoModeAvailability"]),
David Jean6f85d44f2021-08-19 08:08:451199 [defaults stringForKey:@"RestrictAccountsToPatterns"],
1200 [defaults boolForKey:@"SyncTypesListBookmarks"],
1201 [defaults boolForKey:@"SyncTypesListReadingList"],
1202 [defaults boolForKey:@"SyncTypesListPreferences"],
1203 [defaults boolForKey:@"SyncTypesListPasswords"],
1204 [defaults boolForKey:@"SyncTypesListAutofill"],
1205 [defaults boolForKey:@"SyncTypesListTypedUrls"],
jlebel2eb40222022-05-06 11:15:421206 [defaults boolForKey:@"SyncTypesListTabs"],
1207 static_cast<int>(
1208 [defaults integerForKey:@"BrowserSignin"]),
1209 [defaults stringForKey:@"NTPLocation"],
1210 static_cast<int>([defaults
1211 integerForKey:@"MetricsReportingEnabled"])];
David Jean6f85d44f2021-08-19 08:08:451212}
David Jean5ca263c2021-08-18 09:19:301213} // namespace
1214
1215// Add all switches from experimental flags to |command_line|.
1216void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) {
1217 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1218
1219 // Set the UA flag if UseMobileSafariUA is enabled.
1220 if ([defaults boolForKey:@"UseMobileSafariUA"]) {
1221 // Safari uses "Vesion/", followed by the OS version excluding bugfix, where
1222 // Chrome puts its product token.
1223 int32_t major = 0;
1224 int32_t minor = 0;
1225 int32_t bugfix = 0;
1226 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix);
1227 std::string product = base::StringPrintf("Version/%d.%d", major, minor);
1228
1229 command_line->AppendSwitchASCII(switches::kUserAgent,
1230 web::BuildMobileUserAgent(product));
1231 }
1232
1233 // Shared variables for all enterprise experimental flags.
Vincent Boisselleed0e6f1a2021-11-09 06:47:341234 NSMutableDictionary* testing_policies = CreateExperimentalTestingPolicies();
David Jean5ca263c2021-08-18 09:19:301235
1236 // If a CBCM enrollment token is provided, force Chrome Browser Cloud
1237 // Management to enabled and add the token to the list of policies.
1238 NSString* token_key =
1239 base::SysUTF8ToNSString(policy::key::kCloudManagementEnrollmentToken);
1240 NSString* token = [defaults stringForKey:token_key];
1241
1242 if ([token length] > 0) {
1243 command_line->AppendSwitch(switches::kEnableChromeBrowserCloudManagement);
1244 [testing_policies setValue:token forKey:token_key];
1245 }
1246
Vincent Boisselled042d552022-04-09 01:22:591247 if ([defaults boolForKey:@"EnableUserPolicy"]) {
1248 policy::EnableUserPolicy();
1249 }
1250
Guillaume Jenkins57606d72020-08-13 17:32:551251 // If some policies were set, commit them to the app's registration defaults.
1252 if ([testing_policies count] > 0) {
Guillaume Jenkinseeb7007c2020-06-25 22:55:401253 NSDictionary* registration_defaults =
1254 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
1255 [defaults registerDefaults:registration_defaults];
1256 }
1257
sdefresne14900ee2015-11-27 14:43:211258 // Freeform commandline flags. These are added last, so that any flags added
1259 // earlier in this function take precedence.
1260 if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) {
1261 base::CommandLine::StringVector flags;
1262 // Append an empty "program" argument.
1263 flags.push_back("");
1264
1265 // The number of flags corresponds to the number of text fields in
1266 // Experimental.plist.
1267 const int kNumFreeformFlags = 5;
1268 for (int i = 1; i <= kNumFreeformFlags; ++i) {
1269 NSString* key =
1270 [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i];
1271 NSString* flag = [defaults stringForKey:key];
1272 if ([flag length]) {
Robbie Gibsonc91ce622019-05-20 14:44:331273 // iOS keyboard replaces -- with —, so undo that.
1274 flag = [flag stringByReplacingOccurrencesOfString:@"—"
1275 withString:@"--"
1276 options:0
1277 range:NSMakeRange(0, 1)];
1278 // To make things easier, allow flags with no dashes by prepending them
1279 // here. This also allows for flags that just have one dash if they
1280 // exist.
1281 if (![flag hasPrefix:@"-"]) {
1282 flag = [@"--" stringByAppendingString:flag];
1283 }
sdefresne14900ee2015-11-27 14:43:211284 flags.push_back(base::SysNSStringToUTF8(flag));
1285 }
1286 }
1287
1288 base::CommandLine temp_command_line(flags);
1289 command_line->AppendArguments(temp_command_line, false);
1290 }
msardafc76f662017-02-24 12:46:281291
justincohendacc85d2017-06-28 23:34:101292 // Populate command line flag for 3rd party keyboard omnibox workaround.
1293 NSString* enableThirdPartyKeyboardWorkaround =
1294 [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"];
1295 if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) {
1296 command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround);
1297 } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) {
1298 command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround);
1299 }
1300
Sylvain Defresned3cd8d92022-01-18 13:35:081301 ios::provider::AppendSwitchesFromExperimentalSettings(defaults, command_line);
sdefresne14900ee2015-11-27 14:43:211302}
1303
David Jean5ca263c2021-08-18 09:19:301304void MonitorExperimentalSettingsChanges() {
David Jean5ca263c2021-08-18 09:19:301305 // Startup values for settings to be observed.
David Jean6f85d44f2021-08-19 08:08:451306 __block NSString* hash = TestingPoliciesHash();
David Jeane83ed652021-08-25 14:52:481307 static std::atomic_bool pending_check(false);
David Jean5ca263c2021-08-18 09:19:301308
1309 auto monitor = ^(NSNotification* notification) {
David Jeane83ed652021-08-25 14:52:481310 bool has_pending_check = pending_check.exchange(true);
1311 if (has_pending_check)
1312 return;
1313
David Jeanbc0fae32021-08-25 10:31:391314 // Can be called from any thread from where the notification was sent,
1315 // but since it may change standardUserDefaults, and that has to be on main
1316 // thread, dispatch to main thread.
1317 dispatch_async(dispatch_get_main_queue(), ^{
1318 // Check if observed settings have changed. Since source and destination
1319 // are both user defaults, this is required to avoid cycling back here.
1320 NSString* newHash = TestingPoliciesHash();
1321 if (![newHash isEqualToString:hash]) {
1322 hash = newHash;
David Jean5ca263c2021-08-18 09:19:301323
David Jeanbc0fae32021-08-25 10:31:391324 // Publish update.
1325 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1326 NSMutableDictionary* testing_policies =
Vincent Boisselleed0e6f1a2021-11-09 06:47:341327 CreateExperimentalTestingPolicies();
David Jeanbc0fae32021-08-25 10:31:391328 NSDictionary* registration_defaults =
1329 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
1330 [defaults registerDefaults:registration_defaults];
1331 }
David Jeane83ed652021-08-25 14:52:481332
1333 pending_check.store(false);
David Jeanbc0fae32021-08-25 10:31:391334 });
David Jean5ca263c2021-08-18 09:19:301335 };
1336
1337 NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
1338 [center addObserverForName:NSUserDefaultsDidChangeNotification
1339 object:nil
David Jeanbc0fae32021-08-25 10:31:391340 queue:nil
David Jean5ca263c2021-08-18 09:19:301341 usingBlock:monitor];
1342}
1343
sdefresne14900ee2015-11-27 14:43:211344void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage,
1345 base::CommandLine* command_line) {
Sylvain Defresne8327a2f2019-01-17 14:19:181346 GetGlobalFlagsState().ConvertFlagsToSwitches(
sdefresnec9763902015-12-02 10:30:111347 flags_storage, command_line, flags_ui::kAddSentinels,
Gregory Chatzinofff6523722017-11-21 01:33:531348 switches::kEnableFeatures, switches::kDisableFeatures);
sdefresne14900ee2015-11-27 14:43:211349}
1350
jkrcalbf073372016-07-29 07:21:311351std::vector<std::string> RegisterAllFeatureVariationParameters(
1352 flags_ui::FlagsStorage* flags_storage,
1353 base::FeatureList* feature_list) {
Justin Cohen2e2adb52019-10-25 17:00:021354 // Occasionally DCHECK crashes on canary can be very distuptive. An
1355 // experimental flag was added to aid in temporarily disabling this for
1356 // canary testers.
1357#if defined(DCHECK_IS_CONFIGURABLE)
1358 if (experimental_flags::AreDCHECKCrashesDisabled()) {
1359 std::vector<base::FeatureList::FeatureOverrideInfo> overrides;
1360 overrides.push_back(
1361 {std::cref(base::kDCheckIsFatalFeature),
1362 base::FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE});
1363 feature_list->RegisterExtraFeatureOverrides(std::move(overrides));
1364 }
1365#endif // defined(DCHECK_IS_CONFIGURABLE)
1366
Sylvain Defresne8327a2f2019-01-17 14:19:181367 return GetGlobalFlagsState().RegisterAllFeatureVariationParameters(
1368 flags_storage, feature_list);
jkrcalbf073372016-07-29 07:21:311369}
1370
sdefresne14900ee2015-11-27 14:43:211371void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage,
1372 flags_ui::FlagAccess access,
Matt Menke4d777572022-06-15 15:55:501373 base::Value::List& supported_entries,
1374 base::Value::List& unsupported_entries) {
Sylvain Defresne8327a2f2019-01-17 14:19:181375 GetGlobalFlagsState().GetFlagFeatureEntries(
sdefresne14900ee2015-11-27 14:43:211376 flags_storage, access, supported_entries, unsupported_entries,
Renjie Tang208c8192020-11-03 00:46:511377 base::BindRepeating(&SkipConditionalFeatureEntry));
sdefresne14900ee2015-11-27 14:43:211378}
1379
1380void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage,
1381 const std::string& internal_name,
1382 bool enable) {
Sylvain Defresne8327a2f2019-01-17 14:19:181383 GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name,
1384 enable);
sdefresne14900ee2015-11-27 14:43:211385}
1386
1387void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) {
Sylvain Defresne8327a2f2019-01-17 14:19:181388 GetGlobalFlagsState().ResetAllFlags(flags_storage);
sdefresne14900ee2015-11-27 14:43:211389}
1390
1391namespace testing {
1392
Elly Fong-Jones323ab1092021-08-23 22:36:311393base::span<const flags_ui::FeatureEntry> GetFeatureEntries() {
1394 return base::span<const flags_ui::FeatureEntry>(kFeatureEntries,
Daniel Cheng1f047a82022-02-26 10:04:531395 std::size(kFeatureEntries));
sdefresne14900ee2015-11-27 14:43:211396}
1397
1398} // namespace testing