blob: d339aef7966322b13760e57e94c43b9b37279c02 [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"
Eugene But2823dc7e2020-07-21 18:10:3766#include "ios/chrome/browser/crash_report/features.h"
Gauthier Ambard92605132022-08-26 13:25:1767#import "ios/chrome/browser/flags/chrome_switches.h"
Nazerke21bdc45a2019-07-11 09:02:0568#include "ios/chrome/browser/flags/ios_chrome_flag_descriptions.h"
Gauthier Ambard92605132022-08-26 13:25:1769#import "ios/chrome/browser/flags/system_flags.h"
Ed Chin100660bf2022-04-26 16:59:1370#import "ios/chrome/browser/ntp/features.h"
Vincent Boissellead6cbe22022-07-04 19:32:3971#import "ios/chrome/browser/policy/cloud/user_policy_switch.h"
Vincent Boisselle19200bc2021-09-01 17:58:2572#include "ios/chrome/browser/policy/policy_util.h"
Benjamin Williams14233d72022-07-26 18:32:2073#import "ios/chrome/browser/promos_manager/features.h"
Sylvain Defresne9c107082020-10-27 16:39:1374#include "ios/chrome/browser/screen_time/screen_time_buildflags.h"
Olivier Robin3a957df2021-12-21 18:04:3475#import "ios/chrome/browser/sessions/session_features.h"
Zhixiang Teoh40027a22022-07-28 03:24:3476#import "ios/chrome/browser/text_selection/text_selection_util.h"
Hira Mahmoodb0e5f412022-09-01 19:41:0577#import "ios/chrome/browser/ui/app_store_rating/features.h"
Ernesto Izquierdo Clua7f4e36e22022-07-01 09:38:3678#include "ios/chrome/browser/ui/autofill/features.h"
Louis Romeroac04f786a2022-04-19 09:39:3079#include "ios/chrome/browser/ui/bubble/bubble_features.h"
adamta22a4d502020-05-21 03:12:2180#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h"
Javier Ernesto Flores Robles209b2822021-03-25 19:16:5081#import "ios/chrome/browser/ui/default_promo/default_browser_utils.h"
Ewann1a9d33d2021-06-14 11:12:2482#import "ios/chrome/browser/ui/download/features.h"
Rohit Rao5aa791a2022-08-19 17:34:5383#import "ios/chrome/browser/ui/first_run/field_trial_constants.h"
Chris Lu438e1c052022-08-17 02:57:0084#import "ios/chrome/browser/ui/first_run/trending_queries_field_trial.h"
Kurt Horimoto4da682b022018-04-12 07:43:3585#import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h"
adamta273568472020-12-04 23:53:5786#import "ios/chrome/browser/ui/ntp/new_tab_page_feature.h"
Christian Xub8c06cd2022-04-29 20:55:0187#import "ios/chrome/browser/ui/omnibox/omnibox_ui_features.h"
Aliona DANGLAa5257ccc2022-08-29 14:01:4988#import "ios/chrome/browser/ui/open_in/features.h"
Robbie Gibson686c56732021-10-04 17:11:4589#import "ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.h"
Gauthier Ambard30ad9ca2022-06-09 14:15:2690#import "ios/chrome/browser/ui/popup_menu/public/features.h"
gogerald0ff29e52021-02-03 18:56:1991#import "ios/chrome/browser/ui/start_surface/start_surface_features.h"
Kurt Horimoto79d590b2018-09-12 19:09:2892#import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h"
Justin Cohen2d81c582018-01-22 14:46:4493#include "ios/chrome/browser/ui/ui_feature_flags.h"
Yi Su392b3032018-06-05 07:26:4794#include "ios/chrome/browser/web/features.h"
sdefresne14900ee2015-11-27 14:43:2195#include "ios/chrome/grit/ios_strings.h"
Mustafa Emre Acer4de8863a2022-05-03 22:17:0196#include "ios/components/security_interstitials/https_only_mode/feature.h"
Sylvain Defresne559ce5f2022-01-13 17:14:5897#include "ios/public/provider/chrome/browser/app_utils/app_utils_api.h"
Eugene But61818bc2019-04-15 21:04:0798#include "ios/web/common/features.h"
Eugene Bute79f2742019-07-26 17:07:2299#include "ios/web/common/user_agent.h"
Eugene Butb1416232019-07-22 17:31:58100#include "ios/web/common/web_view_creation_util.h"
sdefresne14900ee2015-11-27 14:43:21101
Sylvain Defresne9c107082020-10-27 16:39:13102#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
103#include "ios/chrome/browser/screen_time/features.h"
104#endif
105
sdefresne14900ee2015-11-27 14:43:21106#if !defined(OFFICIAL_BUILD)
107#include "components/variations/variations_switches.h"
vitaliii489217aa2017-01-30 14:50:22108#endif
stkhapuginc1be1792016-12-13 14:30:53109
110#if !defined(__has_feature) || !__has_feature(objc_arc)
111#error "This file requires ARC support."
112#endif
sdefresne14900ee2015-11-27 14:43:21113
elawrence816f6790e2017-06-16 18:19:28114using flags_ui::FeatureEntry;
115
sdefresne14900ee2015-11-27 14:43:21116namespace {
Emily Starkbafa9062017-12-27 15:22:46117
Olivier Robin3d60411622018-02-23 10:03:22118const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = {
119 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
120 {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"},
121 {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"},
122 {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"},
123 {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"},
124 {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"},
125 {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"},
126 {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"},
127 {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"},
128};
129
Nohemi Fernandez222d6d42020-09-30 20:35:57130const FeatureEntry::Choice kDelayThresholdMinutesToUpdateGaiaCookieChoices[] = {
131 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
132 {"0", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "0"},
133 {"10", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "10"},
134 {"60", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "60"},
135};
136
Nohemi Fernandezc00842a2021-07-26 11:47:34137const FeatureEntry::Choice
138 kWaitThresholdMillisecondsForCapabilitiesApiChoices[] = {
139 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
140 {"200", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "200"},
141 {"500", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "500"},
142 {"5000", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "5000"},
143};
144
Stepan Khapugincc4e9842019-01-23 13:38:13145const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = {
146 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}};
147const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = {
148 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}};
149const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = {
150 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}};
151const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = {
152 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}};
153const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = {
154 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}};
155const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = {
156 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}};
157const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = {
158 {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}};
159
160const FeatureEntry::FeatureVariation
161 kOmniboxUIMaxAutocompleteMatchesVariations[] = {
162 {"3 matches", kOmniboxUIMaxAutocompleteMatches3,
Daniel Cheng1f047a82022-02-26 10:04:53163 std::size(kOmniboxUIMaxAutocompleteMatches3), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13164 {"4 matches", kOmniboxUIMaxAutocompleteMatches4,
Daniel Cheng1f047a82022-02-26 10:04:53165 std::size(kOmniboxUIMaxAutocompleteMatches4), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13166 {"5 matches", kOmniboxUIMaxAutocompleteMatches5,
Daniel Cheng1f047a82022-02-26 10:04:53167 std::size(kOmniboxUIMaxAutocompleteMatches5), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13168 {"6 matches", kOmniboxUIMaxAutocompleteMatches6,
Daniel Cheng1f047a82022-02-26 10:04:53169 std::size(kOmniboxUIMaxAutocompleteMatches6), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13170 {"8 matches", kOmniboxUIMaxAutocompleteMatches8,
Daniel Cheng1f047a82022-02-26 10:04:53171 std::size(kOmniboxUIMaxAutocompleteMatches8), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13172 {"10 matches", kOmniboxUIMaxAutocompleteMatches10,
Daniel Cheng1f047a82022-02-26 10:04:53173 std::size(kOmniboxUIMaxAutocompleteMatches10), nullptr},
Stepan Khapugincc4e9842019-01-23 13:38:13174 {"12 matches", kOmniboxUIMaxAutocompleteMatches12,
Daniel Cheng1f047a82022-02-26 10:04:53175 std::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}};
Stepan Khapugincc4e9842019-01-23 13:38:13176
Stepan Khapuginbac467e2022-05-06 21:11:54177const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches6[] = {
178 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "6"}};
179const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches15[] = {
180 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "15"}};
181const FeatureEntry::FeatureParam kOmniboxMaxZPSMatches20[] = {
182 {OmniboxFieldTrial::kMaxZeroSuggestMatchesParam, "20"}};
183
184const FeatureEntry::FeatureVariation kOmniboxMaxZPSMatchesVariations[] = {
185 {"6 matches", kOmniboxMaxZPSMatches6, std::size(kOmniboxMaxZPSMatches6),
186 nullptr},
187 {"15 matches", kOmniboxMaxZPSMatches15, std::size(kOmniboxMaxZPSMatches15),
188 nullptr},
189 {"20 matches", kOmniboxMaxZPSMatches20, std::size(kOmniboxMaxZPSMatches20),
190 nullptr},
191};
192
Christian Xucf26d562022-07-06 09:28:36193const FeatureEntry::FeatureParam kOmniboxMaxURLMatches5[] = {
194 {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "5"}};
195const FeatureEntry::FeatureParam kOmniboxMaxURLMatches6[] = {
196 {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "6"}};
197const FeatureEntry::FeatureParam kOmniboxMaxURLMatches7[] = {
198 {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "7"}};
199
200const FeatureEntry::FeatureVariation kOmniboxMaxURLMatchesVariations[] = {
201 {"5 matches", kOmniboxMaxURLMatches5, std::size(kOmniboxMaxURLMatches5),
202 nullptr},
203 {"6 matches", kOmniboxMaxURLMatches6, std::size(kOmniboxMaxURLMatches6),
204 nullptr},
205 {"7 matches", kOmniboxMaxURLMatches7, std::size(kOmniboxMaxURLMatches7),
206 nullptr},
207};
208
Caitlin Fischer37e01232019-05-24 13:05:45209const FeatureEntry::FeatureParam
210 kAutofillUseMobileLabelDisambiguationShowAll[] = {
211 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
212 autofill::features::
213 kAutofillUseMobileLabelDisambiguationParameterShowAll}};
214const FeatureEntry::FeatureParam
215 kAutofillUseMobileLabelDisambiguationShowOne[] = {
216 {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName,
217 autofill::features::
218 kAutofillUseMobileLabelDisambiguationParameterShowOne}};
219
220const FeatureEntry::FeatureVariation
221 kAutofillUseMobileLabelDisambiguationVariations[] = {
222 {"(show all)", kAutofillUseMobileLabelDisambiguationShowAll,
Daniel Cheng1f047a82022-02-26 10:04:53223 std::size(kAutofillUseMobileLabelDisambiguationShowAll), nullptr},
Caitlin Fischer37e01232019-05-24 13:05:45224 {"(show one)", kAutofillUseMobileLabelDisambiguationShowOne,
Daniel Cheng1f047a82022-02-26 10:04:53225 std::size(kAutofillUseMobileLabelDisambiguationShowOne), nullptr}};
Caitlin Fischer37e01232019-05-24 13:05:45226
Javier Ernesto Flores Roblese85f4a12021-02-23 18:10:10227const FeatureEntry::FeatureParam
Javier Ernesto Flores Robles159414232021-06-16 14:29:59228 kDefaultBrowserFullscreenPromoExperimentRemindMeLater[] = {
229 {kDefaultBrowserFullscreenPromoExperimentRemindMeGroupParam, "true"}};
230const FeatureEntry::FeatureVariation
231 kDefaultBrowserFullscreenPromoExperimentVariations[] = {
232 {"Remind me later",
233 kDefaultBrowserFullscreenPromoExperimentRemindMeLater,
Daniel Cheng1f047a82022-02-26 10:04:53234 std::size(kDefaultBrowserFullscreenPromoExperimentRemindMeLater),
Javier Ernesto Flores Robles159414232021-06-16 14:29:59235 nullptr}};
236
gogeralddb0d8ae2020-11-13 03:56:58237const FeatureEntry::FeatureParam kDiscoverFeedInNtpEnableNativeUI[] = {
238 {kDiscoverFeedIsNativeUIEnabled, "true"}};
239const FeatureEntry::FeatureVariation kDiscoverFeedInNtpVariations[] = {
240 {"Native UI", kDiscoverFeedInNtpEnableNativeUI,
Daniel Cheng1f047a82022-02-26 10:04:53241 std::size(kDiscoverFeedInNtpEnableNativeUI), nullptr}};
gogeralddb0d8ae2020-11-13 03:56:58242
Sergio Collazos9fcc6ed2021-10-06 00:58:03243const FeatureEntry::FeatureParam kDiscoverFeedSRSReconstructedTemplates[] = {
244 {kDiscoverFeedSRSReconstructedTemplatesEnabled, "true"}};
245const FeatureEntry::FeatureParam kDiscoverFeedSRSPreloadTemplates[] = {
246 {kDiscoverFeedSRSPreloadTemplatesEnabled, "true"}};
247const FeatureEntry::FeatureVariation
248 kEnableDiscoverFeedStaticResourceServingVariations[] = {
249 {"Reconstruct Templates", kDiscoverFeedSRSReconstructedTemplates,
Daniel Cheng1f047a82022-02-26 10:04:53250 std::size(kDiscoverFeedSRSReconstructedTemplates), nullptr},
Sergio Collazos9fcc6ed2021-10-06 00:58:03251 {"Preload Templates", kDiscoverFeedSRSPreloadTemplates,
Daniel Cheng1f047a82022-02-26 10:04:53252 std::size(kDiscoverFeedSRSPreloadTemplates), nullptr},
Sergio Collazos9fcc6ed2021-10-06 00:58:03253};
254
Mohammad Refaatab6bee62022-05-16 16:31:15255const FeatureEntry::FeatureParam kDiscoverFeedTopSyncPromoFullWithTitle[] = {
adamtadb0bfc62022-08-01 17:37:47256 {kDiscoverFeedTopSyncPromoStyleFullWithTitle, "true"},
257 {kDiscoverFeedTopSyncPromoStyleCompact, "false"}};
Mohammad Refaatab6bee62022-05-16 16:31:15258const FeatureEntry::FeatureParam kDiscoverFeedTopSyncPromoCompact[] = {
adamtadb0bfc62022-08-01 17:37:47259 {kDiscoverFeedTopSyncPromoStyleFullWithTitle, "false"},
260 {kDiscoverFeedTopSyncPromoStyleCompact, "true"}};
261
Mohammad Refaatab6bee62022-05-16 16:31:15262const FeatureEntry::FeatureVariation kDiscoverFeedTopSyncPromoVariations[] = {
263 {"Full with title", kDiscoverFeedTopSyncPromoFullWithTitle,
264 std::size(kDiscoverFeedTopSyncPromoFullWithTitle), nullptr},
265 {"Compact", kDiscoverFeedTopSyncPromoCompact,
266 std::size(kDiscoverFeedTopSyncPromoCompact), nullptr}};
267
Robbie Gibson46351032022-03-31 19:46:23268const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion1[] = {
269 {kIOSOmniboxUpdatedPopupUIVariationName,
270 kIOSOmniboxUpdatedPopupUIVariation1}};
271const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion2[] = {
272 {kIOSOmniboxUpdatedPopupUIVariationName,
273 kIOSOmniboxUpdatedPopupUIVariation2}};
Stepan Khapugin0fd1869a2022-08-09 10:23:47274const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion3[] = {
275 {kIOSOmniboxUpdatedPopupUIVariationName,
276 kIOSOmniboxUpdatedPopupUIVariation1UIKit}};
277const FeatureEntry::FeatureParam kiOSOmniboxUpdatedPopupUIVersion4[] = {
278 {kIOSOmniboxUpdatedPopupUIVariationName,
279 kIOSOmniboxUpdatedPopupUIVariation2UIKit}};
Robbie Gibson46351032022-03-31 19:46:23280const FeatureEntry::FeatureVariation kiOSOmniboxUpdatedPopupUIVariations[] = {
Stepan Khapugin0fd1869a2022-08-09 10:23:47281 {"Version 1 - SwiftUI", kiOSOmniboxUpdatedPopupUIVersion1,
Robbie Gibson46351032022-03-31 19:46:23282 std::size(kiOSOmniboxUpdatedPopupUIVersion1), nullptr},
Stepan Khapugin0fd1869a2022-08-09 10:23:47283 {"Version 2 - SwiftUI", kiOSOmniboxUpdatedPopupUIVersion2,
284 std::size(kiOSOmniboxUpdatedPopupUIVersion2), nullptr},
285 {"Version 1 - UIKit", kiOSOmniboxUpdatedPopupUIVersion3,
286 std::size(kiOSOmniboxUpdatedPopupUIVersion3), nullptr},
287 {"Version 2 - UIKit", kiOSOmniboxUpdatedPopupUIVersion4,
288 std::size(kiOSOmniboxUpdatedPopupUIVersion4), nullptr}};
Robbie Gibson46351032022-03-31 19:46:23289
gogerald53c6e7a2021-04-15 22:07:35290const FeatureEntry::FeatureParam kStartSurfaceTenSecondsShrinkLogo[] = {
Chris Lu5470417c2021-03-03 18:43:08291 {kStartSurfaceShrinkLogoParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35292 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
293const FeatureEntry::FeatureParam kStartSurfaceTenSecondsHideShortcuts[] = {
Chris Lu5470417c2021-03-03 18:43:08294 {kStartSurfaceHideShortcutsParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35295 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
296const FeatureEntry::FeatureParam kStartSurfaceTenSecondsReturnToRecentTab[] = {
Chris Lu5470417c2021-03-03 18:43:08297 {kStartSurfaceReturnToRecentTabParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35298 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
299const FeatureEntry::FeatureParam
300 kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab[] = {
301 {kStartSurfaceShrinkLogoParam, "true"},
302 {kStartSurfaceReturnToRecentTabParam, "true"},
303 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
304const FeatureEntry::FeatureParam
305 kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab[] = {
306 {kStartSurfaceHideShortcutsParam, "true"},
307 {kStartSurfaceReturnToRecentTabParam, "true"},
308 {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}};
309const FeatureEntry::FeatureParam kStartSurfaceOneHourShrinkLogo[] = {
Chris Lu5470417c2021-03-03 18:43:08310 {kStartSurfaceShrinkLogoParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35311 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
312const FeatureEntry::FeatureParam kStartSurfaceOneHourHideShortcuts[] = {
313 {kStartSurfaceHideShortcutsParam, "true"},
314 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
315const FeatureEntry::FeatureParam kStartSurfaceOneHourReturnToRecentTab[] = {
Chris Lu5470417c2021-03-03 18:43:08316 {kStartSurfaceReturnToRecentTabParam, "true"},
gogerald53c6e7a2021-04-15 22:07:35317 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
318const FeatureEntry::FeatureParam
319 kStartSurfaceOneHourShrinkLogoReturnToRecentTab[] = {
320 {kStartSurfaceShrinkLogoParam, "true"},
321 {kStartSurfaceReturnToRecentTabParam, "true"},
322 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
323const FeatureEntry::FeatureParam
324 kStartSurfaceOneHourHideShortcutsReturnToRecentTab[] = {
325 {kStartSurfaceHideShortcutsParam, "true"},
326 {kStartSurfaceReturnToRecentTabParam, "true"},
327 {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}};
Chris Lu5470417c2021-03-03 18:43:08328
gogerald0e39e3aa2021-02-10 18:41:23329const FeatureEntry::FeatureVariation kStartSurfaceVariations[] = {
gogerald53c6e7a2021-04-15 22:07:35330 {"10s:Show Return to Recent Tab tile",
331 kStartSurfaceTenSecondsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53332 std::size(kStartSurfaceTenSecondsReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35333 {"10s:Shrink Logo", kStartSurfaceTenSecondsShrinkLogo,
Daniel Cheng1f047a82022-02-26 10:04:53334 std::size(kStartSurfaceTenSecondsShrinkLogo), nullptr},
gogerald53c6e7a2021-04-15 22:07:35335 {"10s:Hide Shortcuts", kStartSurfaceTenSecondsHideShortcuts,
Daniel Cheng1f047a82022-02-26 10:04:53336 std::size(kStartSurfaceTenSecondsHideShortcuts), nullptr},
gogerald53c6e7a2021-04-15 22:07:35337 {"10s:Shrink Logo and show Return to Recent Tab tile",
338 kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53339 std::size(kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35340 {"10s:Hide Shortcuts and show Return to Recent Tab tile",
341 kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53342 std::size(kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35343 {"1h:Show Return to Recent Tab tile", kStartSurfaceOneHourReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53344 std::size(kStartSurfaceOneHourReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35345 {"1h:Shrink Logo", kStartSurfaceOneHourShrinkLogo,
Daniel Cheng1f047a82022-02-26 10:04:53346 std::size(kStartSurfaceOneHourShrinkLogo), nullptr},
gogerald53c6e7a2021-04-15 22:07:35347 {"1h:Hide Shortcuts", kStartSurfaceOneHourHideShortcuts,
Daniel Cheng1f047a82022-02-26 10:04:53348 std::size(kStartSurfaceOneHourHideShortcuts), nullptr},
gogerald53c6e7a2021-04-15 22:07:35349 {"1h:Shrink Logo and show Return to Recent Tab tile",
350 kStartSurfaceOneHourShrinkLogoReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53351 std::size(kStartSurfaceOneHourShrinkLogoReturnToRecentTab), nullptr},
gogerald53c6e7a2021-04-15 22:07:35352 {"1h:Hide Shortcuts and show Return to Recent Tab tile",
353 kStartSurfaceOneHourHideShortcutsReturnToRecentTab,
Daniel Cheng1f047a82022-02-26 10:04:53354 std::size(kStartSurfaceOneHourHideShortcutsReturnToRecentTab), nullptr},
Chris Lu5470417c2021-03-03 18:43:08355};
gogerald0e39e3aa2021-02-10 18:41:23356
Ed Chin91e44992022-07-27 13:42:34357#if BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
Ed Chin59f617b2022-07-19 22:12:04358// Feed Background Refresh Feature Params
Ed Chin321b8fe2022-08-16 07:02:01359const FeatureEntry::FeatureParam kOneHourIntervalOneHourMaxAgeOnce[] = {
Ed Chin59f617b2022-07-19 22:12:04360 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
361 {kEnableRecurringBackgroundRefreshSchedule, "false"},
Ed Chin321b8fe2022-08-16 07:02:01362 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
Ed Chin59f617b2022-07-19 22:12:04363 {kBackgroundRefreshIntervalInSeconds, /* 60*60= */ "3600"}};
Ed Chin321b8fe2022-08-16 07:02:01364const FeatureEntry::FeatureParam kFourHourIntervalSixHourMaxAgeOnce[] = {
Ed Chin59f617b2022-07-19 22:12:04365 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
366 {kEnableRecurringBackgroundRefreshSchedule, "false"},
Ed Chin321b8fe2022-08-16 07:02:01367 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
Ed Chin59f617b2022-07-19 22:12:04368 {kBackgroundRefreshIntervalInSeconds, /* 4*60*60= */ "14400"}};
Ed Chin321b8fe2022-08-16 07:02:01369const FeatureEntry::FeatureParam kOneHourIntervalOneHourMaxAgeRecurring[] = {
Ed Chin59f617b2022-07-19 22:12:04370 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
371 {kEnableRecurringBackgroundRefreshSchedule, "true"},
Ed Chin321b8fe2022-08-16 07:02:01372 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
Ed Chin59f617b2022-07-19 22:12:04373 {kBackgroundRefreshIntervalInSeconds, /* 60*60= */ "3600"}};
Ed Chin321b8fe2022-08-16 07:02:01374const FeatureEntry::FeatureParam kFourHourIntervalSixHourMaxAgeRecurring[] = {
Ed Chin59f617b2022-07-19 22:12:04375 {kEnableServerDrivenBackgroundRefreshSchedule, "false"},
376 {kEnableRecurringBackgroundRefreshSchedule, "true"},
Ed Chin321b8fe2022-08-16 07:02:01377 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
Ed Chin59f617b2022-07-19 22:12:04378 {kBackgroundRefreshIntervalInSeconds, /* 4*60*60= */ "14400"}};
Ed Chin321b8fe2022-08-16 07:02:01379const FeatureEntry::FeatureParam kServerDrivenOneHourMaxAgeOnce[] = {
Ed Chin59f617b2022-07-19 22:12:04380 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
381 {kEnableRecurringBackgroundRefreshSchedule, "false"},
Ed Chin321b8fe2022-08-16 07:02:01382 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
383 {kBackgroundRefreshIntervalInSeconds, "0"}};
384const FeatureEntry::FeatureParam kServerDrivenOneHourMaxAgeRecurring[] = {
Ed Chin59f617b2022-07-19 22:12:04385 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
386 {kEnableRecurringBackgroundRefreshSchedule, "true"},
Ed Chin321b8fe2022-08-16 07:02:01387 {kMaxCacheAgeInSeconds, /*60*60*/ "3600"},
388 {kBackgroundRefreshIntervalInSeconds, "0"}};
389const FeatureEntry::FeatureParam kServerDrivenSixHourMaxAgeOnce[] = {
390 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
391 {kEnableRecurringBackgroundRefreshSchedule, "false"},
392 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
393 {kBackgroundRefreshIntervalInSeconds, "0"}};
394const FeatureEntry::FeatureParam kServerDrivenSixHourMaxAgeRecurring[] = {
395 {kEnableServerDrivenBackgroundRefreshSchedule, "true"},
396 {kEnableRecurringBackgroundRefreshSchedule, "true"},
397 {kMaxCacheAgeInSeconds, /*6*60*60*/ "21600"},
398 {kBackgroundRefreshIntervalInSeconds, "0"}};
Ed Chin59f617b2022-07-19 22:12:04399
400// Feed Background Refresh Feature Variations
Ed Chin59f617b2022-07-19 22:12:04401const FeatureEntry::FeatureVariation kFeedBackgroundRefreshVariations[] = {
Ed Chin321b8fe2022-08-16 07:02:01402 {"1hr Interval 1hr Max Age Once", kOneHourIntervalOneHourMaxAgeOnce,
403 std::size(kOneHourIntervalOneHourMaxAgeOnce), nullptr},
404 {"4hr Interval 6hr Max Age Once", kFourHourIntervalSixHourMaxAgeOnce,
405 std::size(kFourHourIntervalSixHourMaxAgeOnce), nullptr},
406 {"1hr Interval 1hr Max Age Recurring",
407 kOneHourIntervalOneHourMaxAgeRecurring,
408 std::size(kOneHourIntervalOneHourMaxAgeRecurring), nullptr},
409 {"4hr Interval 6hr Max Age Recurring",
410 kFourHourIntervalSixHourMaxAgeRecurring,
411 std::size(kFourHourIntervalSixHourMaxAgeRecurring), nullptr},
412 {"Server Driven 1hr Max Age Once", kServerDrivenOneHourMaxAgeOnce,
413 std::size(kServerDrivenOneHourMaxAgeOnce), nullptr},
414 {"Server Driven 1hr Max Age Recurring", kServerDrivenOneHourMaxAgeRecurring,
415 std::size(kServerDrivenOneHourMaxAgeRecurring), nullptr},
416 {"Server Driven 6hr Max Age Once", kServerDrivenSixHourMaxAgeOnce,
417 std::size(kServerDrivenSixHourMaxAgeOnce), nullptr},
418 {"Server Driven 6hr Max Age Recurring", kServerDrivenSixHourMaxAgeRecurring,
419 std::size(kServerDrivenSixHourMaxAgeRecurring), nullptr},
Ed Chin59f617b2022-07-19 22:12:04420};
Ed Chin91e44992022-07-27 13:42:34421#endif // BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
Ed Chin59f617b2022-07-19 22:12:04422
ginnnnnnny46435132022-06-01 16:06:04423const FeatureEntry::FeatureParam kFREDefaultBrowserPromoDefaultDelay[] = {
424 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoDefaultDelayParam}};
425const FeatureEntry::FeatureParam kFREDefaultBrowserPromoFirstRunOnly[] = {
426 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoFirstRunOnlyParam}};
427const FeatureEntry::FeatureParam kFREDefaultBrowserPromoShortDelay[] = {
428 {kFREDefaultBrowserPromoParam, kFREDefaultBrowserPromoShortDelayParam}};
429const FeatureEntry::FeatureVariation kFREDefaultBrowserPromoVariations[] = {
Aliona DANGLA8fae66f02021-10-06 15:47:11430 {"Wait 14 days after FRE default browser promo",
ginnnnnnny46435132022-06-01 16:06:04431 kFREDefaultBrowserPromoDefaultDelay,
432 std::size(kFREDefaultBrowserPromoDefaultDelay), nullptr},
433 {"FRE default browser promo only", kFREDefaultBrowserPromoFirstRunOnly,
434 std::size(kFREDefaultBrowserPromoFirstRunOnly), nullptr},
Aliona DANGLA8fae66f02021-10-06 15:47:11435 {"Wait 3 days after FRE default browser promo",
ginnnnnnny46435132022-06-01 16:06:04436 kFREDefaultBrowserPromoShortDelay,
437 std::size(kFREDefaultBrowserPromoShortDelay), nullptr},
Aliona DANGLA8fae66f02021-10-06 15:47:11438};
439
Chris Luc9a5cb12022-07-20 16:11:39440const FeatureEntry::FeatureParam kTrendingQueriesEnableAllUsers[] = {
441 {kTrendingQueriesHideShortcutsParam, "false"},
442 {kTrendingQueriesDisabledFeedParam, "false"},
443 {kTrendingQueriesSignedOutParam, "false"}};
444const FeatureEntry::FeatureParam kTrendingQueriesEnableAllUsersHideShortcuts[] =
445 {{kTrendingQueriesHideShortcutsParam, "true"},
446 {kTrendingQueriesDisabledFeedParam, "false"},
447 {kTrendingQueriesSignedOutParam, "false"}};
448const FeatureEntry::FeatureParam kTrendingQueriesEnableFeedDisabled[] = {
449 {kTrendingQueriesHideShortcutsParam, "false"},
450 {kTrendingQueriesDisabledFeedParam, "true"},
451 {kTrendingQueriesSignedOutParam, "false"}};
452const FeatureEntry::FeatureParam kTrendingQueriesEnableSignedOut[] = {
453 {kTrendingQueriesHideShortcutsParam, "true"},
454 {kTrendingQueriesDisabledFeedParam, "false"},
455 {kTrendingQueriesSignedOutParam, "true"}};
Chris Luecd575f2022-08-05 23:23:06456const FeatureEntry::FeatureParam
457 kTrendingQueriesEnableNeverShowHideShortcuts[] = {
458 {kTrendingQueriesHideShortcutsParam, "true"},
459 {kTrendingQueriesDisabledFeedParam, "false"},
460 {kTrendingQueriesSignedOutParam, "false"},
461 {kTrendingQueriesNeverShowModuleParam, "true"}};
Chris Luc9a5cb12022-07-20 16:11:39462
463const FeatureEntry::FeatureVariation kTrendingQueriesModuleVariations[] = {
464 {"Enabled All Users", kTrendingQueriesEnableAllUsers,
465 std::size(kTrendingQueriesEnableAllUsers), nullptr},
466 {"Enabled All Users Hide Shortcuts",
467 kTrendingQueriesEnableAllUsersHideShortcuts,
468 std::size(kTrendingQueriesEnableAllUsersHideShortcuts), nullptr},
469 {"Enabled Disabled Feed", kTrendingQueriesEnableFeedDisabled,
470 std::size(kTrendingQueriesEnableFeedDisabled), nullptr},
471 {"Enabled Signed Out", kTrendingQueriesEnableSignedOut,
472 std::size(kTrendingQueriesEnableSignedOut), nullptr},
Chris Luecd575f2022-08-05 23:23:06473 {"Enabled Never Show and Hide Shortcuts",
474 kTrendingQueriesEnableNeverShowHideShortcuts,
475 std::size(kTrendingQueriesEnableNeverShowHideShortcuts), nullptr},
476
Chris Luc9a5cb12022-07-20 16:11:39477};
478
jlebel041fc1c2022-03-04 12:53:30479const FeatureEntry::FeatureParam kNewMICEFREWithUMADialog[] = {
480 {kNewMobileIdentityConsistencyFREParam,
481 kNewMobileIdentityConsistencyFREParamUMADialog}};
482const FeatureEntry::FeatureParam kNewMICEFREWithThreeSteps[] = {
483 {kNewMobileIdentityConsistencyFREParam,
484 kNewMobileIdentityConsistencyFREParamThreeSteps}};
485const FeatureEntry::FeatureParam kNewMICEFREWithTwoSteps[] = {
486 {kNewMobileIdentityConsistencyFREParam,
487 kNewMobileIdentityConsistencyFREParamTwoSteps}};
488const FeatureEntry::FeatureVariation
489 kNewMobileIdentityConsistencyFREVariations[] = {
490 {"New FRE with UMA dialog", kNewMICEFREWithUMADialog,
491 std::size(kNewMICEFREWithUMADialog), nullptr},
492 {"new FRE with 3 steps", kNewMICEFREWithThreeSteps,
493 std::size(kNewMICEFREWithThreeSteps), nullptr},
494 {"new FRE with 2 steps", kNewMICEFREWithTwoSteps,
495 std::size(kNewMICEFREWithTwoSteps), nullptr}};
496
Louis Romero023cc5052022-04-08 23:29:39497const FeatureEntry::FeatureParam kBubbleRichIPHTargetHighlight[] = {
498 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterTargetHighlight}};
Christian Xubd60c4b72022-03-22 15:25:01499const FeatureEntry::FeatureParam kBubbleRichIPHExplicitDismissal[] = {
500 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterExplicitDismissal}};
501const FeatureEntry::FeatureParam kBubbleRichIPHRich[] = {
502 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRich}};
503const FeatureEntry::FeatureParam kBubbleRichIPHRichWithSnooze[] = {
504 {kBubbleRichIPHParameterName, kBubbleRichIPHParameterRichWithSnooze}};
505const FeatureEntry::FeatureVariation kBubbleRichIPHVariations[] = {
Louis Romero023cc5052022-04-08 23:29:39506 {"Target Highlight", kBubbleRichIPHTargetHighlight,
507 std::size(kBubbleRichIPHTargetHighlight), nullptr},
Christian Xubd60c4b72022-03-22 15:25:01508 {"Explicit dismissal", kBubbleRichIPHExplicitDismissal,
509 std::size(kBubbleRichIPHExplicitDismissal), nullptr},
510 {"Dismissal and rich content", kBubbleRichIPHRich,
511 std::size(kBubbleRichIPHRich), nullptr},
Louis Romero023cc5052022-04-08 23:29:39512 {"Dismissal, rich content, and snooze", kBubbleRichIPHRichWithSnooze,
Christian Xubd60c4b72022-03-22 15:25:01513 std::size(kBubbleRichIPHRichWithSnooze), nullptr},
514};
515
Christian Xubdedabec2022-07-04 10:00:13516const FeatureEntry::FeatureParam kOmniboxPasteButtonBlueIconCapsule[] = {
517 {kOmniboxPasteButtonParameterName,
518 kOmniboxPasteButtonParameterBlueIconCapsule}};
519const FeatureEntry::FeatureParam kOmniboxPasteButtonBlueFullCapsule[] = {
520 {kOmniboxPasteButtonParameterName,
521 kOmniboxPasteButtonParameterBlueFullCapsule}};
522const FeatureEntry::FeatureVariation kOmniboxPasteButtonVariations[] = {
523 {"Icon only", kOmniboxPasteButtonBlueIconCapsule,
524 std::size(kOmniboxPasteButtonBlueIconCapsule), nullptr},
525 {"Icon and text", kOmniboxPasteButtonBlueFullCapsule,
526 std::size(kOmniboxPasteButtonBlueFullCapsule), nullptr},
527};
528
Gauthier Ambard30ad9ca2022-06-09 14:15:26529const FeatureEntry::FeatureParam kPopupMenuBookmarkStringAddABookmark[] = {
530 {kPopupMenuBookmarkStringParamName,
531 kPopupMenuBookmarkStringParamAddABookmark}};
532const FeatureEntry::FeatureParam kPopupMenuBookmarkStringAddToBookmarks[] = {
533 {kPopupMenuBookmarkStringParamName,
534 kPopupMenuBookmarkStringParamAddToBookmarks}};
535const FeatureEntry::FeatureParam kPopupMenuBookmarkStringBookmarkThisPage[] = {
536 {kPopupMenuBookmarkStringParamName,
537 kPopupMenuBookmarkStringParamBookmarkThisPage}};
538
539const FeatureEntry::FeatureVariation kPopupMenuBookmarkStringVarations[] = {
540 {"(Add A Bookmark)", kPopupMenuBookmarkStringAddABookmark,
541 std::size(kPopupMenuBookmarkStringAddABookmark), nullptr},
542 {"(Add To Bookmarks)", kPopupMenuBookmarkStringAddToBookmarks,
543 std::size(kPopupMenuBookmarkStringAddToBookmarks), nullptr},
544 {"(Bookmark This Page)", kPopupMenuBookmarkStringBookmarkThisPage,
545 std::size(kPopupMenuBookmarkStringBookmarkThisPage), nullptr}};
546
Igor Ruvinov44fed9f2022-06-10 22:51:42547const FeatureEntry::FeatureParam kDmTokenDeletionParam[] = {{"forced", "true"}};
548const FeatureEntry::FeatureVariation kDmTokenDeletionVariation[] = {
549 {"(Forced)", kDmTokenDeletionParam, std::size(kDmTokenDeletionParam),
550 nullptr}};
551
Aliona DANGLAa5257ccc2022-08-29 14:01:49552const FeatureEntry::FeatureParam kOpenInDownloadWithWKDownload[] = {
553 {kOpenInDownloadWithWKDownloadParam, "true"}};
554const FeatureEntry::FeatureParam kOpenInDownloadWithV2[] = {
555 {kOpenInDownloadWithV2Param, "true"}};
556const FeatureEntry::FeatureVariation kOpenInDownloadVariations[] = {
557 {"With WKDownload", kOpenInDownloadWithWKDownload,
558 std::size(kOpenInDownloadWithWKDownload), nullptr},
559 {"With V2", kOpenInDownloadWithV2, std::size(kOpenInDownloadWithV2),
560 nullptr},
561};
562
ginnnnnnny591a4972022-09-01 16:10:27563const FeatureEntry::FeatureParam kAutofillBrandingIOSMonotone[] = {
564 {autofill::features::kAutofillBrandingIOSParam, "true"}};
565const FeatureEntry::FeatureVariation kAutofillBrandingIOSVariations[] = {
566 {"(Monotone)", kAutofillBrandingIOSMonotone,
567 std::size(kAutofillBrandingIOSMonotone), nullptr}};
568
Cooper Knaak1e026562017-07-26 05:22:28569// To add a new entry, add to the end of kFeatureEntries. There are four
sdefresne14900ee2015-11-27 14:43:21570// distinct types of entries:
Cooper Knaak1e026562017-07-26 05:22:28571// . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the
572// default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE
sdefresne14900ee2015-11-27 14:43:21573// macro for this type supplying the command line to the macro.
574// . MULTI_VALUE: a list of choices, the first of which should correspond to a
575// deactivated state for this lab (i.e. no command line option). To specify
576// this type of entry use the macro MULTI_VALUE_TYPE supplying it the
577// array of choices.
Cooper Knaak1e026562017-07-26 05:22:28578// . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is
579// either enabled, disabled, or uses the default value of the associated
580// base::Feature instance. To specify this type of entry use the macro
581// FEATURE_VALUE_TYPE supplying it the base::Feature instance.
582// . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a
583// base::Feature instance. Choices corresponding to the default state, a
584// universally enabled state, and a universally disabled state are
585// automatically included. To specify this type of entry use the macro
586// FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and
587// the array of choices.
588//
sdefresne14900ee2015-11-27 14:43:21589// See the documentation of FeatureEntry for details on the fields.
590//
591// When adding a new choice, add it to the end of the list.
592const flags_ui::FeatureEntry kFeatureEntries[] = {
Cooper Knaak1e026562017-07-26 05:22:28593 {"in-product-help-demo-mode-choice",
594 flag_descriptions::kInProductHelpDemoModeName,
595 flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos,
596 FEATURE_WITH_PARAMS_VALUE_TYPE(
Tommy Nyquistc1d6dea12017-07-26 20:37:23597 feature_engagement::kIPHDemoMode,
598 feature_engagement::kIPHDemoModeChoiceVariations,
Marc Treib2752e8b2017-08-04 14:12:09599 "IPH_DemoMode")},
Moe Ahmadic3fd7cd2018-05-11 21:40:22600 {"enable-autofill-credit-card-upload",
601 flag_descriptions::kAutofillCreditCardUploadName,
602 flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos,
Anne Lim579b5732018-08-30 18:24:24603 FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)},
Tina Wang41d431c2021-06-21 21:04:13604 {"enable-discover-feed-preview",
605 flag_descriptions::kEnableDiscoverFeedPreviewName,
606 flag_descriptions::kEnableDiscoverFeedPreviewDescription, flags_ui::kOsIos,
607 FEATURE_VALUE_TYPE(kEnableDiscoverFeedPreview)},
Moe Ahmadid6d5d172018-06-20 17:20:23608 {"use-sync-sandbox", flag_descriptions::kSyncSandboxName,
609 flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos,
610 SINGLE_VALUE_TYPE_AND_VALUE(
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51611 syncer::kSyncServiceURL,
Moe Ahmadid6d5d172018-06-20 17:20:23612 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")},
613 {"wallet-service-use-sandbox",
614 flag_descriptions::kWalletServiceUseSandboxName,
615 flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos,
616 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
617 autofill::switches::kWalletServiceUseSandbox,
618 "1",
619 autofill::switches::kWalletServiceUseSandbox,
620 "0")},
Mohamad Ahmadic4df81f2017-12-20 04:41:59621 {"show-autofill-type-predictions",
622 flag_descriptions::kShowAutofillTypePredictionsName,
623 flag_descriptions::kShowAutofillTypePredictionsDescription,
624 flags_ui::kOsIos,
Gauthier Ambardcfd85182018-01-05 10:37:46625 FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)},
Olivier Robin3d60411622018-02-23 10:03:22626 {"autofill-ios-delay-between-fields",
627 flag_descriptions::kAutofillIOSDelayBetweenFieldsName,
628 flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription,
629 flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)},
Benjamin Williams14233d72022-07-26 18:32:20630 {"fullscreen-promos-manager",
631 flag_descriptions::kFullscreenPromosManagerName,
632 flag_descriptions::kFullscreenPromosManagerDescription, flags_ui::kOsIos,
633 FEATURE_VALUE_TYPE(kFullscreenPromosManager)},
Kurt Horimotodc33af32018-05-01 01:39:14634 {"fullscreen-viewport-adjustment-experiment",
Chris Lu481a9322019-09-25 22:16:53635 flag_descriptions::kFullscreenSmoothScrollingName,
636 flag_descriptions::kFullscreenSmoothScrollingDescription, flags_ui::kOsIos,
637 FEATURE_VALUE_TYPE(fullscreen::features::kSmoothScrollingDefault)},
Robbie Gibson1f37a5e2020-08-06 17:03:06638 {"webpage-default-zoom-from-dynamic-type",
639 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeName,
640 flag_descriptions::kWebPageDefaultZoomFromDynamicTypeDescription,
641 flags_ui::kOsIos,
642 FEATURE_VALUE_TYPE(web::kWebPageDefaultZoomFromDynamicType)},
Robbie Gibson88f23962020-09-28 14:35:56643 {"webpage-alternative-text-zoom",
644 flag_descriptions::kWebPageAlternativeTextZoomName,
645 flag_descriptions::kWebPageAlternativeTextZoomDescription,
646 flags_ui::kOsIos, FEATURE_VALUE_TYPE(web::kWebPageAlternativeTextZoom)},
Robbie Gibson1095b72c2022-06-06 17:03:34647 {"webpage-text-zoom-ipad", flag_descriptions::kWebPageTextZoomIPadName,
648 flag_descriptions::kWebPageTextZoomIPadDescription, flags_ui::kOsIos,
649 FEATURE_VALUE_TYPE(web::kWebPageTextZoomIPad)},
Kurt Horimoto79d590b2018-09-12 19:09:28650 {"toolbar-container", flag_descriptions::kToolbarContainerName,
651 flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos,
652 FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)},
Stepan Khapugincc4e9842019-01-23 13:38:13653 {"omnibox-ui-max-autocomplete-matches",
654 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName,
655 flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription,
656 flags_ui::kOsIos,
657 FEATURE_WITH_PARAMS_VALUE_TYPE(
658 omnibox::kUIExperimentMaxAutocompleteMatches,
659 kOmniboxUIMaxAutocompleteMatchesVariations,
660 "OmniboxUIMaxAutocompleteVariations")},
Moe Ahmadi01028f22022-08-06 17:57:35661 {"omnibox-local-history-zero-suggest-beyond-ntp",
662 flag_descriptions::kOmniboxLocalHistoryZeroSuggestBeyondNTPName,
663 flag_descriptions::kOmniboxLocalHistoryZeroSuggestBeyondNTPDescription,
664 flags_ui::kOsIos,
665 FEATURE_VALUE_TYPE(omnibox::kLocalHistoryZeroSuggestBeyondNTP)},
Stepan Khapuginbac467e2022-05-06 21:11:54666 {"omnibox-max-zps-matches", flag_descriptions::kOmniboxMaxZPSMatchesName,
667 flag_descriptions::kOmniboxMaxZPSMatchesDescription, flags_ui::kOsIos,
668 FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kMaxZeroSuggestMatches,
669 kOmniboxMaxZPSMatchesVariations,
670 "OmniboxMaxZPSVariations")},
Peter Boström3f798572022-07-26 23:44:36671#if BUILDFLAG(DCHECK_IS_CONFIGURABLE)
Justin Cohen20b6f072019-01-16 01:38:50672 {"dcheck-is-fatal", flag_descriptions::kDcheckIsFatalName,
673 flag_descriptions::kDcheckIsFatalDescription, flags_ui::kOsIos,
674 FEATURE_VALUE_TYPE(base::kDCheckIsFatalFeature)},
Peter Boström3f798572022-07-26 23:44:36675#endif // BUILDFLAG(DCHECK_IS_CONFIGURABLE)
Caitlin Fischer43edd90a2019-05-01 13:24:30676 {"autofill-use-mobile-label-disambiguation",
677 flag_descriptions::kAutofillUseMobileLabelDisambiguationName,
678 flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription,
679 flags_ui::kOsIos,
Caitlin Fischer37e01232019-05-24 13:05:45680 FEATURE_WITH_PARAMS_VALUE_TYPE(
681 autofill::features::kAutofillUseMobileLabelDisambiguation,
682 kAutofillUseMobileLabelDisambiguationVariations,
683 "AutofillUseMobileLabelDisambiguation")},
Olivier Robin43814bb2021-06-22 15:25:45684 {"metrickit-crash-reports", flag_descriptions::kMetrickitCrashReportName,
685 flag_descriptions::kMetrickitCrashReportDescription, flags_ui::kOsIos,
686 FEATURE_VALUE_TYPE(kMetrickitCrashReport)},
Mike Doughertyb6c770d2019-09-13 22:56:46687 {"ios-breadcrumbs", flag_descriptions::kLogBreadcrumbsName,
688 flag_descriptions::kLogBreadcrumbsDescription, flags_ui::kOsIos,
Jesse McKenna85c1a59f2021-05-05 19:08:30689 FEATURE_VALUE_TYPE(breadcrumbs::kLogBreadcrumbs)},
Eugene But2823dc7e2020-07-21 18:10:37690 {"ios-synthetic-crash-reports",
691 flag_descriptions::kSyntheticCrashReportsForUteName,
692 flag_descriptions::kSyntheticCrashReportsForUteDescription,
693 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSyntheticCrashReportsForUte)},
Jérôme Lebelc374fdd2019-09-27 10:36:48694 {"force-startup-signin-promo",
695 flag_descriptions::kForceStartupSigninPromoName,
696 flag_descriptions::kForceStartupSigninPromoDescription, flags_ui::kOsIos,
Alice Wang345e09442021-07-05 09:03:29697 FEATURE_VALUE_TYPE(switches::kForceStartupSigninPromo)},
Yoichi Osato7ae11752021-03-16 03:27:22698 {"restore-session-from-cache",
699 flag_descriptions::kRestoreSessionFromCacheName,
700 flag_descriptions::kRestoreSessionFromCacheDescription, flags_ui::kOsIos,
Justin Cohen3ec2522c2021-04-23 18:23:49701 FEATURE_VALUE_TYPE(web::kRestoreSessionFromCache)},
sczs4622e6e2019-11-06 01:17:59702 {"autofill-save-card-dismiss-on-navigation",
703 flag_descriptions::kAutofillSaveCardDismissOnNavigationName,
704 flag_descriptions::kAutofillSaveCardDismissOnNavigationDescription,
705 flags_ui::kOsIos,
706 FEATURE_VALUE_TYPE(
707 autofill::features::kAutofillSaveCardDismissOnNavigation)},
sczs37d9c132020-07-18 06:06:33708 {"new-content-suggestions-feed", flag_descriptions::kDiscoverFeedInNtpName,
adamta22a4d502020-05-21 03:12:21709 flag_descriptions::kDiscoverFeedInNtpDescription, flags_ui::kOsIos,
gogeralddb0d8ae2020-11-13 03:56:58710 FEATURE_WITH_PARAMS_VALUE_TYPE(kDiscoverFeedInNtp,
711 kDiscoverFeedInNtpVariations,
712 "IOSDiscoverFeed")},
Roberto Mourab87b9722020-06-17 17:12:09713 {"expanded-tab-strip", flag_descriptions::kExpandedTabStripName,
714 flag_descriptions::kExpandedTabStripDescription, flags_ui::kOsIos,
715 FEATURE_VALUE_TYPE(kExpandedTabStrip)},
Tommy Martino6b4eb7e2020-06-25 18:25:41716 {"shared-highlighting-ios", flag_descriptions::kSharedHighlightingIOSName,
717 flag_descriptions::kSharedHighlightingIOSDescription, flags_ui::kOsIos,
718 FEATURE_VALUE_TYPE(kSharedHighlightingIOS)},
Veronique Nguyen6593c762021-11-30 17:28:56719 {"enable-fre-ui-module-ios-with-options",
720 flag_descriptions::kEnableFREUIModuleIOSName,
Tina Wanga252ca42021-04-01 17:14:23721 flag_descriptions::kEnableFREUIModuleIOSDescription, flags_ui::kOsIos,
ginnnnnnny429b5522022-05-05 03:50:06722 FEATURE_VALUE_TYPE(kEnableFREUIModuleIOS)},
jlebel041fc1c2022-03-04 12:53:30723 {"new-mobile-identity-consistency-fre",
724 flag_descriptions::kNewMobileIdentityConsistencyFREName,
725 flag_descriptions::kNewMobileIdentityConsistencyFREDescription,
726 flags_ui::kOsIos,
727 FEATURE_WITH_PARAMS_VALUE_TYPE(signin::kNewMobileIdentityConsistencyFRE,
728 kNewMobileIdentityConsistencyFREVariations,
ginnnnnnny46435132022-06-01 16:06:04729 kIOSMICeAndDefaultBrowserTrialName)},
Sylvain Defresne9c107082020-10-27 16:39:13730#if BUILDFLAG(IOS_SCREEN_TIME_ENABLED)
edchin81467b82020-09-03 19:31:45731 {"screen-time-integration-ios",
732 flag_descriptions::kScreenTimeIntegrationName,
733 flag_descriptions::kScreenTimeIntegrationDescription, flags_ui::kOsIos,
734 FEATURE_VALUE_TYPE(kScreenTimeIntegration)},
Sylvain Defresne9c107082020-10-27 16:39:13735#endif
Nazerke3e993f72020-09-21 13:00:06736 {"modern-tab-strip", flag_descriptions::kModernTabStripName,
737 flag_descriptions::kModernTabStripDescription, flags_ui::kOsIos,
738 FEATURE_VALUE_TYPE(kModernTabStrip)},
Nohemi Fernandez222d6d42020-09-30 20:35:57739 {"minutes-delay-to-restore-gaia-cookies-if-deleted",
740 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieName,
741 flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieDescription,
742 flags_ui::kOsIos,
743 MULTI_VALUE_TYPE(kDelayThresholdMinutesToUpdateGaiaCookieChoices)},
Eugene Butf869bff2020-12-10 01:16:55744 {"record-snapshot-size", flag_descriptions::kRecordSnapshotSizeName,
745 flag_descriptions::kRecordSnapshotSizeDescription, flags_ui::kOsIos,
746 FEATURE_VALUE_TYPE(web::features::kRecordSnapshotSize)},
Chris Lub17195f2020-12-10 20:49:14747 {"default-browser-fullscreen-promo-experiment",
748 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentName,
749 flag_descriptions::kDefaultBrowserFullscreenPromoExperimentDescription,
750 flags_ui::kOsIos,
Javier Ernesto Flores Robles159414232021-06-16 14:29:59751 FEATURE_WITH_PARAMS_VALUE_TYPE(
752 kDefaultBrowserFullscreenPromoExperiment,
753 kDefaultBrowserFullscreenPromoExperimentVariations,
754 "IOSDefaultBrowserFullscreenPromoExperiment")},
Cheick Cisse76ade3d2020-12-16 00:15:11755 {"ios-shared-highlighting-color-change",
756 flag_descriptions::kIOSSharedHighlightingColorChangeName,
757 flag_descriptions::kIOSSharedHighlightingColorChangeDescription,
Cheick Cissed0b5bfe2021-02-11 14:23:07758 flags_ui::kOsIos,
759 FEATURE_VALUE_TYPE(web::features::kIOSSharedHighlightingColorChange)},
Cheick Cissefe994862021-12-15 16:01:34760 {"ios-shared-highlighting-v2",
761 flag_descriptions::kIOSSharedHighlightingV2Name,
762 flag_descriptions::kIOSSharedHighlightingV2Description, flags_ui::kOsIos,
763 FEATURE_VALUE_TYPE(shared_highlighting::kIOSSharedHighlightingV2)},
Stepan Khapugin04341202021-01-07 12:22:45764 {"omnibox-new-textfield-implementation",
765 flag_descriptions::kOmniboxNewImplementationName,
766 flag_descriptions::kOmniboxNewImplementationDescription, flags_ui::kOsIos,
767 FEATURE_VALUE_TYPE(kIOSNewOmniboxImplementation)},
Stepan Khapuginecf128a92022-08-30 11:23:15768 {"omnibox-fuzzy-url-suggestions",
769 flag_descriptions::kOmniboxFuzzyUrlSuggestionsName,
770 flag_descriptions::kOmniboxFuzzyUrlSuggestionsDescription,
771 flags_ui::kOsIos,
772 FEATURE_VALUE_TYPE(omnibox::kOmniboxFuzzyUrlSuggestions)},
Stepan Khapugin422f08d2022-02-18 16:19:44773 {"omnibox-new-popup-ui", flag_descriptions::kIOSOmniboxUpdatedPopupUIName,
774 flag_descriptions::kIOSOmniboxUpdatedPopupUIDescription, flags_ui::kOsIos,
Robbie Gibson46351032022-03-31 19:46:23775 FEATURE_WITH_PARAMS_VALUE_TYPE(kIOSOmniboxUpdatedPopupUI,
776 kiOSOmniboxUpdatedPopupUIVariations,
Stepan Khapugina45baed2022-05-13 19:15:43777 "IOSOmniboxUpdatedPopupUI")},
gogerald0ff29e52021-02-03 18:56:19778 {"start-surface", flag_descriptions::kStartSurfaceName,
779 flag_descriptions::kStartSurfaceDescription, flags_ui::kOsIos,
gogerald0e39e3aa2021-02-10 18:41:23780 FEATURE_WITH_PARAMS_VALUE_TYPE(kStartSurface,
781 kStartSurfaceVariations,
782 "StartSurface")},
Justin Cohen13ac7a202021-02-04 18:27:28783 {"ios-crashpad", flag_descriptions::kCrashpadIOSName,
784 flag_descriptions::kCrashpadIOSDescription, flags_ui::kOsIos,
785 FEATURE_VALUE_TYPE(kCrashpadIOS)},
Vidhan Jain451b4752021-07-15 10:16:42786 {"autofill-address-verification-in-save-prompt",
787 flag_descriptions::kEnableAutofillAddressSavePromptAddressVerificationName,
788 flag_descriptions::
789 kEnableAutofillAddressSavePromptAddressVerificationDescription,
790 flags_ui::kOsIos,
791 FEATURE_VALUE_TYPE(
792 autofill::features::
793 kAutofillAddressProfileSavePromptAddressVerificationSupport)},
Vidhan Jaina65741552021-03-09 17:18:27794 {"autofill-address-save-prompt",
795 flag_descriptions::kEnableAutofillAddressSavePromptName,
796 flag_descriptions::kEnableAutofillAddressSavePromptDescription,
797 flags_ui::kOsIos,
798 FEATURE_VALUE_TYPE(autofill::features::kAutofillAddressProfileSavePrompt)},
Viktor Semeniuk68e794a2021-03-24 10:23:25799 {"filling-across-affiliated-websites",
800 flag_descriptions::kFillingAcrossAffiliatedWebsitesName,
801 flag_descriptions::kFillingAcrossAffiliatedWebsitesDescription,
802 flags_ui::kOsIos,
803 FEATURE_VALUE_TYPE(
804 password_manager::features::kFillingAcrossAffiliatedWebsites)},
Jared Sauld47c2b72021-03-25 22:47:31805 {"autofill-parse-merchant-promo-code-fields",
806 flag_descriptions::kAutofillParseMerchantPromoCodeFieldsName,
807 flag_descriptions::kAutofillParseMerchantPromoCodeFieldsDescription,
808 flags_ui::kOsIos,
809 FEATURE_VALUE_TYPE(
810 autofill::features::kAutofillParseMerchantPromoCodeFields)},
edchin257cea2f2021-04-07 13:07:13811 {"interest-feed-v2-clicks-and-views-cond-upload",
812 flag_descriptions::kInterestFeedV2ClickAndViewActionsConditionalUploadName,
813 flag_descriptions::
814 kInterestFeedV2ClickAndViewActionsConditionalUploadDescription,
815 flags_ui::kOsIos,
816 FEATURE_VALUE_TYPE(feed::kInterestFeedV2ClicksAndViewsConditionalUpload)},
Side Yilmaz6c53f7102021-09-07 13:26:19817 {"incognito-ntp-revamp", flag_descriptions::kIncognitoNtpRevampName,
818 flag_descriptions::kIncognitoNtpRevampDescription, flags_ui::kOsIos,
819 FEATURE_VALUE_TYPE(kIncognitoNtpRevamp)},
Side YILMAZ4b40a3082022-04-11 10:13:33820 {"update-history-entry-points-in-incognito",
821 flag_descriptions::kUpdateHistoryEntryPointsInIncognitoName,
822 flag_descriptions::kUpdateHistoryEntryPointsInIncognitoDescription,
823 flags_ui::kOsIos,
824 FEATURE_VALUE_TYPE(kUpdateHistoryEntryPointsInIncognito)},
jlebeld95434d652021-06-22 10:32:48825 {"sync-trusted-vault-passphrase-ios-rpc",
826 flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCName,
827 flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCDescription,
828 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51829 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseiOSRPC)},
Mikel Astiz850b0fe2021-06-16 09:47:27830 {"sync-trusted-vault-passphrase-promo",
831 flag_descriptions::kSyncTrustedVaultPassphrasePromoName,
832 flag_descriptions::kSyncTrustedVaultPassphrasePromoDescription,
833 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51834 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphrasePromo)},
Mikel Astiz850b0fe2021-06-16 09:47:27835 {"sync-trusted-vault-passphrase-recovery",
836 flag_descriptions::kSyncTrustedVaultPassphraseRecoveryName,
837 flag_descriptions::kSyncTrustedVaultPassphraseRecoveryDescription,
838 flags_ui::kOsIos,
Victor Hugo Vianna Silva3cd7ae92022-02-09 20:49:51839 FEATURE_VALUE_TYPE(::syncer::kSyncTrustedVaultPassphraseRecovery)},
Nohemi Fernandezc00842a2021-07-26 11:47:34840 {"wait-threshold-seconds-for-capabilities-api",
841 flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiName,
842 flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiDescription,
843 flags_ui::kOsIos,
844 MULTI_VALUE_TYPE(kWaitThresholdMillisecondsForCapabilitiesApiChoices)},
Jared Saul2188f762021-08-02 21:22:23845 {"autofill-fill-merchant-promo-code-fields",
846 flag_descriptions::kAutofillFillMerchantPromoCodeFieldsName,
847 flag_descriptions::kAutofillFillMerchantPromoCodeFieldsDescription,
848 flags_ui::kOsIos,
849 FEATURE_VALUE_TYPE(
850 autofill::features::kAutofillFillMerchantPromoCodeFields)},
Sylvain Defresnedff67e42021-09-24 09:43:03851 {"new-overflow-menu", flag_descriptions::kNewOverflowMenuName,
852 flag_descriptions::kNewOverflowMenuDescription, flags_ui::kOsIos,
853 FEATURE_VALUE_TYPE(kNewOverflowMenu)},
Robbie Gibsondf097a72022-09-05 08:17:18854 {"new-overflow-menu-alternate-iph",
855 flag_descriptions::kNewOverflowMenuAlternateIPHName,
856 flag_descriptions::kNewOverflowMenuAlternateIPHDescription,
857 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kNewOverflowMenuAlternateIPH)},
Robbie Gibsonfe748e52022-05-09 18:20:46858 {"new-overflow-menu-settings-action",
859 flag_descriptions::kNewOverflowMenuSettingsActionName,
Robbie Gibsone2ad5632022-05-16 20:46:10860 flag_descriptions::kNewOverflowMenuSettingsActionDescription,
861 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kNewOverflowMenuSettingsAction)},
862 {"new-overflow-menu-simple-destination-icons",
863 flag_descriptions::kNewOverflowMenuSimpleDestinationIconsName,
864 flag_descriptions::kNewOverflowMenuSimpleDestinationIconsDescription,
865 flags_ui::kOsIos,
866 FEATURE_VALUE_TYPE(kNewOverflowMenuSimpleDestinationIcons)},
Robbie Gibson640bccb32022-05-10 18:43:35867 {"new-overflow-menu-cbd-action",
868 flag_descriptions::kNewOverflowMenuCBDActionName,
869 flag_descriptions::kNewOverflowMenuCBDActionDescription, flags_ui::kOsIos,
870 FEATURE_VALUE_TYPE(kNewOverflowMenuCBDAction)},
Evan Bernstein0a85f332021-09-29 19:07:24871 {"use-lens-to-search-for-image",
872 flag_descriptions::kUseLensToSearchForImageName,
873 flag_descriptions::kUseLensToSearchForImageDescription, flags_ui::kOsIos,
Ali Juma02a9b7b2021-10-01 13:44:44874 FEATURE_VALUE_TYPE(kUseLensToSearchForImage)},
Jason Hu3830a072022-08-19 20:56:22875 {"enable-lens-in-home-screen-widget",
876 flag_descriptions::kEnableLensInHomeScreenWidgetName,
877 flag_descriptions::kEnableLensInHomeScreenWidgetDescription,
878 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableLensInHomeScreenWidget)},
879 {"enable-lens-in-keyboard", flag_descriptions::kEnableLensInKeyboardName,
880 flag_descriptions::kEnableLensInKeyboardDescription, flags_ui::kOsIos,
881 FEATURE_VALUE_TYPE(kEnableLensInKeyboard)},
882 {"enable-lens-in-ntp", flag_descriptions::kEnableLensInNTPName,
883 flag_descriptions::kEnableLensInNTPDescription, flags_ui::kOsIos,
884 FEATURE_VALUE_TYPE(kEnableLensInNTP)},
Benjamin Williamsbee6ab62022-02-28 18:09:40885 {"use-load-simulated-request-for-error-page-navigation",
Gauthier Ambard33cceaf2022-05-05 14:00:23886 flag_descriptions::kUseLoadSimulatedRequestForOfflinePageName,
887 flag_descriptions::kUseLoadSimulatedRequestForOfflinePageDescription,
Benjamin Williamsbee6ab62022-02-28 18:09:40888 flags_ui::kOsIos,
Gauthier Ambard33cceaf2022-05-05 14:00:23889 FEATURE_VALUE_TYPE(web::features::kUseLoadSimulatedRequestForOfflinePage)},
Sergio Collazos9fcc6ed2021-10-06 00:58:03890 {"enable-discover-feed-static-resource-serving",
891 flag_descriptions::kEnableDiscoverFeedStaticResourceServingName,
892 flag_descriptions::kEnableDiscoverFeedStaticResourceServingDescription,
893 flags_ui::kOsIos,
894 FEATURE_WITH_PARAMS_VALUE_TYPE(
895 kEnableDiscoverFeedStaticResourceServing,
896 kEnableDiscoverFeedStaticResourceServingVariations,
897 "IOSDiscoverFeedStaticResourceServing")},
898 {"enable-disco-feed-endpoint",
899 flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointName,
900 flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointDescription,
901 flags_ui::kOsIos,
Aliona DANGLA8fae66f02021-10-06 15:47:11902 FEATURE_VALUE_TYPE(kEnableDiscoverFeedDiscoFeedEndpoint)},
Mohammad Refaatab6bee62022-05-16 16:31:15903 {"enable-discover-feed-top-sync-promo",
904 flag_descriptions::kEnableDiscoverFeedTopSyncPromoName,
905 flag_descriptions::kEnableDiscoverFeedTopSyncPromoDescription,
906 flags_ui::kOsIos,
907 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableDiscoverFeedTopSyncPromo,
908 kDiscoverFeedTopSyncPromoVariations,
909 "EnableDiscoverFeedTopSyncPromo")},
Aliona DANGLA8fae66f02021-10-06 15:47:11910 {"enable-fre-default-browser-screen-testing",
ginnnnnnny46435132022-06-01 16:06:04911 flag_descriptions::kEnableFREDefaultBrowserPromoScreenName,
912 flag_descriptions::kEnableFREDefaultBrowserPromoScreenDescription,
Aliona DANGLA8fae66f02021-10-06 15:47:11913 flags_ui::kOsIos,
ginnnnnnny46435132022-06-01 16:06:04914 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFREDefaultBrowserPromoScreen,
915 kFREDefaultBrowserPromoVariations,
916 kIOSMICeAndDefaultBrowserTrialName)},
Tommy Martino7393d762021-10-12 17:59:28917 {"shared-highlighting-amp",
918 flag_descriptions::kIOSSharedHighlightingAmpName,
919 flag_descriptions::kIOSSharedHighlightingAmpDescription, flags_ui::kOsIos,
920 FEATURE_VALUE_TYPE(shared_highlighting::kSharedHighlightingAmp)},
David Maunderf4a5e1e2021-10-18 17:24:28921 {"enable-commerce-price-tracking",
Matt Jones125dfb42022-02-11 17:23:42922 commerce::flag_descriptions::kCommercePriceTrackingName,
923 commerce::flag_descriptions::kCommercePriceTrackingDescription,
924 flags_ui::kOsIos,
925 FEATURE_WITH_PARAMS_VALUE_TYPE(commerce::kCommercePriceTracking,
926 commerce::kCommercePriceTrackingVariations,
adamta67b6c5812021-10-19 17:02:15927 "CommercePriceTracking")},
Tina Wang8058d5f2021-11-04 20:06:06928 {"web-feed-ios", flag_descriptions::kEnableWebChannelsName,
929 flag_descriptions::kEnableWebChannelsDescription, flags_ui::kOsIos,
930 FEATURE_VALUE_TYPE(kEnableWebChannels)},
adamta39331592021-11-01 20:18:54931 {"ntp-view-hierarchy-repair",
932 flag_descriptions::kNTPViewHierarchyRepairName,
933 flag_descriptions::kNTPViewHierarchyRepairDescription, flags_ui::kOsIos,
934 FEATURE_VALUE_TYPE(kNTPViewHierarchyRepair)},
Justin Cohen69cec682021-11-04 20:10:26935 {"synthesized-restore-session",
936 flag_descriptions::kSynthesizedRestoreSessionName,
937 flag_descriptions::kSynthesizedRestoreSessionDescription, flags_ui::kOsIos,
938 FEATURE_VALUE_TYPE(web::features::kSynthesizedRestoreSession)},
Chris Lu4723b822021-11-05 21:47:44939 {"remove-extra-ntps", flag_descriptions::kRemoveExcessNTPsExperimentName,
940 flag_descriptions::kRemoveExcessNTPsExperimentDescription,
Sylvain Defresne1619dd002021-11-06 10:09:48941 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kRemoveExcessNTPs)},
Benjamin Williams0e7e2fb2021-11-17 03:03:41942 {"enable-password-manager-branding-update",
943 flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateName,
944 flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateDescription,
945 flags_ui::kOsIos,
Aliona DANGLAe5b0b6e52021-11-30 11:58:19946 FEATURE_VALUE_TYPE(
947 password_manager::features::kIOSEnablePasswordManagerBrandingUpdate)},
Gauthier Ambard1d326e22021-12-16 10:57:53948 {"default-mode-ua", flag_descriptions::kAddSettingForDefaultPageModeName,
949 flag_descriptions::kAddSettingForDefaultPageModeDescription,
950 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kAddSettingForDefaultPageMode)},
ginnnnnnnyee3036e2022-08-12 18:01:18951 {"ios-media-permissions-control",
952 flag_descriptions::kMediaPermissionsControlName,
953 flag_descriptions::kMediaPermissionsControlDescription, flags_ui::kOsIos,
954 FEATURE_VALUE_TYPE(web::features::kMediaPermissionsControl)},
Olivier Robin3a957df2021-12-21 18:04:34955 {"enable-save-session-tabs-in-separate-files",
956 flag_descriptions::kSaveSessionTabsToSeparateFilesName,
957 flag_descriptions::kSaveSessionTabsToSeparateFilesDescription,
958 flags_ui::kOsIos,
959 FEATURE_VALUE_TYPE(sessions::kSaveSessionTabsToSeparateFiles)},
Ewann8c7aadc2022-05-19 15:41:05960 {"use-sf-symbols", flag_descriptions::kUseSFSymbolsName,
961 flag_descriptions::kUseSFSymbolsDescription, flags_ui::kOsIos,
962 FEATURE_VALUE_TYPE(kUseSFSymbols)},
Nohemi Fernandez76f54802022-01-10 18:23:32963 {"enable-unicorn-account-support",
964 flag_descriptions::kEnableUnicornAccountSupportName,
965 flag_descriptions::kEnableUnicornAccountSupportDescription,
966 flags_ui::kOsIos,
967 FEATURE_VALUE_TYPE(signin::kEnableUnicornAccountSupport)},
David Jeanc2b88ab602022-08-08 14:52:51968 {"ios-webpage-intent-annotations",
969 flag_descriptions::kEnableWebPageAnnotationsName,
970 flag_descriptions::kEnableWebPageAnnotationsDescription, flags_ui::kOsIos,
971 FEATURE_VALUE_TYPE(web::features::kEnableWebPageAnnotations)},
rgod90cca8b2022-02-04 12:38:27972 {"leak-detection-unauthenticated",
973 flag_descriptions::kLeakDetectionUnauthenticatedName,
974 flag_descriptions::kLeakDetectionUnauthenticatedDescription,
975 flags_ui::kOsIos,
976 FEATURE_VALUE_TYPE(
977 password_manager::features::kLeakDetectionUnauthenticated)},
Veronique Nguyen00ba26ea2022-02-25 14:57:17978 {"enable-favicon-passwords",
979 flag_descriptions::kEnableFaviconForPasswordsName,
980 flag_descriptions::kEnableFaviconForPasswordsDescription, flags_ui::kOsIos,
981 FEATURE_VALUE_TYPE(
982 password_manager::features::kEnableFaviconForPasswords)},
Veronique Nguyen56acf802022-09-02 18:43:25983 {"enable-password-grouping",
984 flag_descriptions::kEnableGroupingForPasswordManagerName,
985 flag_descriptions::kEnableGroupingForPasswordManagerDescription,
986 flags_ui::kOsIos,
987 FEATURE_VALUE_TYPE(
988 password_manager::features::kEnableGroupingForPasswordManager)},
Shivani Chauhanbf97b0d2022-02-08 22:21:28989 {"autofill-enable-sending-bcn-in-get-upload-details",
990 flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsName,
991 flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsDescription,
992 flags_ui::kOsIos,
993 FEATURE_VALUE_TYPE(
994 autofill::features::kAutofillEnableSendingBcnInGetUploadDetails)},
Ali Juma1429cf8a2022-02-09 15:31:01995 {"enable-fullscreen-api", flag_descriptions::kEnableFullscreenAPIName,
996 flag_descriptions::kEnableFullscreenAPIDescription, flags_ui::kOsIos,
997 FEATURE_VALUE_TYPE(web::features::kEnableFullscreenAPI)},
Joemer Ramos34175732022-02-14 18:59:16998 {"enable-enhanced-safe-browsing",
999 flag_descriptions::kEnhancedProtectionName,
1000 flag_descriptions::kEnhancedProtectionDescription, flags_ui::kOsIos,
1001 FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtection)},
Joemer Ramos26e2b512022-05-24 17:26:411002 {"enable-enhanced-safe-browsing-phase-2",
1003 flag_descriptions::kEnhancedProtectionPhase2Name,
1004 flag_descriptions::kEnhancedProtectionPhase2Description, flags_ui::kOsIos,
1005 FEATURE_VALUE_TYPE(safe_browsing::kEnhancedProtectionPhase2IOS)},
Shivani Chauhanaf1eb74d2022-02-11 21:13:191006 {"autofill-enable-unmask-card-request-set-instrument-id",
1007 flag_descriptions::kAutofillEnableUnmaskCardRequestSetInstrumentIdName,
1008 flag_descriptions::
1009 kAutofillEnableUnmaskCardRequestSetInstrumentIdDescription,
1010 flags_ui::kOsIos,
1011 FEATURE_VALUE_TYPE(
1012 autofill::features::kAutofillEnableUnmaskCardRequestSetInstrumentId)},
Vishwas Uppoor89303a92022-08-03 00:56:261013 {"autofill-enable-card-product-name",
1014 flag_descriptions::kAutofillEnableCardProductNameName,
1015 flag_descriptions::kAutofillEnableCardProductNameDescription,
1016 flags_ui::kOsIos,
1017 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableCardProductName)},
Victor Hugo Vianna Silvaf0a44002022-02-16 10:38:001018 {"send-tab-to-self-signin-promo",
1019 flag_descriptions::kSendTabToSelfSigninPromoName,
1020 flag_descriptions::kSendTabToSelfSigninPromoDescription, flags_ui::kOsIos,
1021 FEATURE_VALUE_TYPE(send_tab_to_self::kSendTabToSelfSigninPromo)},
Christian Xubd60c4b72022-03-22 15:25:011022 {"bubble-rich-iph", flag_descriptions::kBubbleRichIPHName,
1023 flag_descriptions::kBubbleRichIPHDescription, flags_ui::kOsIos,
1024 FEATURE_WITH_PARAMS_VALUE_TYPE(kBubbleRichIPH,
1025 kBubbleRichIPHVariations,
1026 "BubbleRichIPH")},
Siyu Anff02e742022-04-07 19:08:221027 {"autofill-enforce-delays-in-strike-database",
1028 flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseName,
1029 flag_descriptions::kAutofillEnforceDelaysInStrikeDatabaseDescription,
1030 flags_ui::kOsIos,
1031 FEATURE_VALUE_TYPE(
1032 autofill::features::kAutofillEnforceDelaysInStrikeDatabase)},
Jared Saulb0473bd2022-04-20 00:03:411033 {"autofill-upstream-allow-additional-email-domains",
1034 flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsName,
1035 flag_descriptions::kAutofillUpstreamAllowAdditionalEmailDomainsDescription,
1036 flags_ui::kOsIos,
1037 FEATURE_VALUE_TYPE(
1038 autofill::features::kAutofillUpstreamAllowAdditionalEmailDomains)},
1039 {"autofill-upstream-allow-all-email-domains",
1040 flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsName,
1041 flag_descriptions::kAutofillUpstreamAllowAllEmailDomainsDescription,
1042 flags_ui::kOsIos,
1043 FEATURE_VALUE_TYPE(
1044 autofill::features::kAutofillUpstreamAllowAllEmailDomains)},
Olivier Robinffe767c2022-04-21 13:13:231045 {"enable-tflite-language-detection",
1046 flag_descriptions::kTFLiteLanguageDetectionName,
1047 flag_descriptions::kTFLiteLanguageDetectionDescription, flags_ui::kOsIos,
1048 FEATURE_VALUE_TYPE(translate::kTFLiteLanguageDetectionEnabled)},
Raj Ta921ffc2022-08-25 19:00:201049 {"optimization-guide-debug-logs",
1050 flag_descriptions::kOptimizationGuideDebugLogsName,
1051 flag_descriptions::kOptimizationGuideDebugLogsDescription,
1052 flags_ui::kOsIos,
1053 SINGLE_VALUE_TYPE(optimization_guide::switches::kDebugLoggingEnabled)},
Olivier Robinffe767c2022-04-21 13:13:231054 {"optimization-guide-model-downloading",
1055 flag_descriptions::kOptimizationGuideModelDownloadingName,
1056 flag_descriptions::kOptimizationGuideModelDownloadingDescription,
1057 flags_ui::kOsIos,
1058 FEATURE_VALUE_TYPE(
1059 optimization_guide::features::kOptimizationGuideModelDownloading)},
1060 {"optimization-target-prediction",
1061 flag_descriptions::kOptimizationTargetPredictionName,
1062 flag_descriptions::kOptimizationTargetPredictionDescription,
1063 flags_ui::kOsIos,
1064 FEATURE_VALUE_TYPE(
1065 optimization_guide::features::kOptimizationTargetPrediction)},
Rushan Suleymanov727309602022-04-28 20:08:541066 {"sync-standalone-invalidations", flag_descriptions::kSyncInvalidationsName,
1067 flag_descriptions::kSyncInvalidationsDescription, flags_ui::kOsIos,
1068 FEATURE_VALUE_TYPE(::syncer::kUseSyncInvalidations)},
1069 {"sync-standalone-invalidations-wallet-and-offer",
1070 flag_descriptions::kSyncInvalidationsWalletAndOfferName,
1071 flag_descriptions::kSyncInvalidationsWalletAndOfferDescription,
1072 flags_ui::kOsIos,
1073 FEATURE_VALUE_TYPE(::syncer::kUseSyncInvalidationsForWalletAndOffer)},
Christian Xub8c06cd2022-04-29 20:55:011074 {"suggestions-scrolling-ipad",
1075 flag_descriptions::kEnableSuggestionsScrollingOnIPadName,
1076 flag_descriptions::kEnableSuggestionsScrollingOnIPadDescription,
1077 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableSuggestionsScrollingOnIPad)},
David Jean7a8fa702022-05-02 15:21:221078 {"experience-kit-calendar", flag_descriptions::kCalendarExperienceKitName,
1079 flag_descriptions::kCalendarExperienceKitDescription, flags_ui::kOsIos,
1080 FEATURE_VALUE_TYPE(kCalendarExperienceKit)},
Zhixiang Teoh82d17bb2022-06-16 21:00:391081 {"enable-expkit-calendar-text-classifier",
1082 flag_descriptions::kEnableExpKitCalendarTextClassifierName,
1083 flag_descriptions::kEnableExpKitCalendarTextClassifierDescription,
1084 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableExpKitCalendarTextClassifier)},
Elmehdi Rahmaoui9d4ce40c62022-08-05 15:31:181085 {"experience-kit-maps", flag_descriptions::kMapsExperienceKitName,
1086 flag_descriptions::kMapsExperienceKitDescription, flags_ui::kOsIos,
1087 FEATURE_VALUE_TYPE(kMapsExperienceKit)},
Mustafa Emre Acer4de8863a2022-05-03 22:17:011088 {"https-only-mode", flag_descriptions::kHttpsOnlyModeName,
1089 flag_descriptions::kHttpsOnlyModeDescription, flags_ui::kOsIos,
1090 FEATURE_VALUE_TYPE(security_interstitials::features::kHttpsOnlyMode)},
Mustafa Emre Acerb8bb01f2022-07-20 19:43:251091 {"omnibox-https-upgrades", flag_descriptions::kOmniboxHttpsUpgradesName,
1092 flag_descriptions::kOmniboxHttpsUpgradesDescription, flags_ui::kOsIos,
1093 FEATURE_VALUE_TYPE(omnibox::kDefaultTypedNavigationsToHttps)},
Benjamin Williams419c81e2022-05-04 18:33:221094 {"smart-sorting-new-overflow-menu",
1095 flag_descriptions::kSmartSortingNewOverflowMenuName,
1096 flag_descriptions::kSmartSortingNewOverflowMenuDescription,
1097 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSmartSortingNewOverflowMenu)},
Scott Yoder10493562022-06-28 17:37:441098 {"new-overflow-menu-share-chrome-action",
1099 flag_descriptions::kNewOverflowMenuShareChromeActionName,
1100 flag_descriptions::kNewOverflowMenuShareChromeActionDescription,
1101 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kNewOverflowMenuShareChromeAction)},
Alexander Tekled46a36982022-05-09 20:32:421102 {"autofill-enable-ranking-formula",
1103 flag_descriptions::kAutofillEnableRankingFormulaName,
1104 flag_descriptions::kAutofillEnableRankingFormulaDescription,
1105 flags_ui::kOsIos,
1106 FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableRankingFormula)},
Sergio Collazos58558712022-05-18 17:24:021107 {"enable-feed-ablation", flag_descriptions::kEnableFeedAblationName,
1108 flag_descriptions::kEnableFeedAblationDescription, flags_ui::kOsIos,
1109 FEATURE_VALUE_TYPE(kEnableFeedAblation)},
Chris Lu7f024ed2c2022-05-27 23:11:271110 {"content-suggestions-ui-module-refresh",
1111 flag_descriptions::kContentSuggestionsUIModuleRefreshName,
1112 flag_descriptions::kContentSuggestionsUIModuleRefreshDescription,
1113 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kContentSuggestionsUIModuleRefresh)},
Quentin Pubertd7546ae2022-05-30 14:28:571114 {"3p-intents-in-incognito", flag_descriptions::kIOS3PIntentsInIncognitoName,
1115 flag_descriptions::kIOS3PIntentsInIncognitoDescription, flags_ui::kOsIos,
1116 FEATURE_VALUE_TYPE(kIOS3PIntentsInIncognito)},
Olivier Robin058c1fad2022-05-31 18:24:061117 {"default-browser-intents-show-settings",
1118 flag_descriptions::kDefaultBrowserIntentsShowSettingsName,
1119 flag_descriptions::kDefaultBrowserIntentsShowSettingsDescription,
1120 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDefaultBrowserIntentsShowSettings)},
Ed Chin76b1b35e2022-06-08 23:01:171121 {"enable-discover-feed-ghost-cards",
1122 flag_descriptions::kEnableDiscoverFeedGhostCardsName,
1123 flag_descriptions::kEnableDiscoverFeedGhostCardsDescription,
1124 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDiscoverFeedGhostCardsEnabled)},
Gauthier Ambard30ad9ca2022-06-09 14:15:261125 {"bookmark-string-menu", flag_descriptions::kBookmarkStringName,
1126 flag_descriptions::kBookmarkStringDescription, flags_ui::kOsIos,
1127 FEATURE_WITH_PARAMS_VALUE_TYPE(kBookmarkString,
1128 kPopupMenuBookmarkStringVarations,
1129 "BookmarkString")},
Igor Ruvinova43a66dc2022-06-09 21:57:451130 {"dm-token-deletion", flag_descriptions::kDmTokenDeletionName,
1131 flag_descriptions::kDmTokenDeletionDescription, flags_ui::kOsIos,
Igor Ruvinov44fed9f2022-06-10 22:51:421132 FEATURE_WITH_PARAMS_VALUE_TYPE(policy::features::kDmTokenDeletion,
1133 kDmTokenDeletionVariation,
1134 "DmTokenDeletion")},
Tommy Martinoad42be52022-06-13 11:51:191135 {"ios-password-ui-split", flag_descriptions::kIOSPasswordUISplitName,
1136 flag_descriptions::kIOSPasswordUISplitDescription, flags_ui::kOsIos,
1137 FEATURE_VALUE_TYPE(password_manager::features::kIOSPasswordUISplit)},
Theodor-Stefan Cristea6d087b82022-07-26 15:25:291138 {"ios-password-manager-cross-origin-iframe-support",
1139 flag_descriptions::kIOSPasswordManagerCrossOriginIframeSupportName,
1140 flag_descriptions::kIOSPasswordManagerCrossOriginIframeSupportDescription,
1141 flags_ui::kOsIos,
1142 FEATURE_VALUE_TYPE(password_manager::features::
1143 kIOSPasswordManagerCrossOriginIframeSupport)},
Christian Xud105a1352022-06-17 19:54:141144 {"omnibox-adaptive-suggestions-count",
1145 flag_descriptions::kAdaptiveSuggestionsCountName,
1146 flag_descriptions::kAdaptiveSuggestionsCountDescription, flags_ui::kOsIos,
1147 FEATURE_VALUE_TYPE(omnibox::kAdaptiveSuggestionsCount)},
Chris Lu2fd473f2022-06-28 13:38:201148 {"trending-queries-module", flag_descriptions::kTrendingQueriesModuleName,
1149 flag_descriptions::kTrendingQueriesModuleDescription, flags_ui::kOsIos,
Chris Luc9a5cb12022-07-20 16:11:391150 FEATURE_WITH_PARAMS_VALUE_TYPE(kTrendingQueriesModule,
1151 kTrendingQueriesModuleVariations,
Chris Lu438e1c052022-08-17 02:57:001152 kTrendingQueriesFieldTrialName)},
Nakul Vaidyaddfdfbc2022-06-28 23:43:321153 {"autofill-parse-iban-fields",
Nakul Vaidya876210f2022-08-08 17:47:191154 flag_descriptions::kAutofillParseIBANFieldsName,
1155 flag_descriptions::kAutofillParseIBANFieldsDescription, flags_ui::kOsIos,
1156 FEATURE_VALUE_TYPE(autofill::features::kAutofillParseIBANFields)},
Ernesto Izquierdo Clua7f4e36e22022-07-01 09:38:361157 {"autofill-enable-new-card-unmask-prompt-view",
1158 flag_descriptions::kAutofillEnableNewCardUnmaskPromptViewName,
1159 flag_descriptions::kAutofillEnableNewCardUnmaskPromptViewDescription,
1160 flags_ui::kOsIos,
ginnnnnnny591a4972022-09-01 16:10:271161 FEATURE_VALUE_TYPE(
1162 autofill::features::kAutofillEnableNewCardUnmaskPromptView)},
Christian Xubdedabec2022-07-04 10:00:131163 {"omnibox-paste-button", flag_descriptions::kOmniboxPasteButtonName,
1164 flag_descriptions::kOmniboxPasteButtonDescription, flags_ui::kOsIos,
1165 FEATURE_WITH_PARAMS_VALUE_TYPE(kOmniboxPasteButton,
1166 kOmniboxPasteButtonVariations,
1167 "OmniboxPasteButton")},
Moe Ahmadi098519d82022-07-27 18:34:241168 {"omnibox-zero-suggest-prefetching",
1169 flag_descriptions::kOmniboxZeroSuggestPrefetchingName,
1170 flag_descriptions::kOmniboxZeroSuggestPrefetchingDescription,
1171 flags_ui::kOsIos, FEATURE_VALUE_TYPE(omnibox::kZeroSuggestPrefetching)},
Vincent Boissellead6cbe22022-07-04 19:32:391172 {"enable-user-policy", flag_descriptions::kEnableUserPolicyName,
1173 flag_descriptions::kEnableUserPolicyDescription, flags_ui::kOsIos,
1174 SINGLE_VALUE_TYPE(policy::kEnableUserPolicy)},
Marc Treibb9d8ed802022-07-05 15:15:491175 {"enable-sync-history-datatype",
1176 flag_descriptions::kSyncEnableHistoryDataTypeName,
1177 flag_descriptions::kSyncEnableHistoryDataTypeDescription, flags_ui::kOsIos,
1178 FEATURE_VALUE_TYPE(syncer::kSyncEnableHistoryDataType)},
Christian Xucf26d562022-07-06 09:28:361179 {"omnibox-max-url-matches", flag_descriptions::kOmniboxMaxURLMatchesName,
1180 flag_descriptions::kOmniboxMaxURLMatchesDescription, flags_ui::kOsIos,
1181 FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kOmniboxMaxURLMatches,
1182 kOmniboxMaxURLMatchesVariations,
1183 "OmniboxMaxURLMatches")},
Olivier Robin60d3a062022-07-06 17:34:061184 {"metrickit-non-crash-reports",
1185 flag_descriptions::kMetrickitNonCrashReportName,
1186 flag_descriptions::kMetrickitNonCrashReportDescription, flags_ui::kOsIos,
1187 FEATURE_VALUE_TYPE(kMetrickitNonCrashReport)},
Siyu An3194bda2022-07-13 19:30:371188 {"autofill-enable-remade-downstream-metrics",
1189 flag_descriptions::kAutofillEnableRemadeDownstreamMetricsName,
1190 flag_descriptions::kAutofillEnableRemadeDownstreamMetricsDescription,
1191 flags_ui::kOsIos,
1192 FEATURE_VALUE_TYPE(
1193 autofill::features::kAutofillEnableRemadeDownstreamMetrics)},
Nakul Vaidya13ca2042022-07-27 01:59:551194 {"autofill-parse-vcn-card-on-file-standalone-cvc-fields",
1195 flag_descriptions::kAutofillParseVcnCardOnFileStandaloneCvcFieldsName,
1196 flag_descriptions::
1197 kAutofillParseVcnCardOnFileStandaloneCvcFieldsDescription,
1198 flags_ui::kOsIos,
1199 FEATURE_VALUE_TYPE(
1200 autofill::features::kAutofillParseVcnCardOnFileStandaloneCvcFields)},
Ed Chin91e44992022-07-27 13:42:341201#if BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
1202 {"feed-background-refresh-ios",
1203 flag_descriptions::kFeedBackgroundRefreshName,
1204 flag_descriptions::kFeedBackgroundRefreshDescription, flags_ui::kOsIos,
1205 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFeedBackgroundRefresh,
1206 kFeedBackgroundRefreshVariations,
1207 "FeedBackgroundRefresh")},
Christian Xu164a2e512022-08-01 20:38:191208 {"omnibox-keyboard-paste-button",
1209 flag_descriptions::kOmniboxKeyboardPasteButtonName,
1210 flag_descriptions::kOmniboxKeyboardPasteButtonDescription,
1211 flags_ui::kOsIos, FEATURE_VALUE_TYPE(kOmniboxKeyboardPasteButton)},
Ed Chin91e44992022-07-27 13:42:341212#endif // BUILDFLAG(IOS_BACKGROUND_MODE_ENABLED)
Arthur Milchiorcf4877e2022-07-29 14:23:411213 {"enable-cbd-sign-out", flag_descriptions::kEnableCBDSignOutName,
1214 flag_descriptions::kEnableCBDSignOutDescription, flags_ui::kOsIos,
Arthur Milchiord36e2502022-08-11 16:10:111215 FEATURE_VALUE_TYPE(switches::kEnableCbdSignOut)},
Aliona DANGLAa5257ccc2022-08-29 14:01:491216 {"enable-open-in-download", flag_descriptions::kEnableOpenInDownloadName,
1217 flag_descriptions::kEnableOpenInDownloadDescription, flags_ui::kOsIos,
1218 FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableOpenInDownload,
1219 kOpenInDownloadVariations,
1220 "EnableOpenInDownload")},
ginnnnnnny591a4972022-09-01 16:10:271221 {"ios-autofill-branding", flag_descriptions::kAutofillBrandingIOSName,
1222 flag_descriptions::kAutofillBrandingIOSDescription, flags_ui::kOsIos,
1223 FEATURE_WITH_PARAMS_VALUE_TYPE(autofill::features::kAutofillBrandingIOS,
1224 kAutofillBrandingIOSVariations,
Hira Mahmoodb0e5f412022-09-01 19:41:051225 "AutofillBrandingIOS")},
1226 {"app-store-rating", flag_descriptions::kAppStoreRatingName,
1227 flag_descriptions::kAppStoreRatingDescription, flags_ui::kOsIos,
1228 FEATURE_VALUE_TYPE(kAppStoreRating)},
1229};
sdefresne14900ee2015-11-27 14:43:211230
Rohit Raobed794c2020-04-27 15:27:451231bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
1232 return false;
1233}
1234
1235flags_ui::FlagsState& GetGlobalFlagsState() {
1236 static base::NoDestructor<flags_ui::FlagsState> flags_state(kFeatureEntries,
1237 nullptr);
1238 return *flags_state;
1239}
David Jean5ca263c2021-08-18 09:19:301240// Creates the experimental test policies map, used by AsyncPolicyLoader and
1241// PolicyLoaderIOS to locally enable policies.
Vincent Boisselleed0e6f1a2021-11-09 06:47:341242NSMutableDictionary* CreateExperimentalTestingPolicies() {
sdefresne14900ee2015-11-27 14:43:211243 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1244
Guillaume Jenkins25e9bd72020-08-27 17:39:061245 // Shared variables for all enterprise experimental flags.
Guillaume Jenkins57606d72020-08-13 17:32:551246 NSMutableDictionary* testing_policies = [[NSMutableDictionary alloc] init];
Guillaume Jenkins25e9bd72020-08-27 17:39:061247 NSMutableArray* allowed_experimental_policies = [[NSMutableArray alloc] init];
Guillaume Jenkins57606d72020-08-13 17:32:551248
Guillaume Jenkins25e9bd72020-08-27 17:39:061249 // Set some sample policy values for testing if EnableSamplePolicies is set to
1250 // true.
Guillaume Jenkinseeb7007c2020-06-25 22:55:401251 if ([defaults boolForKey:@"EnableSamplePolicies"]) {
Guillaume Jenkins57606d72020-08-13 17:32:551252 [testing_policies addEntriesFromDictionary:@{
Tina Wang59d0b7e2020-08-11 04:41:011253 base::SysUTF8ToNSString(policy::key::kAutofillAddressEnabled) : @NO,
1254
Guillaume Jenkinseeb7007c2020-06-25 22:55:401255 base::SysUTF8ToNSString(policy::key::kAutofillCreditCardEnabled) : @NO,
1256
1257 // 2 = Disable all variations
1258 base::SysUTF8ToNSString(policy::key::kChromeVariations) : @2,
1259
1260 // 2 = Do not allow any site to show popups
1261 base::SysUTF8ToNSString(policy::key::kDefaultPopupsSetting) : @2,
1262
Tina Wang5abee802020-07-29 23:09:521263 // Set default search engine.
1264 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderEnabled) :
1265 @YES,
1266 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderSearchURL) :
1267 @"http://www.google.com/search?q={searchTerms}",
1268 base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderName) :
Tina Wang7cd0a062020-09-15 21:31:021269 @"TestEngine",
Tina Wang5abee802020-07-29 23:09:521270
Tina Wang89068c82020-10-29 15:51:501271 base::SysUTF8ToNSString(policy::key::kEditBookmarksEnabled) : @NO,
1272
Gauthier Ambard21b23702021-04-16 16:11:271273 base::SysUTF8ToNSString(policy::key::kNTPContentSuggestionsEnabled) : @NO,
1274
Guillaume Jenkinseeb7007c2020-06-25 22:55:401275 base::SysUTF8ToNSString(policy::key::kPasswordManagerEnabled) : @NO,
Tina Wang59d0b7e2020-08-11 04:41:011276
1277 base::SysUTF8ToNSString(policy::key::kTranslateEnabled) : @NO,
Tina Wang54dddfc22020-08-20 22:34:531278
1279 // 2 = Enhanced safe browsing protection
1280 base::SysUTF8ToNSString(policy::key::kSafeBrowsingProtectionLevel) : @2,
1281
1282 base::SysUTF8ToNSString(policy::key::kSearchSuggestEnabled) : @YES,
Guillaume Jenkins57606d72020-08-13 17:32:551283 }];
1284 }
1285
Ewann227a3c02021-04-19 12:04:541286 if ([defaults boolForKey:@"EnableSyncDisabledPolicy"]) {
Guillaume Jenkinsfe46d3a2021-04-26 19:51:041287 NSString* sync_policy_key =
1288 base::SysUTF8ToNSString(policy::key::kSyncDisabled);
David Jean5ca263c2021-08-18 09:19:301289 [testing_policies addEntriesFromDictionary:@{sync_policy_key : @YES}];
Ewann227a3c02021-04-19 12:04:541290 }
Ewann227a3c02021-04-19 12:04:541291
Ewann570a6302021-08-17 07:22:421292 // SyncTypesListDisabled policy.
1293 NSString* Sync_types_list_disabled_key =
1294 base::SysUTF8ToNSString(policy::key::kSyncTypesListDisabled);
1295 NSMutableArray* Sync_types_list_disabled_values =
1296 [[NSMutableArray alloc] init];
1297 if ([defaults boolForKey:@"SyncTypesListBookmarks"]) {
1298 [Sync_types_list_disabled_values addObject:@"bookmarks"];
1299 }
1300 if ([defaults boolForKey:@"SyncTypesListReadingList"]) {
1301 [Sync_types_list_disabled_values addObject:@"readingList"];
1302 }
1303 if ([defaults boolForKey:@"SyncTypesListPreferences"]) {
1304 [Sync_types_list_disabled_values addObject:@"preferences"];
1305 }
1306 if ([defaults boolForKey:@"SyncTypesListPasswords"]) {
1307 [Sync_types_list_disabled_values addObject:@"passwords"];
1308 }
1309 if ([defaults boolForKey:@"SyncTypesListAutofill"]) {
1310 [Sync_types_list_disabled_values addObject:@"autofill"];
1311 }
1312 if ([defaults boolForKey:@"SyncTypesListTypedUrls"]) {
1313 [Sync_types_list_disabled_values addObject:@"typedUrls"];
1314 }
1315 if ([defaults boolForKey:@"SyncTypesListTabs"]) {
1316 [Sync_types_list_disabled_values addObject:@"tabs"];
1317 }
1318 if ([Sync_types_list_disabled_values count]) {
1319 [testing_policies addEntriesFromDictionary:@{
1320 Sync_types_list_disabled_key : Sync_types_list_disabled_values
1321 }];
Ewann570a6302021-08-17 07:22:421322 }
1323
Gauthier Ambard073eaa92021-11-22 15:24:131324 // If an incognito mode availability is set, set the value.
Tina Wangc6bcf572021-01-27 18:15:521325 NSString* incognito_policy_key =
1326 base::SysUTF8ToNSString(policy::key::kIncognitoModeAvailability);
1327 NSInteger incognito_mode_availability =
1328 [defaults integerForKey:incognito_policy_key];
1329 if (incognito_mode_availability) {
Tina Wangc6bcf572021-01-27 18:15:521330 [testing_policies addEntriesFromDictionary:@{
1331 incognito_policy_key : @(incognito_mode_availability),
1332 }];
1333 }
1334
Ewann40a8f8a2021-07-29 10:01:201335 NSString* restriction_pattern =
1336 [defaults stringForKey:@"RestrictAccountsToPatterns"];
1337 if ([restriction_pattern length] > 0) {
Ewannb3bee382021-08-16 09:12:291338 NSString* restrict_key =
1339 base::SysUTF8ToNSString(policy::key::kRestrictAccountsToPatterns);
Ewann40a8f8a2021-07-29 10:01:201340 [testing_policies addEntriesFromDictionary:@{
Ewannb3bee382021-08-16 09:12:291341 restrict_key : @[ restriction_pattern ]
Ewann40a8f8a2021-07-29 10:01:201342 }];
1343 }
1344
Vincent Boisselle19200bc2021-09-01 17:58:251345 // If the sign-in policy is set (not "None"), add the policy key to the list
1346 // of enabled experimental policies, and set the value.
1347 NSString* const kSigninPolicyKey = @"BrowserSignin";
1348 NSInteger signin_policy_mode = [defaults integerForKey:kSigninPolicyKey];
1349 if (signin_policy_mode) {
1350 // Remove the mode offset that was used to represent the unset policy.
1351 --signin_policy_mode;
1352 DCHECK(signin_policy_mode >= 0);
1353
Vincent Boisselle19200bc2021-09-01 17:58:251354 [testing_policies addEntriesFromDictionary:@{
1355 kSigninPolicyKey : @(signin_policy_mode),
1356 }];
1357 }
1358
Veronique Nguyen9b1044f2022-01-11 14:41:131359 // If the New Tab Page URL is set (not empty) add the value to the list of
1360 // test policies.
1361 NSString* ntp_location = [defaults stringForKey:@"NTPLocation"];
1362 if ([ntp_location length] > 0) {
1363 NSString* ntp_location_key =
1364 base::SysUTF8ToNSString(policy::key::kNewTabPageLocation);
1365 [testing_policies
1366 addEntriesFromDictionary:@{ntp_location_key : ntp_location}];
Veronique Nguyen302d8702022-01-12 21:18:571367 [allowed_experimental_policies addObject:ntp_location_key];
Veronique Nguyen9b1044f2022-01-11 14:41:131368 }
1369
Ali Juma9ec36d22022-03-28 14:53:121370 if ([defaults boolForKey:@"DisallowChromeDataInBackups"]) {
1371 NSString* allow_backups_key =
1372 base::SysUTF8ToNSString(policy::key::kAllowChromeDataInBackups);
1373 [testing_policies addEntriesFromDictionary:@{allow_backups_key : @NO}];
1374 [allowed_experimental_policies addObject:allow_backups_key];
1375 }
1376
Guillaume Jenkins25e9bd72020-08-27 17:39:061377 // If any experimental policy was allowed, set the EnableExperimentalPolicies
1378 // policy.
1379 if ([allowed_experimental_policies count] > 0) {
1380 [testing_policies setValue:allowed_experimental_policies
1381 forKey:base::SysUTF8ToNSString(
1382 policy::key::kEnableExperimentalPolicies)];
1383 }
1384
jlebel2eb40222022-05-06 11:15:421385 NSString* metrics_reporting_key = @"MetricsReportingEnabled";
1386 switch ([defaults integerForKey:metrics_reporting_key]) {
1387 case 1:
1388 // Metrics reporting forced.
1389 [testing_policies setValue:@(YES) forKey:metrics_reporting_key];
1390 break;
1391 case 2:
1392 // Metrics reporting disabled.
1393 [testing_policies setValue:@(NO) forKey:metrics_reporting_key];
1394 break;
1395 default:
1396 // Metrics reporting not managed.
1397 break;
1398 }
1399
David Jean6f85d44f2021-08-19 08:08:451400 // Warning: Add new flags to TestingPoliciesHash() below.
1401
David Jean5ca263c2021-08-18 09:19:301402 return testing_policies;
1403}
David Jean6f85d44f2021-08-19 08:08:451404
1405// Generates a unique NSString based on currently monitored policies from
1406// NSUserDefaults standardUserDefaults.
1407NSString* TestingPoliciesHash() {
1408 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1409 return [NSString
jlebel2eb40222022-05-06 11:15:421410 stringWithFormat:@"%d|%d|%d|%d|%@|%d|%d|%d|%d|%d|%d|%d|%d|%@|%d",
Ali Juma9ec36d22022-03-28 14:53:121411 [defaults boolForKey:@"DisallowChromeDataInBackups"],
David Jean6f85d44f2021-08-19 08:08:451412 [defaults boolForKey:@"EnableSyncDisabledPolicy"],
1413 [defaults boolForKey:@"EnableSamplePolicies"],
jlebel2eb40222022-05-06 11:15:421414 static_cast<int>([defaults
1415 integerForKey:@"IncognitoModeAvailability"]),
David Jean6f85d44f2021-08-19 08:08:451416 [defaults stringForKey:@"RestrictAccountsToPatterns"],
1417 [defaults boolForKey:@"SyncTypesListBookmarks"],
1418 [defaults boolForKey:@"SyncTypesListReadingList"],
1419 [defaults boolForKey:@"SyncTypesListPreferences"],
1420 [defaults boolForKey:@"SyncTypesListPasswords"],
1421 [defaults boolForKey:@"SyncTypesListAutofill"],
1422 [defaults boolForKey:@"SyncTypesListTypedUrls"],
jlebel2eb40222022-05-06 11:15:421423 [defaults boolForKey:@"SyncTypesListTabs"],
1424 static_cast<int>(
1425 [defaults integerForKey:@"BrowserSignin"]),
1426 [defaults stringForKey:@"NTPLocation"],
1427 static_cast<int>([defaults
1428 integerForKey:@"MetricsReportingEnabled"])];
David Jean6f85d44f2021-08-19 08:08:451429}
David Jean5ca263c2021-08-18 09:19:301430} // namespace
1431
Gauthier Ambard02dbf022022-08-23 08:28:471432// Add all switches from experimental flags to `command_line`.
David Jean5ca263c2021-08-18 09:19:301433void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) {
1434 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1435
1436 // Set the UA flag if UseMobileSafariUA is enabled.
1437 if ([defaults boolForKey:@"UseMobileSafariUA"]) {
1438 // Safari uses "Vesion/", followed by the OS version excluding bugfix, where
1439 // Chrome puts its product token.
1440 int32_t major = 0;
1441 int32_t minor = 0;
1442 int32_t bugfix = 0;
1443 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix);
1444 std::string product = base::StringPrintf("Version/%d.%d", major, minor);
1445
1446 command_line->AppendSwitchASCII(switches::kUserAgent,
1447 web::BuildMobileUserAgent(product));
1448 }
1449
1450 // Shared variables for all enterprise experimental flags.
Vincent Boisselleed0e6f1a2021-11-09 06:47:341451 NSMutableDictionary* testing_policies = CreateExperimentalTestingPolicies();
David Jean5ca263c2021-08-18 09:19:301452
1453 // If a CBCM enrollment token is provided, force Chrome Browser Cloud
1454 // Management to enabled and add the token to the list of policies.
1455 NSString* token_key =
1456 base::SysUTF8ToNSString(policy::key::kCloudManagementEnrollmentToken);
1457 NSString* token = [defaults stringForKey:token_key];
1458
1459 if ([token length] > 0) {
1460 command_line->AppendSwitch(switches::kEnableChromeBrowserCloudManagement);
1461 [testing_policies setValue:token forKey:token_key];
1462 }
1463
Vincent Boisselled042d552022-04-09 01:22:591464 if ([defaults boolForKey:@"EnableUserPolicy"]) {
1465 policy::EnableUserPolicy();
1466 }
1467
Guillaume Jenkins57606d72020-08-13 17:32:551468 // If some policies were set, commit them to the app's registration defaults.
1469 if ([testing_policies count] > 0) {
Guillaume Jenkinseeb7007c2020-06-25 22:55:401470 NSDictionary* registration_defaults =
1471 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
1472 [defaults registerDefaults:registration_defaults];
1473 }
1474
sdefresne14900ee2015-11-27 14:43:211475 // Freeform commandline flags. These are added last, so that any flags added
1476 // earlier in this function take precedence.
1477 if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) {
1478 base::CommandLine::StringVector flags;
1479 // Append an empty "program" argument.
1480 flags.push_back("");
1481
1482 // The number of flags corresponds to the number of text fields in
1483 // Experimental.plist.
1484 const int kNumFreeformFlags = 5;
1485 for (int i = 1; i <= kNumFreeformFlags; ++i) {
1486 NSString* key =
1487 [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i];
1488 NSString* flag = [defaults stringForKey:key];
1489 if ([flag length]) {
Robbie Gibsonc91ce622019-05-20 14:44:331490 // iOS keyboard replaces -- with —, so undo that.
1491 flag = [flag stringByReplacingOccurrencesOfString:@"—"
1492 withString:@"--"
1493 options:0
1494 range:NSMakeRange(0, 1)];
1495 // To make things easier, allow flags with no dashes by prepending them
1496 // here. This also allows for flags that just have one dash if they
1497 // exist.
1498 if (![flag hasPrefix:@"-"]) {
1499 flag = [@"--" stringByAppendingString:flag];
1500 }
sdefresne14900ee2015-11-27 14:43:211501 flags.push_back(base::SysNSStringToUTF8(flag));
1502 }
1503 }
1504
1505 base::CommandLine temp_command_line(flags);
1506 command_line->AppendArguments(temp_command_line, false);
1507 }
msardafc76f662017-02-24 12:46:281508
justincohendacc85d2017-06-28 23:34:101509 // Populate command line flag for 3rd party keyboard omnibox workaround.
1510 NSString* enableThirdPartyKeyboardWorkaround =
1511 [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"];
1512 if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) {
1513 command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround);
1514 } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) {
1515 command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround);
1516 }
1517
Sylvain Defresned3cd8d92022-01-18 13:35:081518 ios::provider::AppendSwitchesFromExperimentalSettings(defaults, command_line);
sdefresne14900ee2015-11-27 14:43:211519}
1520
David Jean5ca263c2021-08-18 09:19:301521void MonitorExperimentalSettingsChanges() {
David Jean5ca263c2021-08-18 09:19:301522 // Startup values for settings to be observed.
David Jean6f85d44f2021-08-19 08:08:451523 __block NSString* hash = TestingPoliciesHash();
David Jeane83ed652021-08-25 14:52:481524 static std::atomic_bool pending_check(false);
David Jean5ca263c2021-08-18 09:19:301525
1526 auto monitor = ^(NSNotification* notification) {
David Jeane83ed652021-08-25 14:52:481527 bool has_pending_check = pending_check.exchange(true);
1528 if (has_pending_check)
1529 return;
1530
David Jeanbc0fae32021-08-25 10:31:391531 // Can be called from any thread from where the notification was sent,
1532 // but since it may change standardUserDefaults, and that has to be on main
1533 // thread, dispatch to main thread.
1534 dispatch_async(dispatch_get_main_queue(), ^{
1535 // Check if observed settings have changed. Since source and destination
1536 // are both user defaults, this is required to avoid cycling back here.
1537 NSString* newHash = TestingPoliciesHash();
1538 if (![newHash isEqualToString:hash]) {
1539 hash = newHash;
David Jean5ca263c2021-08-18 09:19:301540
David Jeanbc0fae32021-08-25 10:31:391541 // Publish update.
1542 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1543 NSMutableDictionary* testing_policies =
Vincent Boisselleed0e6f1a2021-11-09 06:47:341544 CreateExperimentalTestingPolicies();
David Jeanbc0fae32021-08-25 10:31:391545 NSDictionary* registration_defaults =
1546 @{kPolicyLoaderIOSConfigurationKey : testing_policies};
1547 [defaults registerDefaults:registration_defaults];
1548 }
David Jeane83ed652021-08-25 14:52:481549
1550 pending_check.store(false);
David Jeanbc0fae32021-08-25 10:31:391551 });
David Jean5ca263c2021-08-18 09:19:301552 };
1553
1554 NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
1555 [center addObserverForName:NSUserDefaultsDidChangeNotification
1556 object:nil
David Jeanbc0fae32021-08-25 10:31:391557 queue:nil
David Jean5ca263c2021-08-18 09:19:301558 usingBlock:monitor];
1559}
1560
sdefresne14900ee2015-11-27 14:43:211561void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage,
1562 base::CommandLine* command_line) {
Sylvain Defresne8327a2f2019-01-17 14:19:181563 GetGlobalFlagsState().ConvertFlagsToSwitches(
sdefresnec9763902015-12-02 10:30:111564 flags_storage, command_line, flags_ui::kAddSentinels,
Gregory Chatzinofff6523722017-11-21 01:33:531565 switches::kEnableFeatures, switches::kDisableFeatures);
sdefresne14900ee2015-11-27 14:43:211566}
1567
jkrcalbf073372016-07-29 07:21:311568std::vector<std::string> RegisterAllFeatureVariationParameters(
1569 flags_ui::FlagsStorage* flags_storage,
1570 base::FeatureList* feature_list) {
Justin Cohen2e2adb52019-10-25 17:00:021571 // Occasionally DCHECK crashes on canary can be very distuptive. An
1572 // experimental flag was added to aid in temporarily disabling this for
1573 // canary testers.
Peter Boström3f798572022-07-26 23:44:361574#if BUILDFLAG(DCHECK_IS_CONFIGURABLE)
Justin Cohen2e2adb52019-10-25 17:00:021575 if (experimental_flags::AreDCHECKCrashesDisabled()) {
1576 std::vector<base::FeatureList::FeatureOverrideInfo> overrides;
1577 overrides.push_back(
1578 {std::cref(base::kDCheckIsFatalFeature),
1579 base::FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE});
1580 feature_list->RegisterExtraFeatureOverrides(std::move(overrides));
1581 }
Peter Boström3f798572022-07-26 23:44:361582#endif // BUILDFLAG(DCHECK_IS_CONFIGURABLE)
Justin Cohen2e2adb52019-10-25 17:00:021583
Sylvain Defresne8327a2f2019-01-17 14:19:181584 return GetGlobalFlagsState().RegisterAllFeatureVariationParameters(
1585 flags_storage, feature_list);
jkrcalbf073372016-07-29 07:21:311586}
1587
sdefresne14900ee2015-11-27 14:43:211588void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage,
1589 flags_ui::FlagAccess access,
Matt Menke4d777572022-06-15 15:55:501590 base::Value::List& supported_entries,
1591 base::Value::List& unsupported_entries) {
Sylvain Defresne8327a2f2019-01-17 14:19:181592 GetGlobalFlagsState().GetFlagFeatureEntries(
sdefresne14900ee2015-11-27 14:43:211593 flags_storage, access, supported_entries, unsupported_entries,
Renjie Tang208c8192020-11-03 00:46:511594 base::BindRepeating(&SkipConditionalFeatureEntry));
sdefresne14900ee2015-11-27 14:43:211595}
1596
1597void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage,
1598 const std::string& internal_name,
1599 bool enable) {
Sylvain Defresne8327a2f2019-01-17 14:19:181600 GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name,
1601 enable);
sdefresne14900ee2015-11-27 14:43:211602}
1603
1604void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) {
Sylvain Defresne8327a2f2019-01-17 14:19:181605 GetGlobalFlagsState().ResetAllFlags(flags_storage);
sdefresne14900ee2015-11-27 14:43:211606}
1607
1608namespace testing {
1609
Elly Fong-Jones323ab1092021-08-23 22:36:311610base::span<const flags_ui::FeatureEntry> GetFeatureEntries() {
1611 return base::span<const flags_ui::FeatureEntry>(kFeatureEntries,
Daniel Cheng1f047a82022-02-26 10:04:531612 std::size(kFeatureEntries));
sdefresne14900ee2015-11-27 14:43:211613}
1614
1615} // namespace testing