blob: 704b6bbbaaafe8edfd0911fa65de94d64776b62a [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"
Peter Boström3f798572022-07-26 23:44:3618#import "base/debug/debugging_buildflags.h"
David Jean5ca263c2021-08-18 09:19:3019#import "base/mac/foundation_util.h"
Sylvain Defresne8327a2f2019-01-17 14:19:1820#include "base/no_destructor.h"
sdefresne14900ee2015-11-27 14:43:2121#include "base/strings/stringprintf.h"
22#include "base/strings/sys_string_conversions.h"
Sebastien Marchand75a7cdf2018-11-13 23:47:0323#include "base/system/sys_info.h"
Mohamad Ahmadic4df81f2017-12-20 04:41:5924#include "components/autofill/core/common/autofill_features.h"
Jared Sauld998539f2019-03-19 15:11:1725#include "components/autofill/core/common/autofill_payments_features.h"
Moe Ahmadid6d5d172018-06-20 17:20:2326#include "components/autofill/core/common/autofill_switches.h"
Olivier Robin3d60411622018-02-23 10:03:2227#include "components/autofill/ios/browser/autofill_switches.h"
Jesse McKenna85c1a59f2021-05-05 19:08:3028#include "components/breadcrumbs/core/features.h"
Matt Jones125dfb42022-02-11 17:23:4229#include "components/commerce/core/commerce_feature_list.h"
30#include "components/commerce/core/flag_descriptions.h"
Robbie Gibson5e3436632020-04-27 15:48:0431#include "components/content_settings/core/common/features.h"
sdefresne14900ee2015-11-27 14:43:2132#include "components/dom_distiller/core/dom_distiller_switches.h"
Guillaume Jenkins4e6ac1e2020-11-11 16:57:4033#include "components/enterprise/browser/enterprise_switches.h"
Tommy Nyquistc1d6dea12017-07-26 20:37:2334#include "components/feature_engagement/public/feature_constants.h"
35#include "components/feature_engagement/public/feature_list.h"
edchind847c0962021-03-03 18:17:0536#include "components/feed/feed_feature_list.h"
sdefresne14900ee2015-11-27 14:43:2137#include "components/flags_ui/feature_entry.h"
38#include "components/flags_ui/feature_entry_macros.h"
39#include "components/flags_ui/flags_storage.h"
40#include "components/flags_ui/flags_ui_switches.h"
Tanja Gornakb0985dd2018-10-11 17:24:4041#include "components/invalidation/impl/invalidation_switches.h"
noyau4cfb1332016-10-25 17:05:4242#include "components/ntp_tiles/switches.h"
Justin Donnelly33d712e2017-08-23 21:32:5143#include "components/omnibox/browser/omnibox_field_trial.h"
Tomasz Wiszkowskid938a1112019-03-06 18:01:5744#include "components/omnibox/common/omnibox_features.h"
Raj T3898f032021-08-19 23:51:2745#include "components/optimization_guide/core/optimization_guide_features.h"
Raj Ta921ffc2022-08-25 19:00:2046#import "components/optimization_guide/core/optimization_guide_switches.h"
Ioana Pandeled14ce9e2017-11-28 14:41:4647#include "components/password_manager/core/common/password_manager_features.h"
mathp9b4c11d2017-07-06 20:24:1348#include "components/payments/core/features.h"
Igor Ruvinova43a66dc2022-06-09 21:57:4549#include "components/policy/core/common/features.h"
Guillaume Jenkinseeb7007c2020-06-25 22:55:4050#import "components/policy/core/common/policy_loader_ios_constants.h"
51#include "components/policy/policy_constants.h"
Joemer Ramos34175732022-02-14 18:59:1652#include "components/safe_browsing/core/common/features.h"
Victor Hugo Vianna Silva0399402f2021-09-07 21:41:2553#import "components/send_tab_to_self/features.h"
Tommy Martino0caf3362021-01-13 20:29:5854#include "components/shared_highlighting/core/common/shared_highlighting_features.h"
Valeriya Sinevicha79dc612018-09-25 14:49:0955#include "components/signin/core/browser/account_reconcilor.h"
Jérôme Lebelc374fdd2019-09-27 10:36:4856#include "components/signin/ios/browser/features.h"
Colin Blundell3517170e2019-07-11 08:16:3457#include "components/signin/public/base/signin_switches.h"
sdefresne36579782016-02-05 11:08:2558#include "components/strings/grit/components_strings.h"
Victor Hugo Vianna Silvaa48aa01c2022-02-09 20:38:2359#include "components/sync/base/command_line_switches.h"
60#include "components/sync/base/features.h"
Ewann570a6302021-08-17 07:22:4261#include "components/sync/base/pref_names.h"
Moe Ahmadie4cce1f2018-12-18 23:48:0162#include "components/translate/core/browser/translate_prefs.h"
Olivier Robinffe767c2022-04-21 13:13:2363#include "components/translate/core/common/translate_util.h"
Ed Chin91e44992022-07-27 13:42:3464#import "ios/chrome/app/background_mode_buildflags.h"
Sylvain Defresneae6987e2018-03-01 13:21:4065#include "ios/chrome/browser/browsing_data/browsing_data_features.h"
sdefresne14900ee2015-11-27 14:43:2166#include "ios/chrome/browser/chrome_switches.h"
Eugene But2823dc7e2020-07-21 18:10:3767#include "ios/chrome/browser/crash_report/features.h"
Nazerke21bdc45a2019-07-11 09:02:0568#include "ios/chrome/browser/flags/ios_chrome_flag_descriptions.h"
Ed Chin100660bf2022-04-26 16:59:1369#import "ios/chrome/browser/ntp/features.h"
Vincent Boissellead6cbe22022-07-04 19:32:3970#import "ios/chrome/browser/policy/cloud/user_policy_switch.h"
Vincent Boisselle19200bc2021-09-01 17:58:2571#include "ios/chrome/browser/policy/policy_util.h"
Benjamin Williams14233d72022-07-26 18:32:2072#import "ios/chrome/browser/promos_manager/features.h"
Sylvain Defresne9c107082020-10-27 16:39:1373#include "ios/chrome/browser/screen_time/screen_time_buildflags.h"
Olivier Robin3a957df2021-12-21 18:04:3474#import "ios/chrome/browser/sessions/session_features.h"
Gauthier Ambard33e03302019-02-21 13:28:5875#include "ios/chrome/browser/system_flags.h"
Zhixiang Teoh40027a22022-07-28 03:24:3476#import "ios/chrome/browser/text_selection/text_selection_util.h"
Ernesto Izquierdo Clua7f4e36e22022-07-01 09:38:3677#include "ios/chrome/browser/ui/autofill/features.h"
Louis Romeroac04f786a2022-04-19 09:39:3078#include "ios/chrome/browser/ui/bubble/bubble_features.h"
adamta22a4d502020-05-21 03:12:2179#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h"
Javier Ernesto Flores Robles209b2822021-03-25 19:16:5080#import "ios/chrome/browser/ui/default_promo/default_browser_utils.h"
Ewann1a9d33d2021-06-14 11:12:2481#import "ios/chrome/browser/ui/download/features.h"
Rohit Rao5aa791a2022-08-19 17:34:5382#import "ios/chrome/browser/ui/first_run/field_trial_constants.h"
Chris Lu438e1c052022-08-17 02:57:0083#import "ios/chrome/browser/ui/first_run/trending_queries_field_trial.h"
Kurt Horimoto4da682b022018-04-12 07:43:3584#import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h"
adamta273568472020-12-04 23:53:5785#import "ios/chrome/browser/ui/ntp/new_tab_page_feature.h"
Christian Xub8c06cd2022-04-29 20:55:0186#import "ios/chrome/browser/ui/omnibox/omnibox_ui_features.h"
Robbie Gibson686c56732021-10-04 17:11:4587#import "ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.h"
Gauthier Ambard30ad9ca2022-06-09 14:15:2688#import "ios/chrome/browser/ui/popup_menu/public/features.h"
gogerald0ff29e52021-02-03 18:56:1989#import "ios/chrome/browser/ui/start_surface/start_surface_features.h"
Kurt Horimoto79d590b2018-09-12 19:09:2890#import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h"
Justin Cohen2d81c582018-01-22 14:46:4491#include "ios/chrome/browser/ui/ui_feature_flags.h"
Yi Su392b3032018-06-05 07:26:4792#include "ios/chrome/browser/web/features.h"
sdefresne14900ee2015-11-27 14:43:2193#include "ios/chrome/grit/ios_strings.h"
Mustafa Emre Acer4de8863a2022-05-03 22:17:0194#include "ios/components/security_interstitials/https_only_mode/feature.h"
Sylvain Defresne559ce5f2022-01-13 17:14:5895#include "ios/public/provider/chrome/browser/app_utils/app_utils_api.h"
Eugene But61818bc2019-04-15 21:04:0796#include "ios/web/common/features.h"
Eugene Bute79f2742019-07-26 17:07:2297#include "ios/web/common/user_agent.h"
Eugene Butb1416232019-07-22 17:31:5898#include "ios/web/common/web_view_creation_util.h"
sdefresne14900ee2015-11-27 14:43:2199
Sylvain Defresne9c107082020-10-27 16:39:13100#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
101#include "ios/chrome/browser/screen_time/features.h"
102#endif
103
sdefresne14900ee2015-11-27 14:43:21104#if !defined(OFFICIAL_BUILD)
105#include "components/variations/variations_switches.h"
vitaliii489217aa2017-01-30 14:50:22106#endif
stkhapuginc1be1792016-12-13 14:30:53107
108#if !defined(__has_feature) || !__has_feature(objc_arc)
109#error "This file requires ARC support."
110#endif
sdefresne14900ee2015-11-27 14:43:21111
elawrence816f6790e2017-06-16 18:19:28112using flags_ui::FeatureEntry;
113
sdefresne14900ee2015-11-27 14:43:21114namespace {
Emily Starkbafa9062017-12-27 15:22:46115
Olivier Robin3d60411622018-02-23 10:03:22116const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = {
117 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
118 {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"},
119 {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"},
120 {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"},
121 {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"},
122 {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"},
123 {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"},
124 {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"},
125 {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"},
126};
127
Nohemi Fernandez222d6d42020-09-30 20:35:57128const FeatureEntry::Choice kDelayThresholdMinutesToUpdateGaiaCookieChoices[] = {
129 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
130 {"0", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "0"},
131 {"10", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "10"},
132 {"60", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "60"},
133};
134
Nohemi Fernandezc00842a2021-07-26 11:47:34135const FeatureEntry::Choice
136 kWaitThresholdMillisecondsForCapabilitiesApiChoices[] = {
137 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
138 {"200", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "200"},
139 {"500", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "500"},
140 {"5000", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "5000"},
141};
142
Stepan Khapugincc4e9842019-01-23 13:38:13143const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = {
144 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}};
145const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = {
146 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}};
147const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = {
148 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}};
149const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = {
150 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}};
151const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = {
152 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}};
153const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = {
154 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}};
155const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = {
156 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}};
157
158const FeatureEntry::FeatureVariation
159 kOmniboxUIMaxAutocompleteMatchesVariations[] = {
160 {"3 matches", kOmniboxUIMaxAutocompleteMatches3,
Daniel Cheng1f047a82022-02-26 10:04:53161 std::size(kOmniboxUIMaxAutocompleteMatches3), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13162 {"4 matches", kOmniboxUIMaxAutocompleteMatches4,
Daniel Cheng1f047a82022-02-26 10:04:53163 std::size(kOmniboxUIMaxAutocompleteMatches4), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13164 {"5 matches", kOmniboxUIMaxAutocompleteMatches5,
Daniel Cheng1f047a82022-02-26 10:04:53165 std::size(kOmniboxUIMaxAutocompleteMatches5), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13166 {"6 matches", kOmniboxUIMaxAutocompleteMatches6,
Daniel Cheng1f047a82022-02-26 10:04:53167 std::size(kOmniboxUIMaxAutocompleteMatches6), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13168 {"8 matches", kOmniboxUIMaxAutocompleteMatches8,
Daniel Cheng1f047a82022-02-26 10:04:53169 std::size(kOmniboxUIMaxAutocompleteMatches8), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13170 {"10 matches", kOmniboxUIMaxAutocompleteMatches10,
Daniel Cheng1f047a82022-02-26 10:04:53171 std::size(kOmniboxUIMaxAutocompleteMatches10), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13172 {"12 matches", kOmniboxUIMaxAutocompleteMatches12,
Daniel Cheng1f047a82022-02-26 10:04:53173 std::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}};
Stepan Khapugincc4e9842019-01-23 13:38:13174
Stepan Khapuginbac467e2022-05-06 21:11:54175const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches6[] = {
176 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "6"}};
177const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches15[] = {
178 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "15"}};
179const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches20[] = {
180 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "20"}};
181
182const FeatureEntry::FeatureVariation kOmniboxMaxZPSMatchesVariations[] = {
183 {"6 matches", kOmniboxMaxZPSMatches6, std::size(kOmniboxMaxZPSMatches6),
184 nullptr},
185 {"15 matches", kOmniboxMaxZPSMatches15, std::size(kOmniboxMaxZPSMatches15),
186 nullptr},
187 {"20 matches", kOmniboxMaxZPSMatches20, std::size(kOmniboxMaxZPSMatches20),
188 nullptr},
189};
190
Christian Xucf26d562022-07-06 09:28:36191const FeatureEntry::FeatureParam kOmniboxMaxURLMatches5[] = {
192 {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "5"}};
193const FeatureEntry::FeatureParam kOmniboxMaxURLMatches6[] = {
194 {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "6"}};
195const FeatureEntry::FeatureParam kOmniboxMaxURLMatches7[] = {
196 {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "7"}};
197
198const FeatureEntry::FeatureVariation kOmniboxMaxURLMatchesVariations[] = {
199 {"5 matches", kOmniboxMaxURLMatches5, std::size(kOmniboxMaxURLMatches5),
200 nullptr},
201 {"6 matches", kOmniboxMaxURLMatches6, std::size(kOmniboxMaxURLMatches6),
202 nullptr},
203 {"7 matches", kOmniboxMaxURLMatches7, std::size(kOmniboxMaxURLMatches7),
204 nullptr},
205};
206
Caitlin Fischer37e01232019-05-24 13:05:45207const FeatureEntry::FeatureParam
208 kAutofillUseMobileLabelDisambiguationShowAll[] = {
209 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
210 autofill::features::
211 kAutofillUseMobileLabelDisambiguationParameterShowAll}};
212const FeatureEntry::FeatureParam
213 kAutofillUseMobileLabelDisambiguationShowOne[] = {
214 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
215 autofill::features::
216 kAutofillUseMobileLabelDisambiguationParameterShowOne}};
217
218const FeatureEntry::FeatureVariation
219 kAutofillUseMobileLabelDisambiguationVariations[] = {
220 {"(show all)", kAutofillUseMobileLabelDisambiguationShowAll,
Daniel Cheng1f047a82022-02-26 10:04:53221 std::size(kAutofillUseMobileLabelDisambiguationShowAll), nullptr},
Caitlin Fischer37e01232019-05-24 13:05:45222 {"(show one)", kAutofillUseMobileLabelDisambiguationShowOne,
Daniel Cheng1f047a82022-02-26 10:04:53223 std::size(kAutofillUseMobileLabelDisambiguationShowOne), nullptr}};
Caitlin Fischer37e01232019-05-24 13:05:45224
Javier Ernesto Flores Roblese85f4a12021-02-23 18:10:10225const FeatureEntry::FeatureParam
Javier Ernesto Flores Robles159414232021-06-16 14:29:59226 kDefaultBrowserFullscreenPromoExperimentRemindMeLater[] = {
227 {kDefaultBrowserFullscreenPromoExperimentRemindMeGroupParam, "true"}};
228const FeatureEntry::FeatureVariation
229 kDefaultBrowserFullscreenPromoExperimentVariations[] = {
230 {"Remind me later",
231 kDefaultBrowserFullscreenPromoExperimentRemindMeLater,
Daniel Cheng1f047a82022-02-26 10:04:53232 std::size(kDefaultBrowserFullscreenPromoExperimentRemindMeLater),
Javier Ernesto Flores Robles159414232021-06-16 14:29:59233 nullptr}};
234
gogeralddb0d8ae2020-11-13 03:56:58235const FeatureEntry::FeatureParam kDiscoverFeedInNtpEnableNativeUI[] = {
236 {kDiscoverFeedIsNativeUIEnabled, "true"}};
237const FeatureEntry::FeatureVariation kDiscoverFeedInNtpVariations[] = {
238 {"Native UI", kDiscoverFeedInNtpEnableNativeUI,
Daniel Cheng1f047a82022-02-26 10:04:53239 std::size(kDiscoverFeedInNtpEnableNativeUI), nullptr}};
gogeralddb0d8ae2020-11-13 03:56:58240
Sergio Collazos9fcc6ed2021-10-06 00:58:03241const FeatureEntry::FeatureParam kDiscoverFeedSRSReconstructedTemplates[] = {
242 {kDiscoverFeedSRSReconstructedTemplatesEnabled, "true"}};
243const FeatureEntry::FeatureParam kDiscoverFeedSRSPreloadTemplates[] = {
244 {kDiscoverFeedSRSPreloadTemplatesEnabled, "true"}};
245const FeatureEntry::FeatureVariation
246 kEnableDiscoverFeedStaticResourceServingVariations[] = {
247 {"Reconstruct Templates", kDiscoverFeedSRSReconstructedTemplates,
Daniel Cheng1f047a82022-02-26 10:04:53248 std::size(kDiscoverFeedSRSReconstructedTemplates), nullptr},
Sergio Collazos9fcc6ed2021-10-06 00:58:03249 {"Preload Templates", kDiscoverFeedSRSPreloadTemplates,
Daniel Cheng1f047a82022-02-26 10:04:53250 std::size(kDiscoverFeedSRSPreloadTemplates), nullptr},
Sergio Collazos9fcc6ed2021-10-06 00:58:03251};
252
Mohammad Refaatab6bee62022-05-16 16:31:15253const FeatureEntry::FeatureParam kDiscoverFeedTopSyncPromoFullWithTitle[] = {
adamtadb0bfc62022-08-01 17:37:47254 {kDiscoverFeedTopSyncPromoStyleFullWithTitle, "true"},
255 {kDiscoverFeedTopSyncPromoStyleCompact, "false"}};
Mohammad Refaatab6bee62022-05-16 16:31:15256const FeatureEntry::FeatureParam kDiscoverFeedTopSyncPromoCompact[] = {
adamtadb0bfc62022-08-01 17:37:47257 {kDiscoverFeedTopSyncPromoStyleFullWithTitle, "false"},
258 {kDiscoverFeedTopSyncPromoStyleCompact, "true"}};
259
Mohammad Refaatab6bee62022-05-16 16:31:15260const FeatureEntry::FeatureVariation kDiscoverFeedTopSyncPromoVariations[] = {
261 {"Full with title", kDiscoverFeedTopSyncPromoFullWithTitle,
262 std::size(kDiscoverFeedTopSyncPromoFullWithTitle), nullptr},
263 {"Compact", kDiscoverFeedTopSyncPromoCompact,
264 std::size(kDiscoverFeedTopSyncPromoCompact), nullptr}};
265
Robbie Gibson46351032022-03-31 19:46:23266const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion1[] = {
267 {kIOSOmniboxUpdatedPopupUIVariationName,
268 kIOSOmniboxUpdatedPopupUIVariation1}};
269const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion2[] = {
270 {kIOSOmniboxUpdatedPopupUIVariationName,
271 kIOSOmniboxUpdatedPopupUIVariation2}};
Stepan Khapugin0fd1869a2022-08-09 10:23:47272const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion3[] = {
273 {kIOSOmniboxUpdatedPopupUIVariationName,
274 kIOSOmniboxUpdatedPopupUIVariation1UIKit}};
275const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion4[] = {
276 {kIOSOmniboxUpdatedPopupUIVariationName,
277 kIOSOmniboxUpdatedPopupUIVariation2UIKit}};
Robbie Gibson46351032022-03-31 19:46:23278const FeatureEntry::FeatureVariation kiOSOmniboxUpdatedPopupUIVariations[] = {
Stepan Khapugin0fd1869a2022-08-09 10:23:47279 {"Version 1 - SwiftUI", kiOSOmniboxUpdatedPopupUIVersion1,
Robbie Gibson46351032022-03-31 19:46:23280 std::size(kiOSOmniboxUpdatedPopupUIVersion1), nullptr},
Stepan Khapugin0fd1869a2022-08-09 10:23:47281 {"Version 2 - SwiftUI", kiOSOmniboxUpdatedPopupUIVersion2,
282 std::size(kiOSOmniboxUpdatedPopupUIVersion2), nullptr},
283 {"Version 1 - UIKit", kiOSOmniboxUpdatedPopupUIVersion3,
284 std::size(kiOSOmniboxUpdatedPopupUIVersion3), nullptr},
285 {"Version 2 - UIKit", kiOSOmniboxUpdatedPopupUIVersion4,
286 std::size(kiOSOmniboxUpdatedPopupUIVersion4), nullptr}};
Robbie Gibson46351032022-03-31 19:46:23287
gogerald53c6e7a2021-04-15 22:07:35288const FeatureEntry::FeatureParam kStartSurfaceTenSecondsShrinkLogo[] = {
Chris Lu5470417c2021-03-03 18:43:08289 {kStartSurfaceShrinkLogoParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35290 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
291const FeatureEntry::FeatureParam kStartSurfaceTenSecondsHideShortcuts[] = {
Chris Lu5470417c2021-03-03 18:43:08292 {kStartSurfaceHideShortcutsParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35293 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
294const FeatureEntry::FeatureParam kStartSurfaceTenSecondsReturnToRecentTab[] = {
Chris Lu5470417c2021-03-03 18:43:08295 {kStartSurfaceReturnToRecentTabParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35296 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
297const FeatureEntry::FeatureParam
298 kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab[] = {
299 {kStartSurfaceShrinkLogoParam, "true"},
300 {kStartSurfaceReturnToRecentTabParam, "true"},
301 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
302const FeatureEntry::FeatureParam
303 kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab[] = {
304 {kStartSurfaceHideShortcutsParam, "true"},
305 {kStartSurfaceReturnToRecentTabParam, "true"},
306 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
307const FeatureEntry::FeatureParam kStartSurfaceOneHourShrinkLogo[] = {
Chris Lu5470417c2021-03-03 18:43:08308 {kStartSurfaceShrinkLogoParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35309 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
310const FeatureEntry::FeatureParam kStartSurfaceOneHourHideShortcuts[] = {
311 {kStartSurfaceHideShortcutsParam, "true"},
312 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
313const FeatureEntry::FeatureParam kStartSurfaceOneHourReturnToRecentTab[] = {
Chris Lu5470417c2021-03-03 18:43:08314 {kStartSurfaceReturnToRecentTabParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35315 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
316const FeatureEntry::FeatureParam
317 kStartSurfaceOneHourShrinkLogoReturnToRecentTab[] = {
318 {kStartSurfaceShrinkLogoParam, "true"},
319 {kStartSurfaceReturnToRecentTabParam, "true"},
320 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
321const FeatureEntry::FeatureParam
322 kStartSurfaceOneHourHideShortcutsReturnToRecentTab[] = {
323 {kStartSurfaceHideShortcutsParam, "true"},
324 {kStartSurfaceReturnToRecentTabParam, "true"},
325 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
Chris Lu5470417c2021-03-03 18:43:08326
gogerald0e39e3aa2021-02-10 18:41:23327const FeatureEntry::FeatureVariation kStartSurfaceVariations[] = {
gogerald53c6e7a2021-04-15 22:07:35328 {"10s:Show Return to Recent Tab tile",
329 kStartSurfaceTenSecondsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53330 std::size(kStartSurfaceTenSecondsReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35331 {"10s:Shrink Logo", kStartSurfaceTenSecondsShrinkLogo,
Daniel Cheng1f047a82022-02-26 10:04:53332 std::size(kStartSurfaceTenSecondsShrinkLogo), nullptr},
gogerald53c6e7a2021-04-15 22:07:35333 {"10s:Hide Shortcuts", kStartSurfaceTenSecondsHideShortcuts,
Daniel Cheng1f047a82022-02-26 10:04:53334 std::size(kStartSurfaceTenSecondsHideShortcuts), nullptr},
gogerald53c6e7a2021-04-15 22:07:35335 {"10s:Shrink Logo and show Return to Recent Tab tile",
336 kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53337 std::size(kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35338 {"10s:Hide Shortcuts and show Return to Recent Tab tile",
339 kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53340 std::size(kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35341 {"1h:Show Return to Recent Tab tile", kStartSurfaceOneHourReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53342 std::size(kStartSurfaceOneHourReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35343 {"1h:Shrink Logo", kStartSurfaceOneHourShrinkLogo,
Daniel Cheng1f047a82022-02-26 10:04:53344 std::size(kStartSurfaceOneHourShrinkLogo), nullptr},
gogerald53c6e7a2021-04-15 22:07:35345 {"1h:Hide Shortcuts", kStartSurfaceOneHourHideShortcuts,
Daniel Cheng1f047a82022-02-26 10:04:53346 std::size(kStartSurfaceOneHourHideShortcuts), nullptr},
gogerald53c6e7a2021-04-15 22:07:35347 {"1h:Shrink Logo and show Return to Recent Tab tile",
348 kStartSurfaceOneHourShrinkLogoReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53349 std::size(kStartSurfaceOneHourShrinkLogoReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35350 {"1h:Hide Shortcuts and show Return to Recent Tab tile",
351 kStartSurfaceOneHourHideShortcutsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53352 std::size(kStartSurfaceOneHourHideShortcutsReturnToRecentTab), nullptr},
Chris Lu5470417c2021-03-03 18:43:08353};
gogerald0e39e3aa2021-02-10 18:41:23354
Ed Chin91e44992022-07-27 13:42:34355#if BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
Ed Chin59f617b2022-07-19 22:12:04356// Feed Background Refresh Feature Params
Ed Chin321b8fe2022-08-16 07:02:01357const FeatureEntry::FeatureParam kOneHourIntervalOneHourMaxAgeOnce[] = {
Ed Chin59f617b2022-07-19 22:12:04358 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
359 {kEnableRecurringBackgroundRefreshSchedule, "false"},
Ed Chin321b8fe2022-08-16 07:02:01360 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
Ed Chin59f617b2022-07-19 22:12:04361 {kBackgroundRefreshIntervalInSeconds, /* 60*60= */ "3600"}};
Ed Chin321b8fe2022-08-16 07:02:01362const FeatureEntry::FeatureParam kFourHourIntervalSixHourMaxAgeOnce[] = {
Ed Chin59f617b2022-07-19 22:12:04363 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
364 {kEnableRecurringBackgroundRefreshSchedule, "false"},
Ed Chin321b8fe2022-08-16 07:02:01365 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
Ed Chin59f617b2022-07-19 22:12:04366 {kBackgroundRefreshIntervalInSeconds, /* 4*60*60= */ "14400"}};
Ed Chin321b8fe2022-08-16 07:02:01367const FeatureEntry::FeatureParam kOneHourIntervalOneHourMaxAgeRecurring[] = {
Ed Chin59f617b2022-07-19 22:12:04368 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
369 {kEnableRecurringBackgroundRefreshSchedule, "true"},
Ed Chin321b8fe2022-08-16 07:02:01370 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
Ed Chin59f617b2022-07-19 22:12:04371 {kBackgroundRefreshIntervalInSeconds, /* 60*60= */ "3600"}};
Ed Chin321b8fe2022-08-16 07:02:01372const FeatureEntry::FeatureParam kFourHourIntervalSixHourMaxAgeRecurring[] = {
Ed Chin59f617b2022-07-19 22:12:04373 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
374 {kEnableRecurringBackgroundRefreshSchedule, "true"},
Ed Chin321b8fe2022-08-16 07:02:01375 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
Ed Chin59f617b2022-07-19 22:12:04376 {kBackgroundRefreshIntervalInSeconds, /* 4*60*60= */ "14400"}};
Ed Chin321b8fe2022-08-16 07:02:01377const FeatureEntry::FeatureParam kServerDrivenOneHourMaxAgeOnce[] = {
Ed Chin59f617b2022-07-19 22:12:04378 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
379 {kEnableRecurringBackgroundRefreshSchedule, "false"},
Ed Chin321b8fe2022-08-16 07:02:01380 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
381 {kBackgroundRefreshIntervalInSeconds, "0"}};
382const FeatureEntry::FeatureParam kServerDrivenOneHourMaxAgeRecurring[] = {
Ed Chin59f617b2022-07-19 22:12:04383 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
384 {kEnableRecurringBackgroundRefreshSchedule, "true"},
Ed Chin321b8fe2022-08-16 07:02:01385 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
386 {kBackgroundRefreshIntervalInSeconds, "0"}};
387const FeatureEntry::FeatureParam kServerDrivenSixHourMaxAgeOnce[] = {
388 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
389 {kEnableRecurringBackgroundRefreshSchedule, "false"},
390 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
391 {kBackgroundRefreshIntervalInSeconds, "0"}};
392const FeatureEntry::FeatureParam kServerDrivenSixHourMaxAgeRecurring[] = {
393 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
394 {kEnableRecurringBackgroundRefreshSchedule, "true"},
395 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
396 {kBackgroundRefreshIntervalInSeconds, "0"}};
Ed Chin59f617b2022-07-19 22:12:04397
398// Feed Background Refresh Feature Variations
Ed Chin59f617b2022-07-19 22:12:04399const FeatureEntry::FeatureVariation kFeedBackgroundRefreshVariations[] = {
Ed Chin321b8fe2022-08-16 07:02:01400 {"1hr Interval 1hr Max Age Once", kOneHourIntervalOneHourMaxAgeOnce,
401 std::size(kOneHourIntervalOneHourMaxAgeOnce), nullptr},
402 {"4hr Interval 6hr Max Age Once", kFourHourIntervalSixHourMaxAgeOnce,
403 std::size(kFourHourIntervalSixHourMaxAgeOnce), nullptr},
404 {"1hr Interval 1hr Max Age Recurring",
405 kOneHourIntervalOneHourMaxAgeRecurring,
406 std::size(kOneHourIntervalOneHourMaxAgeRecurring), nullptr},
407 {"4hr Interval 6hr Max Age Recurring",
408 kFourHourIntervalSixHourMaxAgeRecurring,
409 std::size(kFourHourIntervalSixHourMaxAgeRecurring), nullptr},
410 {"Server Driven 1hr Max Age Once", kServerDrivenOneHourMaxAgeOnce,
411 std::size(kServerDrivenOneHourMaxAgeOnce), nullptr},
412 {"Server Driven 1hr Max Age Recurring", kServerDrivenOneHourMaxAgeRecurring,
413 std::size(kServerDrivenOneHourMaxAgeRecurring), nullptr},
414 {"Server Driven 6hr Max Age Once", kServerDrivenSixHourMaxAgeOnce,
415 std::size(kServerDrivenSixHourMaxAgeOnce), nullptr},
416 {"Server Driven 6hr Max Age Recurring", kServerDrivenSixHourMaxAgeRecurring,
417 std::size(kServerDrivenSixHourMaxAgeRecurring), nullptr},
Ed Chin59f617b2022-07-19 22:12:04418};
Ed Chin91e44992022-07-27 13:42:34419#endif // BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
Ed Chin59f617b2022-07-19 22:12:04420
ginnnnnnny46435132022-06-01 16:06:04421const FeatureEntry::FeatureParam kFREDefaultBrowserPromoDefaultDelay[] = {
422 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoDefaultDelayParam}};
423const FeatureEntry::FeatureParam kFREDefaultBrowserPromoFirstRunOnly[] = {
424 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoFirstRunOnlyParam}};
425const FeatureEntry::FeatureParam kFREDefaultBrowserPromoShortDelay[] = {
426 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoShortDelayParam}};
427const FeatureEntry::FeatureVariation kFREDefaultBrowserPromoVariations[] = {
Aliona DANGLA8fae66f02021-10-06 15:47:11428 {"Wait 14 days after FRE default browser promo",
ginnnnnnny46435132022-06-01 16:06:04429 kFREDefaultBrowserPromoDefaultDelay,
430 std::size(kFREDefaultBrowserPromoDefaultDelay), nullptr},
431 {"FRE default browser promo only", kFREDefaultBrowserPromoFirstRunOnly,
432 std::size(kFREDefaultBrowserPromoFirstRunOnly), nullptr},
Aliona DANGLA8fae66f02021-10-06 15:47:11433 {"Wait 3 days after FRE default browser promo",
ginnnnnnny46435132022-06-01 16:06:04434 kFREDefaultBrowserPromoShortDelay,
435 std::size(kFREDefaultBrowserPromoShortDelay), nullptr},
Aliona DANGLA8fae66f02021-10-06 15:47:11436};
437
Chris Luc9a5cb12022-07-20 16:11:39438const FeatureEntry::FeatureParam kTrendingQueriesEnableAllUsers[] = {
439 {kTrendingQueriesHideShortcutsParam, "false"},
440 {kTrendingQueriesDisabledFeedParam, "false"},
441 {kTrendingQueriesSignedOutParam, "false"}};
442const FeatureEntry::FeatureParam kTrendingQueriesEnableAllUsersHideShortcuts[] =
443 {{kTrendingQueriesHideShortcutsParam, "true"},
444 {kTrendingQueriesDisabledFeedParam, "false"},
445 {kTrendingQueriesSignedOutParam, "false"}};
446const FeatureEntry::FeatureParam kTrendingQueriesEnableFeedDisabled[] = {
447 {kTrendingQueriesHideShortcutsParam, "false"},
448 {kTrendingQueriesDisabledFeedParam, "true"},
449 {kTrendingQueriesSignedOutParam, "false"}};
450const FeatureEntry::FeatureParam kTrendingQueriesEnableSignedOut[] = {
451 {kTrendingQueriesHideShortcutsParam, "true"},
452 {kTrendingQueriesDisabledFeedParam, "false"},
453 {kTrendingQueriesSignedOutParam, "true"}};
Chris Luecd575f2022-08-05 23:23:06454const FeatureEntry::FeatureParam
455 kTrendingQueriesEnableNeverShowHideShortcuts[] = {
456 {kTrendingQueriesHideShortcutsParam, "true"},
457 {kTrendingQueriesDisabledFeedParam, "false"},
458 {kTrendingQueriesSignedOutParam, "false"},
459 {kTrendingQueriesNeverShowModuleParam, "true"}};
Chris Luc9a5cb12022-07-20 16:11:39460
461const FeatureEntry::FeatureVariation kTrendingQueriesModuleVariations[] = {
462 {"Enabled All Users", kTrendingQueriesEnableAllUsers,
463 std::size(kTrendingQueriesEnableAllUsers), nullptr},
464 {"Enabled All Users Hide Shortcuts",
465 kTrendingQueriesEnableAllUsersHideShortcuts,
466 std::size(kTrendingQueriesEnableAllUsersHideShortcuts), nullptr},
467 {"Enabled Disabled Feed", kTrendingQueriesEnableFeedDisabled,
468 std::size(kTrendingQueriesEnableFeedDisabled), nullptr},
469 {"Enabled Signed Out", kTrendingQueriesEnableSignedOut,
470 std::size(kTrendingQueriesEnableSignedOut), nullptr},
Chris Luecd575f2022-08-05 23:23:06471 {"Enabled Never Show and Hide Shortcuts",
472 kTrendingQueriesEnableNeverShowHideShortcuts,
473 std::size(kTrendingQueriesEnableNeverShowHideShortcuts), nullptr},
474
Chris Luc9a5cb12022-07-20 16:11:39475};
476
jlebel041fc1c2022-03-04 12:53:30477const FeatureEntry::FeatureParam kNewMICEFREWithUMADialog[] = {
478 {kNewMobileIdentityConsistencyFREParam,
479 kNewMobileIdentityConsistencyFREParamUMADialog}};
480const FeatureEntry::FeatureParam kNewMICEFREWithThreeSteps[] = {
481 {kNewMobileIdentityConsistencyFREParam,
482 kNewMobileIdentityConsistencyFREParamThreeSteps}};
483const FeatureEntry::FeatureParam kNewMICEFREWithTwoSteps[] = {
484 {kNewMobileIdentityConsistencyFREParam,
485 kNewMobileIdentityConsistencyFREParamTwoSteps}};
486const FeatureEntry::FeatureVariation
487 kNewMobileIdentityConsistencyFREVariations[] = {
488 {"New FRE with UMA dialog", kNewMICEFREWithUMADialog,
489 std::size(kNewMICEFREWithUMADialog), nullptr},
490 {"new FRE with 3 steps", kNewMICEFREWithThreeSteps,
491 std::size(kNewMICEFREWithThreeSteps), nullptr},
492 {"new FRE with 2 steps", kNewMICEFREWithTwoSteps,
493 std::size(kNewMICEFREWithTwoSteps), nullptr}};
494
Louis Romero023cc5052022-04-08 23:29:39495const FeatureEntry::FeatureParam kBubbleRichIPHTargetHighlight[] = {
496 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterTargetHighlight}};
Christian Xubd60c4b72022-03-22 15:25:01497const FeatureEntry::FeatureParam kBubbleRichIPHExplicitDismissal[] = {
498 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterExplicitDismissal}};
499const FeatureEntry::FeatureParam kBubbleRichIPHRich[] = {
500 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRich}};
501const FeatureEntry::FeatureParam kBubbleRichIPHRichWithSnooze[] = {
502 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRichWithSnooze}};
503const FeatureEntry::FeatureVariation kBubbleRichIPHVariations[] = {
Louis Romero023cc5052022-04-08 23:29:39504 {"Target Highlight", kBubbleRichIPHTargetHighlight,
505 std::size(kBubbleRichIPHTargetHighlight), nullptr},
Christian Xubd60c4b72022-03-22 15:25:01506 {"Explicit dismissal", kBubbleRichIPHExplicitDismissal,
507 std::size(kBubbleRichIPHExplicitDismissal), nullptr},
508 {"Dismissal and rich content", kBubbleRichIPHRich,
509 std::size(kBubbleRichIPHRich), nullptr},
Louis Romero023cc5052022-04-08 23:29:39510 {"Dismissal, rich content, and snooze", kBubbleRichIPHRichWithSnooze,
Christian Xubd60c4b72022-03-22 15:25:01511 std::size(kBubbleRichIPHRichWithSnooze), nullptr},
512};
513
Christian Xubdedabec2022-07-04 10:00:13514const FeatureEntry::FeatureParam kOmniboxPasteButtonBlueIconCapsule[] = {
515 {kOmniboxPasteButtonParameterName,
516 kOmniboxPasteButtonParameterBlueIconCapsule}};
517const FeatureEntry::FeatureParam kOmniboxPasteButtonBlueFullCapsule[] = {
518 {kOmniboxPasteButtonParameterName,
519 kOmniboxPasteButtonParameterBlueFullCapsule}};
520const FeatureEntry::FeatureVariation kOmniboxPasteButtonVariations[] = {
521 {"Icon only", kOmniboxPasteButtonBlueIconCapsule,
522 std::size(kOmniboxPasteButtonBlueIconCapsule), nullptr},
523 {"Icon and text", kOmniboxPasteButtonBlueFullCapsule,
524 std::size(kOmniboxPasteButtonBlueFullCapsule), nullptr},
525};
526
Gauthier Ambard30ad9ca2022-06-09 14:15:26527const FeatureEntry::FeatureParam kPopupMenuBookmarkStringAddABookmark[] = {
528 {kPopupMenuBookmarkStringParamName,
529 kPopupMenuBookmarkStringParamAddABookmark}};
530const FeatureEntry::FeatureParam kPopupMenuBookmarkStringAddToBookmarks[] = {
531 {kPopupMenuBookmarkStringParamName,
532 kPopupMenuBookmarkStringParamAddToBookmarks}};
533const FeatureEntry::FeatureParam kPopupMenuBookmarkStringBookmarkThisPage[] = {
534 {kPopupMenuBookmarkStringParamName,
535 kPopupMenuBookmarkStringParamBookmarkThisPage}};
536
537const FeatureEntry::FeatureVariation kPopupMenuBookmarkStringVarations[] = {
538 {"(Add A Bookmark)", kPopupMenuBookmarkStringAddABookmark,
539 std::size(kPopupMenuBookmarkStringAddABookmark), nullptr},
540 {"(Add To Bookmarks)", kPopupMenuBookmarkStringAddToBookmarks,
541 std::size(kPopupMenuBookmarkStringAddToBookmarks), nullptr},
542 {"(Bookmark This Page)", kPopupMenuBookmarkStringBookmarkThisPage,
543 std::size(kPopupMenuBookmarkStringBookmarkThisPage), nullptr}};
544
Igor Ruvinov44fed9f2022-06-10 22:51:42545const FeatureEntry::FeatureParam kDmTokenDeletionParam[] = {{"forced", "true"}};
546const FeatureEntry::FeatureVariation kDmTokenDeletionVariation[] = {
547 {"(Forced)", kDmTokenDeletionParam, std::size(kDmTokenDeletionParam),
548 nullptr}};
549
Cooper Knaak1e026562017-07-26 05:22:28550// To add a new entry, add to the end of kFeatureEntries. There are four
sdefresne14900ee2015-11-27 14:43:21551// distinct types of entries:
Cooper Knaak1e026562017-07-26 05:22:28552// . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the
553// default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE
sdefresne14900ee2015-11-27 14:43:21554// macro for this type supplying the command line to the macro.
555// . MULTI_VALUE: a list of choices, the first of which should correspond to a
556// deactivated state for this lab (i.e. no command line option). To specify
557// this type of entry use the macro MULTI_VALUE_TYPE supplying it the
558// array of choices.
Cooper Knaak1e026562017-07-26 05:22:28559// . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is
560// either enabled, disabled, or uses the default value of the associated
561// base::Feature instance. To specify this type of entry use the macro
562// FEATURE_VALUE_TYPE supplying it the base::Feature instance.
563// . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a
564// base::Feature instance. Choices corresponding to the default state, a
565// universally enabled state, and a universally disabled state are
566// automatically included. To specify this type of entry use the macro
567// FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and
568// the array of choices.
569//
sdefresne14900ee2015-11-27 14:43:21570// See the documentation of FeatureEntry for details on the fields.
571//
572// When adding a new choice, add it to the end of the list.
573const flags_ui::FeatureEntry kFeatureEntries[] = {
Cooper Knaak1e026562017-07-26 05:22:28574 {"in-product-help-demo-mode-choice",
575 flag_descriptions::kInProductHelpDemoModeName,
576 flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos,
577 FEATURE_WITH_PARAMS_VALUE_TYPE(
Tommy Nyquistc1d6dea12017-07-26 20:37:23578 feature_engagement::kIPHDemoMode,
579 feature_engagement::kIPHDemoModeChoiceVariations,
Marc Treib2752e8b2017-08-04 14:12:09580 "IPH_DemoMode")},
Moe Ahmadic3fd7cd2018-05-11 21:40:22581 {"enable-autofill-credit-card-upload",
582 flag_descriptions::kAutofillCreditCardUploadName,
583 flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos,
Anne Lim579b5732018-08-30 18:24:24584 FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)},
Tina Wang41d431c2021-06-21 21:04:13585 {"enable-discover-feed-preview",
586 flag_descriptions::kEnableDiscoverFeedPreviewName,
587 flag_descriptions::kEnableDiscoverFeedPreviewDescription, flags_ui::kOsIos,
588 FEATURE_VALUE_TYPE(kEnableDiscoverFeedPreview)},
Moe Ahmadid6d5d172018-06-20 17:20:23589 {"use-sync-sandbox", flag_descriptions::kSyncSandboxName,
590 flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos,
591 SINGLE_VALUE_TYPE_AND_VALUE(
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51592 syncer::kSyncServiceURL,
Moe Ahmadid6d5d172018-06-20 17:20:23593 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")},
594 {"wallet-service-use-sandbox",
595 flag_descriptions::kWalletServiceUseSandboxName,
596 flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos,
597 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
598 autofill::switches::kWalletServiceUseSandbox,
599 "1",
600 autofill::switches::kWalletServiceUseSandbox,
601 "0")},
Mohamad Ahmadic4df81f2017-12-20 04:41:59602 {"show-autofill-type-predictions",
603 flag_descriptions::kShowAutofillTypePredictionsName,
604 flag_descriptions::kShowAutofillTypePredictionsDescription,
605 flags_ui::kOsIos,
Gauthier Ambardcfd85182018-01-05 10:37:46606 FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)},
Olivier Robin3d60411622018-02-23 10:03:22607 {"autofill-ios-delay-between-fields",
608 flag_descriptions::kAutofillIOSDelayBetweenFieldsName,
609 flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription,
610 flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)},
Benjamin Williams14233d72022-07-26 18:32:20611 {"fullscreen-promos-manager",
612 flag_descriptions::kFullscreenPromosManagerName,
613 flag_descriptions::kFullscreenPromosManagerDescription, flags_ui::kOsIos,
614 FEATURE_VALUE_TYPE(kFullscreenPromosManager)},
Kurt Horimotodc33af32018-05-01 01:39:14615 {"fullscreen-viewport-adjustment-experiment",
Chris Lu481a9322019-09-25 22:16:53616 flag_descriptions::kFullscreenSmoothScrollingName,
617 flag_descriptions::kFullscreenSmoothScrollingDescription, flags_ui::kOsIos,
618 FEATURE_VALUE_TYPE(fullscreen::features::kSmoothScrollingDefault)},
Robbie Gibson1f37a5e2020-08-06 17:03:06619 {"webpage-default-zoom-from-dynamic-type",
620 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeName,
621 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeDescription,
622 flags_ui::kOsIos,
623 FEATURE_VALUE_TYPE(web::kWebPageDefaultZoomFromDynamicType)},
Robbie Gibson88f23962020-09-28 14:35:56624 {"webpage-alternative-text-zoom",
625 flag_descriptions::kWebPageAlternativeTextZoomName,
626 flag_descriptions::kWebPageAlternativeTextZoomDescription,
627 flags_ui::kOsIos, FEATURE_VALUE_TYPE(web::kWebPageAlternativeTextZoom)},
Robbie Gibson1095b72c2022-06-06 17:03:34628 {"webpage-text-zoom-ipad", flag_descriptions::kWebPageTextZoomIPadName,
629 flag_descriptions::kWebPageTextZoomIPadDescription, flags_ui::kOsIos,
630 FEATURE_VALUE_TYPE(web::kWebPageTextZoomIPad)},
Kurt Horimoto79d590b2018-09-12 19:09:28631 {"toolbar-container", flag_descriptions::kToolbarContainerName,
632 flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos,
633 FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)},
Stepan Khapugincc4e9842019-01-23 13:38:13634 {"omnibox-ui-max-autocomplete-matches",
635 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName,
636 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription,
637 flags_ui::kOsIos,
638 FEATURE_WITH_PARAMS_VALUE_TYPE(
639 omnibox::kUIExperimentMaxAutocompleteMatches,
640 kOmniboxUIMaxAutocompleteMatchesVariations,
641 "OmniboxUIMaxAutocompleteVariations")},
Moe Ahmadi01028f22022-08-06 17:57:35642 {"omnibox-local-history-zero-suggest-beyond-ntp",
643 flag_descriptions::kOmniboxLocalHistoryZeroSuggestBeyondNTPName,
644 flag_descriptions::kOmniboxLocalHistoryZeroSuggestBeyondNTPDescription,
645 flags_ui::kOsIos,
646 FEATURE_VALUE_TYPE(omnibox::kLocalHistoryZeroSuggestBeyondNTP)},
Stepan Khapuginbac467e2022-05-06 21:11:54647 {"omnibox-max-zps-matches", flag_descriptions::kOmniboxMaxZPSMatchesName,
648 flag_descriptions::kOmniboxMaxZPSMatchesDescription, flags_ui::kOsIos,
649 FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kMaxZeroSuggestMatches,
650 kOmniboxMaxZPSMatchesVariations,
651 "OmniboxMaxZPSVariations")},
Peter Boström3f798572022-07-26 23:44:36652#if BUILDFLAG(DCHECK_IS_CONFIGURABLE)
Justin Cohen20b6f072019-01-16 01:38:50653 {"dcheck-is-fatal", flag_descriptions::kDcheckIsFatalName,
654 flag_descriptions::kDcheckIsFatalDescription, flags_ui::kOsIos,
655 FEATURE_VALUE_TYPE(base::kDCheckIsFatalFeature)},
Peter Boström3f798572022-07-26 23:44:36656#endif // BUILDFLAG(DCHECK_IS_CONFIGURABLE)
Caitlin Fischer43edd90a2019-05-01 13:24:30657 {"autofill-use-mobile-label-disambiguation",
658 flag_descriptions::kAutofillUseMobileLabelDisambiguationName,
659 flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription,
660 flags_ui::kOsIos,
Caitlin Fischer37e01232019-05-24 13:05:45661 FEATURE_WITH_PARAMS_VALUE_TYPE(
662 autofill::features::kAutofillUseMobileLabelDisambiguation,
663 kAutofillUseMobileLabelDisambiguationVariations,
664 "AutofillUseMobileLabelDisambiguation")},
Olivier Robin43814bb2021-06-22 15:25:45665 {"metrickit-crash-reports", flag_descriptions::kMetrickitCrashReportName,
666 flag_descriptions::kMetrickitCrashReportDescription, flags_ui::kOsIos,
667 FEATURE_VALUE_TYPE(kMetrickitCrashReport)},
Mike Doughertyb6c770d2019-09-13 22:56:46668 {"ios-breadcrumbs", flag_descriptions::kLogBreadcrumbsName,
669 flag_descriptions::kLogBreadcrumbsDescription, flags_ui::kOsIos,
Jesse McKenna85c1a59f2021-05-05 19:08:30670 FEATURE_VALUE_TYPE(breadcrumbs::kLogBreadcrumbs)},
Eugene But2823dc7e2020-07-21 18:10:37671 {"ios-synthetic-crash-reports",
672 flag_descriptions::kSyntheticCrashReportsForUteName,
673 flag_descriptions::kSyntheticCrashReportsForUteDescription,
674 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSyntheticCrashReportsForUte)},
Jérôme Lebelc374fdd2019-09-27 10:36:48675 {"force-startup-signin-promo",
676 flag_descriptions::kForceStartupSigninPromoName,
677 flag_descriptions::kForceStartupSigninPromoDescription, flags_ui::kOsIos,
Alice Wang345e09442021-07-05 09:03:29678 FEATURE_VALUE_TYPE(switches::kForceStartupSigninPromo)},
Yoichi Osato7ae11752021-03-16 03:27:22679 {"restore-session-from-cache",
680 flag_descriptions::kRestoreSessionFromCacheName,
681 flag_descriptions::kRestoreSessionFromCacheDescription, flags_ui::kOsIos,
Justin Cohen3ec2522c2021-04-23 18:23:49682 FEATURE_VALUE_TYPE(web::kRestoreSessionFromCache)},
sczs4622e6e2019-11-06 01:17:59683 {"autofill-save-card-dismiss-on-navigation",
684 flag_descriptions::kAutofillSaveCardDismissOnNavigationName,
685 flag_descriptions::kAutofillSaveCardDismissOnNavigationDescription,
686 flags_ui::kOsIos,
687 FEATURE_VALUE_TYPE(
688 autofill::features::kAutofillSaveCardDismissOnNavigation)},
sczs37d9c132020-07-18 06:06:33689 {"new-content-suggestions-feed", flag_descriptions::kDiscoverFeedInNtpName,
adamta22a4d502020-05-21 03:12:21690 flag_descriptions::kDiscoverFeedInNtpDescription, flags_ui::kOsIos,
gogeralddb0d8ae2020-11-13 03:56:58691 FEATURE_WITH_PARAMS_VALUE_TYPE(kDiscoverFeedInNtp,
692 kDiscoverFeedInNtpVariations,
693 "IOSDiscoverFeed")},
Roberto Mourab87b9722020-06-17 17:12:09694 {"expanded-tab-strip", flag_descriptions::kExpandedTabStripName,
695 flag_descriptions::kExpandedTabStripDescription, flags_ui::kOsIos,
696 FEATURE_VALUE_TYPE(kExpandedTabStrip)},
Tommy Martino6b4eb7e2020-06-25 18:25:41697 {"shared-highlighting-ios", flag_descriptions::kSharedHighlightingIOSName,
698 flag_descriptions::kSharedHighlightingIOSDescription, flags_ui::kOsIos,
699 FEATURE_VALUE_TYPE(kSharedHighlightingIOS)},
Veronique Nguyen6593c762021-11-30 17:28:56700 {"enable-fre-ui-module-ios-with-options",
701 flag_descriptions::kEnableFREUIModuleIOSName,
Tina Wanga252ca42021-04-01 17:14:23702 flag_descriptions::kEnableFREUIModuleIOSDescription, flags_ui::kOsIos,
ginnnnnnny429b5522022-05-05 03:50:06703 FEATURE_VALUE_TYPE(kEnableFREUIModuleIOS)},
jlebel041fc1c2022-03-04 12:53:30704 {"new-mobile-identity-consistency-fre",
705 flag_descriptions::kNewMobileIdentityConsistencyFREName,
706 flag_descriptions::kNewMobileIdentityConsistencyFREDescription,
707 flags_ui::kOsIos,
708 FEATURE_WITH_PARAMS_VALUE_TYPE(signin::kNewMobileIdentityConsistencyFRE,
709 kNewMobileIdentityConsistencyFREVariations,
ginnnnnnny46435132022-06-01 16:06:04710 kIOSMICeAndDefaultBrowserTrialName)},
Sylvain Defresne9c107082020-10-27 16:39:13711#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
edchin81467b82020-09-03 19:31:45712 {"screen-time-integration-ios",
713 flag_descriptions::kScreenTimeIntegrationName,
714 flag_descriptions::kScreenTimeIntegrationDescription, flags_ui::kOsIos,
715 FEATURE_VALUE_TYPE(kScreenTimeIntegration)},
Sylvain Defresne9c107082020-10-27 16:39:13716#endif
Nazerke3e993f72020-09-21 13:00:06717 {"modern-tab-strip", flag_descriptions::kModernTabStripName,
718 flag_descriptions::kModernTabStripDescription, flags_ui::kOsIos,
719 FEATURE_VALUE_TYPE(kModernTabStrip)},
Nohemi Fernandez222d6d42020-09-30 20:35:57720 {"minutes-delay-to-restore-gaia-cookies-if-deleted",
721 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieName,
722 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieDescription,
723 flags_ui::kOsIos,
724 MULTI_VALUE_TYPE(kDelayThresholdMinutesToUpdateGaiaCookieChoices)},
Eugene Butf869bff2020-12-10 01:16:55725 {"record-snapshot-size", flag_descriptions::kRecordSnapshotSizeName,
726 flag_descriptions::kRecordSnapshotSizeDescription, flags_ui::kOsIos,
727 FEATURE_VALUE_TYPE(web::features::kRecordSnapshotSize)},
Chris Lub17195f2020-12-10 20:49:14728 {"default-browser-fullscreen-promo-experiment",
729 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentName,
730 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentDescription,
731 flags_ui::kOsIos,
Javier Ernesto Flores Robles159414232021-06-16 14:29:59732 FEATURE_WITH_PARAMS_VALUE_TYPE(
733 kDefaultBrowserFullscreenPromoExperiment,
734 kDefaultBrowserFullscreenPromoExperimentVariations,
735 "IOSDefaultBrowserFullscreenPromoExperiment")},
Cheick Cisse76ade3d2020-12-16 00:15:11736 {"ios-shared-highlighting-color-change",
737 flag_descriptions::kIOSSharedHighlightingColorChangeName,
738 flag_descriptions::kIOSSharedHighlightingColorChangeDescription,
Cheick Cissed0b5bfe2021-02-11 14:23:07739 flags_ui::kOsIos,
740 FEATURE_VALUE_TYPE(web::features::kIOSSharedHighlightingColorChange)},
Cheick Cissefe994862021-12-15 16:01:34741 {"ios-shared-highlighting-v2",
742 flag_descriptions::kIOSSharedHighlightingV2Name,
743 flag_descriptions::kIOSSharedHighlightingV2Description, flags_ui::kOsIos,
744 FEATURE_VALUE_TYPE(shared_highlighting::kIOSSharedHighlightingV2)},
Stepan Khapugin04341202021-01-07 12:22:45745 {"omnibox-new-textfield-implementation",
746 flag_descriptions::kOmniboxNewImplementationName,
747 flag_descriptions::kOmniboxNewImplementationDescription, flags_ui::kOsIos,
748 FEATURE_VALUE_TYPE(kIOSNewOmniboxImplementation)},
Stepan Khapugin422f08d2022-02-18 16:19:44749 {"omnibox-new-popup-ui", flag_descriptions::kIOSOmniboxUpdatedPopupUIName,
750 flag_descriptions::kIOSOmniboxUpdatedPopupUIDescription, flags_ui::kOsIos,
Robbie Gibson46351032022-03-31 19:46:23751 FEATURE_WITH_PARAMS_VALUE_TYPE(kIOSOmniboxUpdatedPopupUI,
752 kiOSOmniboxUpdatedPopupUIVariations,
Stepan Khapugina45baed2022-05-13 19:15:43753 "IOSOmniboxUpdatedPopupUI")},
gogerald0ff29e52021-02-03 18:56:19754 {"start-surface", flag_descriptions::kStartSurfaceName,
755 flag_descriptions::kStartSurfaceDescription, flags_ui::kOsIos,
gogerald0e39e3aa2021-02-10 18:41:23756 FEATURE_WITH_PARAMS_VALUE_TYPE(kStartSurface,
757 kStartSurfaceVariations,
758 "StartSurface")},
Justin Cohen13ac7a202021-02-04 18:27:28759 {"ios-crashpad", flag_descriptions::kCrashpadIOSName,
760 flag_descriptions::kCrashpadIOSDescription, flags_ui::kOsIos,
761 FEATURE_VALUE_TYPE(kCrashpadIOS)},
Vidhan Jain451b4752021-07-15 10:16:42762 {"autofill-address-verification-in-save-prompt",
763 flag_descriptions::kEnableAutofillAddressSavePromptAddressVerificationName,
764 flag_descriptions::
765 kEnableAutofillAddressSavePromptAddressVerificationDescription,
766 flags_ui::kOsIos,
767 FEATURE_VALUE_TYPE(
768 autofill::features::
769 kAutofillAddressProfileSavePromptAddressVerificationSupport)},
Vidhan Jaina65741552021-03-09 17:18:27770 {"autofill-address-save-prompt",
771 flag_descriptions::kEnableAutofillAddressSavePromptName,
772 flag_descriptions::kEnableAutofillAddressSavePromptDescription,
773 flags_ui::kOsIos,
774 FEATURE_VALUE_TYPE(autofill::features::kAutofillAddressProfileSavePrompt)},
Viktor Semeniuk68e794a2021-03-24 10:23:25775 {"filling-across-affiliated-websites",
776 flag_descriptions::kFillingAcrossAffiliatedWebsitesName,
777 flag_descriptions::kFillingAcrossAffiliatedWebsitesDescription,
778 flags_ui::kOsIos,
779 FEATURE_VALUE_TYPE(
780 password_manager::features::kFillingAcrossAffiliatedWebsites)},
Jared Sauld47c2b72021-03-25 22:47:31781 {"autofill-parse-merchant-promo-code-fields",
782 flag_descriptions::kAutofillParseMerchantPromoCodeFieldsName,
783 flag_descriptions::kAutofillParseMerchantPromoCodeFieldsDescription,
784 flags_ui::kOsIos,
785 FEATURE_VALUE_TYPE(
786 autofill::features::kAutofillParseMerchantPromoCodeFields)},
edchin257cea2f2021-04-07 13:07:13787 {"interest-feed-v2-clicks-and-views-cond-upload",
788 flag_descriptions::kInterestFeedV2ClickAndViewActionsConditionalUploadName,
789 flag_descriptions::
790 kInterestFeedV2ClickAndViewActionsConditionalUploadDescription,
791 flags_ui::kOsIos,
792 FEATURE_VALUE_TYPE(feed::kInterestFeedV2ClicksAndViewsConditionalUpload)},
Side Yilmaz6c53f7102021-09-07 13:26:19793 {"incognito-ntp-revamp", flag_descriptions::kIncognitoNtpRevampName,
794 flag_descriptions::kIncognitoNtpRevampDescription, flags_ui::kOsIos,
795 FEATURE_VALUE_TYPE(kIncognitoNtpRevamp)},
Side YILMAZ4b40a3082022-04-11 10:13:33796 {"update-history-entry-points-in-incognito",
797 flag_descriptions::kUpdateHistoryEntryPointsInIncognitoName,
798 flag_descriptions::kUpdateHistoryEntryPointsInIncognitoDescription,
799 flags_ui::kOsIos,
800 FEATURE_VALUE_TYPE(kUpdateHistoryEntryPointsInIncognito)},
jlebeld95434d652021-06-22 10:32:48801 {"sync-trusted-vault-passphrase-ios-rpc",
802 flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCName,
803 flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCDescription,
804 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51805 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseiOSRPC)},
Mikel Astiz850b0fe2021-06-16 09:47:27806 {"sync-trusted-vault-passphrase-promo",
807 flag_descriptions::kSyncTrustedVaultPassphrasePromoName,
808 flag_descriptions::kSyncTrustedVaultPassphrasePromoDescription,
809 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51810 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphrasePromo)},
Mikel Astiz850b0fe2021-06-16 09:47:27811 {"sync-trusted-vault-passphrase-recovery",
812 flag_descriptions::kSyncTrustedVaultPassphraseRecoveryName,
813 flag_descriptions::kSyncTrustedVaultPassphraseRecoveryDescription,
814 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51815 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseRecovery)},
Nohemi Fernandezc00842a2021-07-26 11:47:34816 {"wait-threshold-seconds-for-capabilities-api",
817 flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiName,
818 flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiDescription,
819 flags_ui::kOsIos,
820 MULTI_VALUE_TYPE(kWaitThresholdMillisecondsForCapabilitiesApiChoices)},
Jared Saul2188f762021-08-02 21:22:23821 {"autofill-fill-merchant-promo-code-fields",
822 flag_descriptions::kAutofillFillMerchantPromoCodeFieldsName,
823 flag_descriptions::kAutofillFillMerchantPromoCodeFieldsDescription,
824 flags_ui::kOsIos,
825 FEATURE_VALUE_TYPE(
826 autofill::features::kAutofillFillMerchantPromoCodeFields)},
Sylvain Defresnedff67e42021-09-24 09:43:03827 {"new-overflow-menu", flag_descriptions::kNewOverflowMenuName,
828 flag_descriptions::kNewOverflowMenuDescription, flags_ui::kOsIos,
829 FEATURE_VALUE_TYPE(kNewOverflowMenu)},
Robbie Gibsonfe748e52022-05-09 18:20:46830 {"new-overflow-menu-settings-action",
831 flag_descriptions::kNewOverflowMenuSettingsActionName,
Robbie Gibsone2ad5632022-05-16 20:46:10832 flag_descriptions::kNewOverflowMenuSettingsActionDescription,
833 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kNewOverflowMenuSettingsAction)},
834 {"new-overflow-menu-simple-destination-icons",
835 flag_descriptions::kNewOverflowMenuSimpleDestinationIconsName,
836 flag_descriptions::kNewOverflowMenuSimpleDestinationIconsDescription,
837 flags_ui::kOsIos,
838 FEATURE_VALUE_TYPE(kNewOverflowMenuSimpleDestinationIcons)},
Robbie Gibson640bccb32022-05-10 18:43:35839 {"new-overflow-menu-cbd-action",
840 flag_descriptions::kNewOverflowMenuCBDActionName,
841 flag_descriptions::kNewOverflowMenuCBDActionDescription, flags_ui::kOsIos,
842 FEATURE_VALUE_TYPE(kNewOverflowMenuCBDAction)},
Evan Bernstein0a85f332021-09-29 19:07:24843 {"use-lens-to-search-for-image",
844 flag_descriptions::kUseLensToSearchForImageName,
845 flag_descriptions::kUseLensToSearchForImageDescription, flags_ui::kOsIos,
Ali Juma02a9b7b2021-10-01 13:44:44846 FEATURE_VALUE_TYPE(kUseLensToSearchForImage)},
Jason Hu3830a072022-08-19 20:56:22847 {"enable-lens-in-home-screen-widget",
848 flag_descriptions::kEnableLensInHomeScreenWidgetName,
849 flag_descriptions::kEnableLensInHomeScreenWidgetDescription,
850 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableLensInHomeScreenWidget)},
851 {"enable-lens-in-keyboard", flag_descriptions::kEnableLensInKeyboardName,
852 flag_descriptions::kEnableLensInKeyboardDescription, flags_ui::kOsIos,
853 FEATURE_VALUE_TYPE(kEnableLensInKeyboard)},
854 {"enable-lens-in-ntp", flag_descriptions::kEnableLensInNTPName,
855 flag_descriptions::kEnableLensInNTPDescription, flags_ui::kOsIos,
856 FEATURE_VALUE_TYPE(kEnableLensInNTP)},
Benjamin Williamsbee6ab62022-02-28 18:09:40857 {"use-load-simulated-request-for-error-page-navigation",
Gauthier Ambard33cceaf2022-05-05 14:00:23858 flag_descriptions::kUseLoadSimulatedRequestForOfflinePageName,
859 flag_descriptions::kUseLoadSimulatedRequestForOfflinePageDescription,
Benjamin Williamsbee6ab62022-02-28 18:09:40860 flags_ui::kOsIos,
Gauthier Ambard33cceaf2022-05-05 14:00:23861 FEATURE_VALUE_TYPE(web::features::kUseLoadSimulatedRequestForOfflinePage)},
Sergio Collazos9fcc6ed2021-10-06 00:58:03862 {"enable-discover-feed-static-resource-serving",
863 flag_descriptions::kEnableDiscoverFeedStaticResourceServingName,
864 flag_descriptions::kEnableDiscoverFeedStaticResourceServingDescription,
865 flags_ui::kOsIos,
866 FEATURE_WITH_PARAMS_VALUE_TYPE(
867 kEnableDiscoverFeedStaticResourceServing,
868 kEnableDiscoverFeedStaticResourceServingVariations,
869 "IOSDiscoverFeedStaticResourceServing")},
870 {"enable-disco-feed-endpoint",
871 flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointName,
872 flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointDescription,
873 flags_ui::kOsIos,
Aliona DANGLA8fae66f02021-10-06 15:47:11874 FEATURE_VALUE_TYPE(kEnableDiscoverFeedDiscoFeedEndpoint)},
Mohammad Refaatab6bee62022-05-16 16:31:15875 {"enable-discover-feed-top-sync-promo",
876 flag_descriptions::kEnableDiscoverFeedTopSyncPromoName,
877 flag_descriptions::kEnableDiscoverFeedTopSyncPromoDescription,
878 flags_ui::kOsIos,
879 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableDiscoverFeedTopSyncPromo,
880 kDiscoverFeedTopSyncPromoVariations,
881 "EnableDiscoverFeedTopSyncPromo")},
Aliona DANGLA8fae66f02021-10-06 15:47:11882 {"enable-fre-default-browser-screen-testing",
ginnnnnnny46435132022-06-01 16:06:04883 flag_descriptions::kEnableFREDefaultBrowserPromoScreenName,
884 flag_descriptions::kEnableFREDefaultBrowserPromoScreenDescription,
Aliona DANGLA8fae66f02021-10-06 15:47:11885 flags_ui::kOsIos,
ginnnnnnny46435132022-06-01 16:06:04886 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFREDefaultBrowserPromoScreen,
887 kFREDefaultBrowserPromoVariations,
888 kIOSMICeAndDefaultBrowserTrialName)},
Tommy Martino7393d762021-10-12 17:59:28889 {"shared-highlighting-amp",
890 flag_descriptions::kIOSSharedHighlightingAmpName,
891 flag_descriptions::kIOSSharedHighlightingAmpDescription, flags_ui::kOsIos,
892 FEATURE_VALUE_TYPE(shared_highlighting::kSharedHighlightingAmp)},
David Maunderf4a5e1e2021-10-18 17:24:28893 {"enable-commerce-price-tracking",
Matt Jones125dfb42022-02-11 17:23:42894 commerce::flag_descriptions::kCommercePriceTrackingName,
895 commerce::flag_descriptions::kCommercePriceTrackingDescription,
896 flags_ui::kOsIos,
897 FEATURE_WITH_PARAMS_VALUE_TYPE(commerce::kCommercePriceTracking,
898 commerce::kCommercePriceTrackingVariations,
adamta67b6c5812021-10-19 17:02:15899 "CommercePriceTracking")},
Tina Wang8058d5f2021-11-04 20:06:06900 {"web-feed-ios", flag_descriptions::kEnableWebChannelsName,
901 flag_descriptions::kEnableWebChannelsDescription, flags_ui::kOsIos,
902 FEATURE_VALUE_TYPE(kEnableWebChannels)},
adamta39331592021-11-01 20:18:54903 {"ntp-view-hierarchy-repair",
904 flag_descriptions::kNTPViewHierarchyRepairName,
905 flag_descriptions::kNTPViewHierarchyRepairDescription, flags_ui::kOsIos,
906 FEATURE_VALUE_TYPE(kNTPViewHierarchyRepair)},
Justin Cohen69cec682021-11-04 20:10:26907 {"synthesized-restore-session",
908 flag_descriptions::kSynthesizedRestoreSessionName,
909 flag_descriptions::kSynthesizedRestoreSessionDescription, flags_ui::kOsIos,
910 FEATURE_VALUE_TYPE(web::features::kSynthesizedRestoreSession)},
Chris Lu4723b822021-11-05 21:47:44911 {"remove-extra-ntps", flag_descriptions::kRemoveExcessNTPsExperimentName,
912 flag_descriptions::kRemoveExcessNTPsExperimentDescription,
Sylvain Defresne1619dd002021-11-06 10:09:48913 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kRemoveExcessNTPs)},
Benjamin Williams0e7e2fb2021-11-17 03:03:41914 {"enable-password-manager-branding-update",
915 flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateName,
916 flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateDescription,
917 flags_ui::kOsIos,
Aliona DANGLAe5b0b6e52021-11-30 11:58:19918 FEATURE_VALUE_TYPE(
919 password_manager::features::kIOSEnablePasswordManagerBrandingUpdate)},
Gauthier Ambard1d326e22021-12-16 10:57:53920 {"default-mode-ua", flag_descriptions::kAddSettingForDefaultPageModeName,
921 flag_descriptions::kAddSettingForDefaultPageModeDescription,
922 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kAddSettingForDefaultPageMode)},
ginnnnnnnyee3036e2022-08-12 18:01:18923 {"ios-media-permissions-control",
924 flag_descriptions::kMediaPermissionsControlName,
925 flag_descriptions::kMediaPermissionsControlDescription, flags_ui::kOsIos,
926 FEATURE_VALUE_TYPE(web::features::kMediaPermissionsControl)},
Olivier Robin3a957df2021-12-21 18:04:34927 {"enable-save-session-tabs-in-separate-files",
928 flag_descriptions::kSaveSessionTabsToSeparateFilesName,
929 flag_descriptions::kSaveSessionTabsToSeparateFilesDescription,
930 flags_ui::kOsIos,
931 FEATURE_VALUE_TYPE(sessions::kSaveSessionTabsToSeparateFiles)},
Ewann8c7aadc2022-05-19 15:41:05932 {"use-sf-symbols", flag_descriptions::kUseSFSymbolsName,
933 flag_descriptions::kUseSFSymbolsDescription, flags_ui::kOsIos,
934 FEATURE_VALUE_TYPE(kUseSFSymbols)},
Nohemi Fernandez76f54802022-01-10 18:23:32935 {"enable-unicorn-account-support",
936 flag_descriptions::kEnableUnicornAccountSupportName,
937 flag_descriptions::kEnableUnicornAccountSupportDescription,
938 flags_ui::kOsIos,
939 FEATURE_VALUE_TYPE(signin::kEnableUnicornAccountSupport)},
David Jeanc2b88ab602022-08-08 14:52:51940 {"ios-webpage-intent-annotations",
941 flag_descriptions::kEnableWebPageAnnotationsName,
942 flag_descriptions::kEnableWebPageAnnotationsDescription, flags_ui::kOsIos,
943 FEATURE_VALUE_TYPE(web::features::kEnableWebPageAnnotations)},
rgod90cca8b2022-02-04 12:38:27944 {"leak-detection-unauthenticated",
945 flag_descriptions::kLeakDetectionUnauthenticatedName,
946 flag_descriptions::kLeakDetectionUnauthenticatedDescription,
947 flags_ui::kOsIos,
948 FEATURE_VALUE_TYPE(
949 password_manager::features::kLeakDetectionUnauthenticated)},
Veronique Nguyen00ba26ea2022-02-25 14:57:17950 {"enable-favicon-passwords",
951 flag_descriptions::kEnableFaviconForPasswordsName,
952 flag_descriptions::kEnableFaviconForPasswordsDescription, flags_ui::kOsIos,
953 FEATURE_VALUE_TYPE(
954 password_manager::features::kEnableFaviconForPasswords)},
Shivani Chauhanbf97b0d2022-02-08 22:21:28955 {"autofill-enable-sending-bcn-in-get-upload-details",
956 flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsName,
957 flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsDescription,
958 flags_ui::kOsIos,
959 FEATURE_VALUE_TYPE(
960 autofill::features::kAutofillEnableSendingBcnInGetUploadDetails)},
Ali Juma1429cf8a2022-02-09 15:31:01961 {"enable-fullscreen-api", flag_descriptions::kEnableFullscreenAPIName,
962 flag_descriptions::kEnableFullscreenAPIDescription, flags_ui::kOsIos,
963 FEATURE_VALUE_TYPE(web::features::kEnableFullscreenAPI)},
Joemer Ramos34175732022-02-14 18:59:16964 {"enable-enhanced-safe-browsing",
965 flag_descriptions::kEnhancedProtectionName,
966 flag_descriptions::kEnhancedProtectionDescription, flags_ui::kOsIos,
967 FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtection)},
Joemer Ramos26e2b512022-05-24 17:26:41968 {"enable-enhanced-safe-browsing-phase-2",
969 flag_descriptions::kEnhancedProtectionPhase2Name,
970 flag_descriptions::kEnhancedProtectionPhase2Description, flags_ui::kOsIos,
971 FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtectionPhase2IOS)},
Shivani Chauhanaf1eb74d2022-02-11 21:13:19972 {"autofill-enable-unmask-card-request-set-instrument-id",
973 flag_descriptions::kAutofillEnableUnmaskCardRequestSetInstrumentIdName,
974 flag_descriptions::
975 kAutofillEnableUnmaskCardRequestSetInstrumentIdDescription,
976 flags_ui::kOsIos,
977 FEATURE_VALUE_TYPE(
978 autofill::features::kAutofillEnableUnmaskCardRequestSetInstrumentId)},
Vishwas Uppoor89303a92022-08-03 00:56:26979 {"autofill-enable-card-product-name",
980 flag_descriptions::kAutofillEnableCardProductNameName,
981 flag_descriptions::kAutofillEnableCardProductNameDescription,
982 flags_ui::kOsIos,
983 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableCardProductName)},
Victor Hugo Vianna Silvaf0a44002022-02-16 10:38:00984 {"send-tab-to-self-signin-promo",
985 flag_descriptions::kSendTabToSelfSigninPromoName,
986 flag_descriptions::kSendTabToSelfSigninPromoDescription, flags_ui::kOsIos,
987 FEATURE_VALUE_TYPE(send_tab_to_self::kSendTabToSelfSigninPromo)},
Christian Xubd60c4b72022-03-22 15:25:01988 {"bubble-rich-iph", flag_descriptions::kBubbleRichIPHName,
989 flag_descriptions::kBubbleRichIPHDescription, flags_ui::kOsIos,
990 FEATURE_WITH_PARAMS_VALUE_TYPE(kBubbleRichIPH,
991 kBubbleRichIPHVariations,
992 "BubbleRichIPH")},
Siyu Anff02e742022-04-07 19:08:22993 {"autofill-enforce-delays-in-strike-database",
994 flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseName,
995 flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseDescription,
996 flags_ui::kOsIos,
997 FEATURE_VALUE_TYPE(
998 autofill::features::kAutofillEnforceDelaysInStrikeDatabase)},
Jared Saulb0473bd2022-04-20 00:03:41999 {"autofill-upstream-allow-additional-email-domains",
1000 flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsName,
1001 flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsDescription,
1002 flags_ui::kOsIos,
1003 FEATURE_VALUE_TYPE(
1004 autofill::features::kAutofillUpstreamAllowAdditionalEmailDomains)},
1005 {"autofill-upstream-allow-all-email-domains",
1006 flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsName,
1007 flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsDescription,
1008 flags_ui::kOsIos,
1009 FEATURE_VALUE_TYPE(
1010 autofill::features::kAutofillUpstreamAllowAllEmailDomains)},
Olivier Robinffe767c2022-04-21 13:13:231011 {"enable-tflite-language-detection",
1012 flag_descriptions::kTFLiteLanguageDetectionName,
1013 flag_descriptions::kTFLiteLanguageDetectionDescription, flags_ui::kOsIos,
1014 FEATURE_VALUE_TYPE(translate::kTFLiteLanguageDetectionEnabled)},
Raj Ta921ffc2022-08-25 19:00:201015 {"optimization-guide-debug-logs",
1016 flag_descriptions::kOptimizationGuideDebugLogsName,
1017 flag_descriptions::kOptimizationGuideDebugLogsDescription,
1018 flags_ui::kOsIos,
1019 SINGLE_VALUE_TYPE(optimization_guide::switches::kDebugLoggingEnabled)},
Olivier Robinffe767c2022-04-21 13:13:231020 {"optimization-guide-model-downloading",
1021 flag_descriptions::kOptimizationGuideModelDownloadingName,
1022 flag_descriptions::kOptimizationGuideModelDownloadingDescription,
1023 flags_ui::kOsIos,
1024 FEATURE_VALUE_TYPE(
1025 optimization_guide::features::kOptimizationGuideModelDownloading)},
1026 {"optimization-target-prediction",
1027 flag_descriptions::kOptimizationTargetPredictionName,
1028 flag_descriptions::kOptimizationTargetPredictionDescription,
1029 flags_ui::kOsIos,
1030 FEATURE_VALUE_TYPE(
1031 optimization_guide::features::kOptimizationTargetPrediction)},
Rushan Suleymanov727309602022-04-28 20:08:541032 {"sync-standalone-invalidations", flag_descriptions::kSyncInvalidationsName,
1033 flag_descriptions::kSyncInvalidationsDescription, flags_ui::kOsIos,
1034 FEATURE_VALUE_TYPE(::syncer::kUseSyncInvalidations)},
1035 {"sync-standalone-invalidations-wallet-and-offer",
1036 flag_descriptions::kSyncInvalidationsWalletAndOfferName,
1037 flag_descriptions::kSyncInvalidationsWalletAndOfferDescription,
1038 flags_ui::kOsIos,
1039 FEATURE_VALUE_TYPE(::syncer::kUseSyncInvalidationsForWalletAndOffer)},
Christian Xub8c06cd2022-04-29 20:55:011040 {"suggestions-scrolling-ipad",
1041 flag_descriptions::kEnableSuggestionsScrollingOnIPadName,
1042 flag_descriptions::kEnableSuggestionsScrollingOnIPadDescription,
1043 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableSuggestionsScrollingOnIPad)},
David Jean7a8fa702022-05-02 15:21:221044 {"experience-kit-calendar", flag_descriptions::kCalendarExperienceKitName,
1045 flag_descriptions::kCalendarExperienceKitDescription, flags_ui::kOsIos,
1046 FEATURE_VALUE_TYPE(kCalendarExperienceKit)},
Zhixiang Teoh82d17bb2022-06-16 21:00:391047 {"enable-expkit-calendar-text-classifier",
1048 flag_descriptions::kEnableExpKitCalendarTextClassifierName,
1049 flag_descriptions::kEnableExpKitCalendarTextClassifierDescription,
1050 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableExpKitCalendarTextClassifier)},
Elmehdi Rahmaoui9d4ce40c62022-08-05 15:31:181051 {"experience-kit-maps", flag_descriptions::kMapsExperienceKitName,
1052 flag_descriptions::kMapsExperienceKitDescription, flags_ui::kOsIos,
1053 FEATURE_VALUE_TYPE(kMapsExperienceKit)},
Mustafa Emre Acer4de8863a2022-05-03 22:17:011054 {"https-only-mode", flag_descriptions::kHttpsOnlyModeName,
1055 flag_descriptions::kHttpsOnlyModeDescription, flags_ui::kOsIos,
1056 FEATURE_VALUE_TYPE(security_interstitials::features::kHttpsOnlyMode)},
Mustafa Emre Acerb8bb01f2022-07-20 19:43:251057 {"omnibox-https-upgrades", flag_descriptions::kOmniboxHttpsUpgradesName,
1058 flag_descriptions::kOmniboxHttpsUpgradesDescription, flags_ui::kOsIos,
1059 FEATURE_VALUE_TYPE(omnibox::kDefaultTypedNavigationsToHttps)},
Benjamin Williams419c81e2022-05-04 18:33:221060 {"smart-sorting-new-overflow-menu",
1061 flag_descriptions::kSmartSortingNewOverflowMenuName,
1062 flag_descriptions::kSmartSortingNewOverflowMenuDescription,
1063 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSmartSortingNewOverflowMenu)},
Scott Yoder10493562022-06-28 17:37:441064 {"new-overflow-menu-share-chrome-action",
1065 flag_descriptions::kNewOverflowMenuShareChromeActionName,
1066 flag_descriptions::kNewOverflowMenuShareChromeActionDescription,
1067 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kNewOverflowMenuShareChromeAction)},
Alexander Tekled46a36982022-05-09 20:32:421068 {"autofill-enable-ranking-formula",
1069 flag_descriptions::kAutofillEnableRankingFormulaName,
1070 flag_descriptions::kAutofillEnableRankingFormulaDescription,
1071 flags_ui::kOsIos,
1072 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableRankingFormula)},
Siyu An4f658a92022-05-13 22:59:021073 {"autofill-remove-card-expiry-from-downstream-suggestion",
1074 flag_descriptions::kAutofillRemoveCardExpiryFromDownstreamSuggestionName,
1075 flag_descriptions::
1076 kAutofillRemoveCardExpiryFromDownstreamSuggestionDescription,
1077 flags_ui::kOsIos,
1078 FEATURE_VALUE_TYPE(autofill::features::
1079 kAutofillRemoveCardExpiryFromDownstreamSuggestion)},
Sergio Collazos58558712022-05-18 17:24:021080 {"enable-feed-ablation", flag_descriptions::kEnableFeedAblationName,
1081 flag_descriptions::kEnableFeedAblationDescription, flags_ui::kOsIos,
1082 FEATURE_VALUE_TYPE(kEnableFeedAblation)},
Chris Lu7f024ed2c2022-05-27 23:11:271083 {"content-suggestions-ui-module-refresh",
1084 flag_descriptions::kContentSuggestionsUIModuleRefreshName,
1085 flag_descriptions::kContentSuggestionsUIModuleRefreshDescription,
1086 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kContentSuggestionsUIModuleRefresh)},
Quentin Pubertd7546ae2022-05-30 14:28:571087 {"3p-intents-in-incognito", flag_descriptions::kIOS3PIntentsInIncognitoName,
1088 flag_descriptions::kIOS3PIntentsInIncognitoDescription, flags_ui::kOsIos,
1089 FEATURE_VALUE_TYPE(kIOS3PIntentsInIncognito)},
Olivier Robin058c1fad2022-05-31 18:24:061090 {"default-browser-intents-show-settings",
1091 flag_descriptions::kDefaultBrowserIntentsShowSettingsName,
1092 flag_descriptions::kDefaultBrowserIntentsShowSettingsDescription,
1093 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDefaultBrowserIntentsShowSettings)},
Ed Chin76b1b35e2022-06-08 23:01:171094 {"enable-discover-feed-ghost-cards",
1095 flag_descriptions::kEnableDiscoverFeedGhostCardsName,
1096 flag_descriptions::kEnableDiscoverFeedGhostCardsDescription,
1097 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDiscoverFeedGhostCardsEnabled)},
Gauthier Ambard30ad9ca2022-06-09 14:15:261098 {"bookmark-string-menu", flag_descriptions::kBookmarkStringName,
1099 flag_descriptions::kBookmarkStringDescription, flags_ui::kOsIos,
1100 FEATURE_WITH_PARAMS_VALUE_TYPE(kBookmarkString,
1101 kPopupMenuBookmarkStringVarations,
1102 "BookmarkString")},
Igor Ruvinova43a66dc2022-06-09 21:57:451103 {"dm-token-deletion", flag_descriptions::kDmTokenDeletionName,
1104 flag_descriptions::kDmTokenDeletionDescription, flags_ui::kOsIos,
Igor Ruvinov44fed9f2022-06-10 22:51:421105 FEATURE_WITH_PARAMS_VALUE_TYPE(policy::features::kDmTokenDeletion,
1106 kDmTokenDeletionVariation,
1107 "DmTokenDeletion")},
Tommy Martinoad42be52022-06-13 11:51:191108 {"ios-password-ui-split", flag_descriptions::kIOSPasswordUISplitName,
1109 flag_descriptions::kIOSPasswordUISplitDescription, flags_ui::kOsIos,
1110 FEATURE_VALUE_TYPE(password_manager::features::kIOSPasswordUISplit)},
Theodor-Stefan Cristea6d087b82022-07-26 15:25:291111 {"ios-password-manager-cross-origin-iframe-support",
1112 flag_descriptions::kIOSPasswordManagerCrossOriginIframeSupportName,
1113 flag_descriptions::kIOSPasswordManagerCrossOriginIframeSupportDescription,
1114 flags_ui::kOsIos,
1115 FEATURE_VALUE_TYPE(password_manager::features::
1116 kIOSPasswordManagerCrossOriginIframeSupport)},
Christian Xud105a1352022-06-17 19:54:141117 {"omnibox-adaptive-suggestions-count",
1118 flag_descriptions::kAdaptiveSuggestionsCountName,
1119 flag_descriptions::kAdaptiveSuggestionsCountDescription, flags_ui::kOsIos,
1120 FEATURE_VALUE_TYPE(omnibox::kAdaptiveSuggestionsCount)},
Chris Lu2fd473f2022-06-28 13:38:201121 {"trending-queries-module", flag_descriptions::kTrendingQueriesModuleName,
1122 flag_descriptions::kTrendingQueriesModuleDescription, flags_ui::kOsIos,
Chris Luc9a5cb12022-07-20 16:11:391123 FEATURE_WITH_PARAMS_VALUE_TYPE(kTrendingQueriesModule,
1124 kTrendingQueriesModuleVariations,
Chris Lu438e1c052022-08-17 02:57:001125 kTrendingQueriesFieldTrialName)},
Nakul Vaidyaddfdfbc2022-06-28 23:43:321126 {"autofill-parse-iban-fields",
Nakul Vaidya876210f2022-08-08 17:47:191127 flag_descriptions::kAutofillParseIBANFieldsName,
1128 flag_descriptions::kAutofillParseIBANFieldsDescription, flags_ui::kOsIos,
1129 FEATURE_VALUE_TYPE(autofill::features::kAutofillParseIBANFields)},
Ernesto Izquierdo Clua7f4e36e22022-07-01 09:38:361130 {"autofill-enable-new-card-unmask-prompt-view",
1131 flag_descriptions::kAutofillEnableNewCardUnmaskPromptViewName,
1132 flag_descriptions::kAutofillEnableNewCardUnmaskPromptViewDescription,
1133 flags_ui::kOsIos,
1134 FEATURE_VALUE_TYPE(kAutofillEnableNewCardUnmaskPromptView)},
Christian Xubdedabec2022-07-04 10:00:131135 {"omnibox-paste-button", flag_descriptions::kOmniboxPasteButtonName,
1136 flag_descriptions::kOmniboxPasteButtonDescription, flags_ui::kOsIos,
1137 FEATURE_WITH_PARAMS_VALUE_TYPE(kOmniboxPasteButton,
1138 kOmniboxPasteButtonVariations,
1139 "OmniboxPasteButton")},
Moe Ahmadi098519d82022-07-27 18:34:241140 {"omnibox-zero-suggest-prefetching",
1141 flag_descriptions::kOmniboxZeroSuggestPrefetchingName,
1142 flag_descriptions::kOmniboxZeroSuggestPrefetchingDescription,
1143 flags_ui::kOsIos, FEATURE_VALUE_TYPE(omnibox::kZeroSuggestPrefetching)},
Vincent Boissellead6cbe22022-07-04 19:32:391144 {"enable-user-policy", flag_descriptions::kEnableUserPolicyName,
1145 flag_descriptions::kEnableUserPolicyDescription, flags_ui::kOsIos,
1146 SINGLE_VALUE_TYPE(policy::kEnableUserPolicy)},
Marc Treibb9d8ed802022-07-05 15:15:491147 {"enable-sync-history-datatype",
1148 flag_descriptions::kSyncEnableHistoryDataTypeName,
1149 flag_descriptions::kSyncEnableHistoryDataTypeDescription, flags_ui::kOsIos,
1150 FEATURE_VALUE_TYPE(syncer::kSyncEnableHistoryDataType)},
Christian Xucf26d562022-07-06 09:28:361151 {"omnibox-max-url-matches", flag_descriptions::kOmniboxMaxURLMatchesName,
1152 flag_descriptions::kOmniboxMaxURLMatchesDescription, flags_ui::kOsIos,
1153 FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kOmniboxMaxURLMatches,
1154 kOmniboxMaxURLMatchesVariations,
1155 "OmniboxMaxURLMatches")},
Olivier Robin60d3a062022-07-06 17:34:061156 {"metrickit-non-crash-reports",
1157 flag_descriptions::kMetrickitNonCrashReportName,
1158 flag_descriptions::kMetrickitNonCrashReportDescription, flags_ui::kOsIos,
1159 FEATURE_VALUE_TYPE(kMetrickitNonCrashReport)},
Siyu An3194bda2022-07-13 19:30:371160 {"autofill-enable-remade-downstream-metrics",
1161 flag_descriptions::kAutofillEnableRemadeDownstreamMetricsName,
1162 flag_descriptions::kAutofillEnableRemadeDownstreamMetricsDescription,
1163 flags_ui::kOsIos,
1164 FEATURE_VALUE_TYPE(
1165 autofill::features::kAutofillEnableRemadeDownstreamMetrics)},
Nakul Vaidya13ca2042022-07-27 01:59:551166 {"autofill-parse-vcn-card-on-file-standalone-cvc-fields",
1167 flag_descriptions::kAutofillParseVcnCardOnFileStandaloneCvcFieldsName,
1168 flag_descriptions::
1169 kAutofillParseVcnCardOnFileStandaloneCvcFieldsDescription,
1170 flags_ui::kOsIos,
1171 FEATURE_VALUE_TYPE(
1172 autofill::features::kAutofillParseVcnCardOnFileStandaloneCvcFields)},
Ed Chin91e44992022-07-27 13:42:341173#if BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
1174 {"feed-background-refresh-ios",
1175 flag_descriptions::kFeedBackgroundRefreshName,
1176 flag_descriptions::kFeedBackgroundRefreshDescription, flags_ui::kOsIos,
1177 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFeedBackgroundRefresh,
1178 kFeedBackgroundRefreshVariations,
1179 "FeedBackgroundRefresh")},
Christian Xu164a2e512022-08-01 20:38:191180 {"omnibox-keyboard-paste-button",
1181 flag_descriptions::kOmniboxKeyboardPasteButtonName,
1182 flag_descriptions::kOmniboxKeyboardPasteButtonDescription,
1183 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kOmniboxKeyboardPasteButton)},
Ed Chin91e44992022-07-27 13:42:341184#endif // BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
Arthur Milchiorcf4877e2022-07-29 14:23:411185 {"enable-cbd-sign-out", flag_descriptions::kEnableCBDSignOutName,
1186 flag_descriptions::kEnableCBDSignOutDescription, flags_ui::kOsIos,
Arthur Milchiord36e2502022-08-11 16:10:111187 FEATURE_VALUE_TYPE(switches::kEnableCbdSignOut)},
Sylvain Defresne1619dd002021-11-06 10:09:481188};
sdefresne14900ee2015-11-27 14:43:211189
Rohit Raobed794c2020-04-27 15:27:451190bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
1191 return false;
1192}
1193
1194flags_ui::FlagsState& GetGlobalFlagsState() {
1195 static base::NoDestructor<flags_ui::FlagsState> flags_state(kFeatureEntries,
1196 nullptr);
1197 return *flags_state;
1198}
David Jean5ca263c2021-08-18 09:19:301199// Creates the experimental test policies map, used by AsyncPolicyLoader and
1200// PolicyLoaderIOS to locally enable policies.
Vincent Boisselleed0e6f1a2021-11-09 06:47:341201NSMutableDictionary* CreateExperimentalTestingPolicies() {
sdefresne14900ee2015-11-27 14:43:211202 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1203
Guillaume Jenkins25e9bd72020-08-27 17:39:061204 // Shared variables for all enterprise experimental flags.
Guillaume Jenkins57606d72020-08-13 17:32:551205 NSMutableDictionary* testing_policies = [[NSMutableDictionary alloc] init];
Guillaume Jenkins25e9bd72020-08-27 17:39:061206 NSMutableArray* allowed_experimental_policies = [[NSMutableArray alloc] init];
Guillaume Jenkins57606d72020-08-13 17:32:551207
Guillaume Jenkins25e9bd72020-08-27 17:39:061208 // Set some sample policy values for testing if EnableSamplePolicies is set to
1209 // true.
Guillaume Jenkinseeb7007c2020-06-25 22:55:401210 if ([defaults boolForKey:@"EnableSamplePolicies"]) {
Guillaume Jenkins57606d72020-08-13 17:32:551211 [testing_policies addEntriesFromDictionary:@{
Tina Wang59d0b7e2020-08-11 04:41:011212 base::SysUTF8ToNSString(policy::key::kAutofillAddressEnabled) : @NO,
1213
Guillaume Jenkinseeb7007c2020-06-25 22:55:401214 base::SysUTF8ToNSString(policy::key::kAutofillCreditCardEnabled) : @NO,
1215
1216 // 2 = Disable all variations
1217 base::SysUTF8ToNSString(policy::key::kChromeVariations) : @2,
1218
1219 // 2 = Do not allow any site to show popups
1220 base::SysUTF8ToNSString(policy::key::kDefaultPopupsSetting) : @2,
1221
Tina Wang5abee802020-07-29 23:09:521222 // Set default search engine.
1223 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderEnabled) :
1224 @YES,
1225 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderSearchURL) :
1226 @"http://www.google.com/search?q={searchTerms}",
1227 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderName) :
Tina Wang7cd0a062020-09-15 21:31:021228 @"TestEngine",
Tina Wang5abee802020-07-29 23:09:521229
Tina Wang89068c842020-10-29 15:51:501230 base::SysUTF8ToNSString(policy::key::kEditBookmarksEnabled) : @NO,
1231
Gauthier Ambard21b23702021-04-16 16:11:271232 base::SysUTF8ToNSString(policy::key::kNTPContentSuggestionsEnabled) : @NO,
1233
Guillaume Jenkinseeb7007c2020-06-25 22:55:401234 base::SysUTF8ToNSString(policy::key::kPasswordManagerEnabled) : @NO,
Tina Wang59d0b7e2020-08-11 04:41:011235
1236 base::SysUTF8ToNSString(policy::key::kTranslateEnabled) : @NO,
Tina Wang54dddfc22020-08-20 22:34:531237
1238 // 2 = Enhanced safe browsing protection
1239 base::SysUTF8ToNSString(policy::key::kSafeBrowsingProtectionLevel) : @2,
1240
1241 base::SysUTF8ToNSString(policy::key::kSearchSuggestEnabled) : @YES,
Guillaume Jenkins57606d72020-08-13 17:32:551242 }];
1243 }
1244
Ewann227a3c02021-04-19 12:04:541245 if ([defaults boolForKey:@"EnableSyncDisabledPolicy"]) {
Guillaume Jenkinsfe46d3a2021-04-26 19:51:041246 NSString* sync_policy_key =
1247 base::SysUTF8ToNSString(policy::key::kSyncDisabled);
David Jean5ca263c2021-08-18 09:19:301248 [testing_policies addEntriesFromDictionary:@{sync_policy_key : @YES}];
Ewann227a3c02021-04-19 12:04:541249 }
Ewann227a3c02021-04-19 12:04:541250
Ewann570a6302021-08-17 07:22:421251 // SyncTypesListDisabled policy.
1252 NSString* Sync_types_list_disabled_key =
1253 base::SysUTF8ToNSString(policy::key::kSyncTypesListDisabled);
1254 NSMutableArray* Sync_types_list_disabled_values =
1255 [[NSMutableArray alloc] init];
1256 if ([defaults boolForKey:@"SyncTypesListBookmarks"]) {
1257 [Sync_types_list_disabled_values addObject:@"bookmarks"];
1258 }
1259 if ([defaults boolForKey:@"SyncTypesListReadingList"]) {
1260 [Sync_types_list_disabled_values addObject:@"readingList"];
1261 }
1262 if ([defaults boolForKey:@"SyncTypesListPreferences"]) {
1263 [Sync_types_list_disabled_values addObject:@"preferences"];
1264 }
1265 if ([defaults boolForKey:@"SyncTypesListPasswords"]) {
1266 [Sync_types_list_disabled_values addObject:@"passwords"];
1267 }
1268 if ([defaults boolForKey:@"SyncTypesListAutofill"]) {
1269 [Sync_types_list_disabled_values addObject:@"autofill"];
1270 }
1271 if ([defaults boolForKey:@"SyncTypesListTypedUrls"]) {
1272 [Sync_types_list_disabled_values addObject:@"typedUrls"];
1273 }
1274 if ([defaults boolForKey:@"SyncTypesListTabs"]) {
1275 [Sync_types_list_disabled_values addObject:@"tabs"];
1276 }
1277 if ([Sync_types_list_disabled_values count]) {
1278 [testing_policies addEntriesFromDictionary:@{
1279 Sync_types_list_disabled_key : Sync_types_list_disabled_values
1280 }];
Ewann570a6302021-08-17 07:22:421281 }
1282
Gauthier Ambard073eaa92021-11-22 15:24:131283 // If an incognito mode availability is set, set the value.
Tina Wangc6bcf572021-01-27 18:15:521284 NSString* incognito_policy_key =
1285 base::SysUTF8ToNSString(policy::key::kIncognitoModeAvailability);
1286 NSInteger incognito_mode_availability =
1287 [defaults integerForKey:incognito_policy_key];
1288 if (incognito_mode_availability) {
Tina Wangc6bcf572021-01-27 18:15:521289 [testing_policies addEntriesFromDictionary:@{
1290 incognito_policy_key : @(incognito_mode_availability),
1291 }];
1292 }
1293
Ewann40a8f8a2021-07-29 10:01:201294 NSString* restriction_pattern =
1295 [defaults stringForKey:@"RestrictAccountsToPatterns"];
1296 if ([restriction_pattern length] > 0) {
Ewannb3bee382021-08-16 09:12:291297 NSString* restrict_key =
1298 base::SysUTF8ToNSString(policy::key::kRestrictAccountsToPatterns);
Ewann40a8f8a2021-07-29 10:01:201299 [testing_policies addEntriesFromDictionary:@{
Ewannb3bee382021-08-16 09:12:291300 restrict_key : @[ restriction_pattern ]
Ewann40a8f8a2021-07-29 10:01:201301 }];
1302 }
1303
Vincent Boisselle19200bc2021-09-01 17:58:251304 // If the sign-in policy is set (not "None"), add the policy key to the list
1305 // of enabled experimental policies, and set the value.
1306 NSString* const kSigninPolicyKey = @"BrowserSignin";
1307 NSInteger signin_policy_mode = [defaults integerForKey:kSigninPolicyKey];
1308 if (signin_policy_mode) {
1309 // Remove the mode offset that was used to represent the unset policy.
1310 --signin_policy_mode;
1311 DCHECK(signin_policy_mode >= 0);
1312
Vincent Boisselle19200bc2021-09-01 17:58:251313 [testing_policies addEntriesFromDictionary:@{
1314 kSigninPolicyKey : @(signin_policy_mode),
1315 }];
1316 }
1317
Veronique Nguyen9b1044f2022-01-11 14:41:131318 // If the New Tab Page URL is set (not empty) add the value to the list of
1319 // test policies.
1320 NSString* ntp_location = [defaults stringForKey:@"NTPLocation"];
1321 if ([ntp_location length] > 0) {
1322 NSString* ntp_location_key =
1323 base::SysUTF8ToNSString(policy::key::kNewTabPageLocation);
1324 [testing_policies
1325 addEntriesFromDictionary:@{ntp_location_key : ntp_location}];
Veronique Nguyen302d8702022-01-12 21:18:571326 [allowed_experimental_policies addObject:ntp_location_key];
Veronique Nguyen9b1044f2022-01-11 14:41:131327 }
1328
Ali Juma9ec36d2b2022-03-28 14:53:121329 if ([defaults boolForKey:@"DisallowChromeDataInBackups"]) {
1330 NSString* allow_backups_key =
1331 base::SysUTF8ToNSString(policy::key::kAllowChromeDataInBackups);
1332 [testing_policies addEntriesFromDictionary:@{allow_backups_key : @NO}];
1333 [allowed_experimental_policies addObject:allow_backups_key];
1334 }
1335
Guillaume Jenkins25e9bd72020-08-27 17:39:061336 // If any experimental policy was allowed, set the EnableExperimentalPolicies
1337 // policy.
1338 if ([allowed_experimental_policies count] > 0) {
1339 [testing_policies setValue:allowed_experimental_policies
1340 forKey:base::SysUTF8ToNSString(
1341 policy::key::kEnableExperimentalPolicies)];
1342 }
1343
jlebel2eb40222022-05-06 11:15:421344 NSString* metrics_reporting_key = @"MetricsReportingEnabled";
1345 switch ([defaults integerForKey:metrics_reporting_key]) {
1346 case 1:
1347 // Metrics reporting forced.
1348 [testing_policies setValue:@(YES) forKey:metrics_reporting_key];
1349 break;
1350 case 2:
1351 // Metrics reporting disabled.
1352 [testing_policies setValue:@(NO) forKey:metrics_reporting_key];
1353 break;
1354 default:
1355 // Metrics reporting not managed.
1356 break;
1357 }
1358
David Jean6f85d44f2021-08-19 08:08:451359 // Warning: Add new flags to TestingPoliciesHash() below.
1360
David Jean5ca263c2021-08-18 09:19:301361 return testing_policies;
1362}
David Jean6f85d44f2021-08-19 08:08:451363
1364// Generates a unique NSString based on currently monitored policies from
1365// NSUserDefaults standardUserDefaults.
1366NSString* TestingPoliciesHash() {
1367 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1368 return [NSString
jlebel2eb40222022-05-06 11:15:421369 stringWithFormat:@"%d|%d|%d|%d|%@|%d|%d|%d|%d|%d|%d|%d|%d|%@|%d",
Ali Juma9ec36d2b2022-03-28 14:53:121370 [defaults boolForKey:@"DisallowChromeDataInBackups"],
David Jean6f85d44f2021-08-19 08:08:451371 [defaults boolForKey:@"EnableSyncDisabledPolicy"],
1372 [defaults boolForKey:@"EnableSamplePolicies"],
jlebel2eb40222022-05-06 11:15:421373 static_cast<int>([defaults
1374 integerForKey:@"IncognitoModeAvailability"]),
David Jean6f85d44f2021-08-19 08:08:451375 [defaults stringForKey:@"RestrictAccountsToPatterns"],
1376 [defaults boolForKey:@"SyncTypesListBookmarks"],
1377 [defaults boolForKey:@"SyncTypesListReadingList"],
1378 [defaults boolForKey:@"SyncTypesListPreferences"],
1379 [defaults boolForKey:@"SyncTypesListPasswords"],
1380 [defaults boolForKey:@"SyncTypesListAutofill"],
1381 [defaults boolForKey:@"SyncTypesListTypedUrls"],
jlebel2eb40222022-05-06 11:15:421382 [defaults boolForKey:@"SyncTypesListTabs"],
1383 static_cast<int>(
1384 [defaults integerForKey:@"BrowserSignin"]),
1385 [defaults stringForKey:@"NTPLocation"],
1386 static_cast<int>([defaults
1387 integerForKey:@"MetricsReportingEnabled"])];
David Jean6f85d44f2021-08-19 08:08:451388}
David Jean5ca263c2021-08-18 09:19:301389} // namespace
1390
Gauthier Ambard02dbf022022-08-23 08:28:471391// Add all switches from experimental flags to `command_line`.
David Jean5ca263c2021-08-18 09:19:301392void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) {
1393 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1394
1395 // Set the UA flag if UseMobileSafariUA is enabled.
1396 if ([defaults boolForKey:@"UseMobileSafariUA"]) {
1397 // Safari uses "Vesion/", followed by the OS version excluding bugfix, where
1398 // Chrome puts its product token.
1399 int32_t major = 0;
1400 int32_t minor = 0;
1401 int32_t bugfix = 0;
1402 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix);
1403 std::string product = base::StringPrintf("Version/%d.%d", major, minor);
1404
1405 command_line->AppendSwitchASCII(switches::kUserAgent,
1406 web::BuildMobileUserAgent(product));
1407 }
1408
1409 // Shared variables for all enterprise experimental flags.
Vincent Boisselleed0e6f1a2021-11-09 06:47:341410 NSMutableDictionary* testing_policies = CreateExperimentalTestingPolicies();
David Jean5ca263c2021-08-18 09:19:301411
1412 // If a CBCM enrollment token is provided, force Chrome Browser Cloud
1413 // Management to enabled and add the token to the list of policies.
1414 NSString* token_key =
1415 base::SysUTF8ToNSString(policy::key::kCloudManagementEnrollmentToken);
1416 NSString* token = [defaults stringForKey:token_key];
1417
1418 if ([token length] > 0) {
1419 command_line->AppendSwitch(switches::kEnableChromeBrowserCloudManagement);
1420 [testing_policies setValue:token forKey:token_key];
1421 }
1422
Vincent Boisselled042d552022-04-09 01:22:591423 if ([defaults boolForKey:@"EnableUserPolicy"]) {
1424 policy::EnableUserPolicy();
1425 }
1426
Guillaume Jenkins57606d72020-08-13 17:32:551427 // If some policies were set, commit them to the app's registration defaults.
1428 if ([testing_policies count] > 0) {
Guillaume Jenkinseeb7007c2020-06-25 22:55:401429 NSDictionary* registration_defaults =
1430 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
1431 [defaults registerDefaults:registration_defaults];
1432 }
1433
sdefresne14900ee2015-11-27 14:43:211434 // Freeform commandline flags. These are added last, so that any flags added
1435 // earlier in this function take precedence.
1436 if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) {
1437 base::CommandLine::StringVector flags;
1438 // Append an empty "program" argument.
1439 flags.push_back("");
1440
1441 // The number of flags corresponds to the number of text fields in
1442 // Experimental.plist.
1443 const int kNumFreeformFlags = 5;
1444 for (int i = 1; i <= kNumFreeformFlags; ++i) {
1445 NSString* key =
1446 [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i];
1447 NSString* flag = [defaults stringForKey:key];
1448 if ([flag length]) {
Robbie Gibsonc91ce622019-05-20 14:44:331449 // iOS keyboard replaces -- with —, so undo that.
1450 flag = [flag stringByReplacingOccurrencesOfString:@"—"
1451 withString:@"--"
1452 options:0
1453 range:NSMakeRange(0, 1)];
1454 // To make things easier, allow flags with no dashes by prepending them
1455 // here. This also allows for flags that just have one dash if they
1456 // exist.
1457 if (![flag hasPrefix:@"-"]) {
1458 flag = [@"--" stringByAppendingString:flag];
1459 }
sdefresne14900ee2015-11-27 14:43:211460 flags.push_back(base::SysNSStringToUTF8(flag));
1461 }
1462 }
1463
1464 base::CommandLine temp_command_line(flags);
1465 command_line->AppendArguments(temp_command_line, false);
1466 }
msardafc76f662017-02-24 12:46:281467
justincohendacc85d2017-06-28 23:34:101468 // Populate command line flag for 3rd party keyboard omnibox workaround.
1469 NSString* enableThirdPartyKeyboardWorkaround =
1470 [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"];
1471 if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) {
1472 command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround);
1473 } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) {
1474 command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround);
1475 }
1476
Sylvain Defresned3cd8d92022-01-18 13:35:081477 ios::provider::AppendSwitchesFromExperimentalSettings(defaults, command_line);
sdefresne14900ee2015-11-27 14:43:211478}
1479
David Jean5ca263c2021-08-18 09:19:301480void MonitorExperimentalSettingsChanges() {
David Jean5ca263c2021-08-18 09:19:301481 // Startup values for settings to be observed.
David Jean6f85d44f2021-08-19 08:08:451482 __block NSString* hash = TestingPoliciesHash();
David Jeane83ed652021-08-25 14:52:481483 static std::atomic_bool pending_check(false);
David Jean5ca263c2021-08-18 09:19:301484
1485 auto monitor = ^(NSNotification* notification) {
David Jeane83ed652021-08-25 14:52:481486 bool has_pending_check = pending_check.exchange(true);
1487 if (has_pending_check)
1488 return;
1489
David Jeanbc0fae32021-08-25 10:31:391490 // Can be called from any thread from where the notification was sent,
1491 // but since it may change standardUserDefaults, and that has to be on main
1492 // thread, dispatch to main thread.
1493 dispatch_async(dispatch_get_main_queue(), ^{
1494 // Check if observed settings have changed. Since source and destination
1495 // are both user defaults, this is required to avoid cycling back here.
1496 NSString* newHash = TestingPoliciesHash();
1497 if (![newHash isEqualToString:hash]) {
1498 hash = newHash;
David Jean5ca263c2021-08-18 09:19:301499
David Jeanbc0fae32021-08-25 10:31:391500 // Publish update.
1501 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1502 NSMutableDictionary* testing_policies =
Vincent Boisselleed0e6f1a2021-11-09 06:47:341503 CreateExperimentalTestingPolicies();
David Jeanbc0fae32021-08-25 10:31:391504 NSDictionary* registration_defaults =
1505 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
1506 [defaults registerDefaults:registration_defaults];
1507 }
David Jeane83ed652021-08-25 14:52:481508
1509 pending_check.store(false);
David Jeanbc0fae32021-08-25 10:31:391510 });
David Jean5ca263c2021-08-18 09:19:301511 };
1512
1513 NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
1514 [center addObserverForName:NSUserDefaultsDidChangeNotification
1515 object:nil
David Jeanbc0fae32021-08-25 10:31:391516 queue:nil
David Jean5ca263c2021-08-18 09:19:301517 usingBlock:monitor];
1518}
1519
sdefresne14900ee2015-11-27 14:43:211520void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage,
1521 base::CommandLine* command_line) {
Sylvain Defresne8327a2f2019-01-17 14:19:181522 GetGlobalFlagsState().ConvertFlagsToSwitches(
sdefresnec9763902015-12-02 10:30:111523 flags_storage, command_line, flags_ui::kAddSentinels,
Gregory Chatzinofff6523722017-11-21 01:33:531524 switches::kEnableFeatures, switches::kDisableFeatures);
sdefresne14900ee2015-11-27 14:43:211525}
1526
jkrcalbf073372016-07-29 07:21:311527std::vector<std::string> RegisterAllFeatureVariationParameters(
1528 flags_ui::FlagsStorage* flags_storage,
1529 base::FeatureList* feature_list) {
Justin Cohen2e2adb52019-10-25 17:00:021530 // Occasionally DCHECK crashes on canary can be very distuptive. An
1531 // experimental flag was added to aid in temporarily disabling this for
1532 // canary testers.
Peter Boström3f798572022-07-26 23:44:361533#if BUILDFLAG(DCHECK_IS_CONFIGURABLE)
Justin Cohen2e2adb52019-10-25 17:00:021534 if (experimental_flags::AreDCHECKCrashesDisabled()) {
1535 std::vector<base::FeatureList::FeatureOverrideInfo> overrides;
1536 overrides.push_back(
1537 {std::cref(base::kDCheckIsFatalFeature),
1538 base::FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE});
1539 feature_list->RegisterExtraFeatureOverrides(std::move(overrides));
1540 }
Peter Boström3f798572022-07-26 23:44:361541#endif // BUILDFLAG(DCHECK_IS_CONFIGURABLE)
Justin Cohen2e2adb52019-10-25 17:00:021542
Sylvain Defresne8327a2f2019-01-17 14:19:181543 return GetGlobalFlagsState().RegisterAllFeatureVariationParameters(
1544 flags_storage, feature_list);
jkrcalbf073372016-07-29 07:21:311545}
1546
sdefresne14900ee2015-11-27 14:43:211547void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage,
1548 flags_ui::FlagAccess access,
Matt Menke4d777572022-06-15 15:55:501549 base::Value::List& supported_entries,
1550 base::Value::List& unsupported_entries) {
Sylvain Defresne8327a2f2019-01-17 14:19:181551 GetGlobalFlagsState().GetFlagFeatureEntries(
sdefresne14900ee2015-11-27 14:43:211552 flags_storage, access, supported_entries, unsupported_entries,
Renjie Tang208c8192020-11-03 00:46:511553 base::BindRepeating(&SkipConditionalFeatureEntry));
sdefresne14900ee2015-11-27 14:43:211554}
1555
1556void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage,
1557 const std::string& internal_name,
1558 bool enable) {
Sylvain Defresne8327a2f2019-01-17 14:19:181559 GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name,
1560 enable);
sdefresne14900ee2015-11-27 14:43:211561}
1562
1563void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) {
Sylvain Defresne8327a2f2019-01-17 14:19:181564 GetGlobalFlagsState().ResetAllFlags(flags_storage);
sdefresne14900ee2015-11-27 14:43:211565}
1566
1567namespace testing {
1568
Elly Fong-Jones323ab1092021-08-23 22:36:311569base::span<const flags_ui::FeatureEntry> GetFeatureEntries() {
1570 return base::span<const flags_ui::FeatureEntry>(kFeatureEntries,
Daniel Cheng1f047a82022-02-26 10:04:531571 std::size(kFeatureEntries));
sdefresne14900ee2015-11-27 14:43:211572}
1573
1574} // namespace testing