sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1 | // 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 | |
Nazerke | 9c25905 | 2019-06-26 15:30:10 | [diff] [blame] | 8 | #include "ios/chrome/browser/flags/about_flags.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 9 | |
Nazerke | 9c25905 | 2019-06-26 15:30:10 | [diff] [blame] | 10 | #import <UIKit/UIKit.h> |
avi | 57194367 | 2015-12-22 02:12:49 | [diff] [blame] | 11 | #include <stddef.h> |
| 12 | #include <stdint.h> |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 13 | |
Gregory Chatzinoff | f652372 | 2017-11-21 01:33:53 | [diff] [blame] | 14 | #include "base/base_switches.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 15 | #include "base/bind.h" |
danakj | db9ae794 | 2020-11-11 16:01:35 | [diff] [blame] | 16 | #include "base/callback_helpers.h" |
Hans Wennborg | 3a2fb61f | 2020-05-11 15:51:16 | [diff] [blame] | 17 | #include "base/check_op.h" |
Lei Zhang | d4a2f8e | 2021-07-08 03:43:28 | [diff] [blame] | 18 | #include "base/cxx17_backports.h" |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 19 | #import "base/mac/foundation_util.h" |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 20 | #include "base/no_destructor.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 21 | #include "base/strings/stringprintf.h" |
| 22 | #include "base/strings/sys_string_conversions.h" |
Sebastien Marchand | 75a7cdf | 2018-11-13 23:47:03 | [diff] [blame] | 23 | #include "base/system/sys_info.h" |
Mohamad Ahmadi | c4df81f | 2017-12-20 04:41:59 | [diff] [blame] | 24 | #include "components/autofill/core/common/autofill_features.h" |
Jared Saul | d998539f | 2019-03-19 15:11:17 | [diff] [blame] | 25 | #include "components/autofill/core/common/autofill_payments_features.h" |
Moe Ahmadi | d6d5d17 | 2018-06-20 17:20:23 | [diff] [blame] | 26 | #include "components/autofill/core/common/autofill_switches.h" |
Olivier Robin | 3d6041162 | 2018-02-23 10:03:22 | [diff] [blame] | 27 | #include "components/autofill/ios/browser/autofill_switches.h" |
Jesse McKenna | 85c1a59f | 2021-05-05 19:08:30 | [diff] [blame] | 28 | #include "components/breadcrumbs/core/features.h" |
Robbie Gibson | 5e343663 | 2020-04-27 15:48:04 | [diff] [blame] | 29 | #include "components/content_settings/core/common/features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 30 | #include "components/dom_distiller/core/dom_distiller_switches.h" |
Guillaume Jenkins | 4e6ac1e | 2020-11-11 16:57:40 | [diff] [blame] | 31 | #include "components/enterprise/browser/enterprise_switches.h" |
Tommy Nyquist | c1d6dea1 | 2017-07-26 20:37:23 | [diff] [blame] | 32 | #include "components/feature_engagement/public/feature_constants.h" |
| 33 | #include "components/feature_engagement/public/feature_list.h" |
edchin | d847c096 | 2021-03-03 18:17:05 | [diff] [blame] | 34 | #include "components/feed/feed_feature_list.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 35 | #include "components/flags_ui/feature_entry.h" |
| 36 | #include "components/flags_ui/feature_entry_macros.h" |
| 37 | #include "components/flags_ui/flags_storage.h" |
| 38 | #include "components/flags_ui/flags_ui_switches.h" |
Tanja Gornak | b0985dd | 2018-10-11 17:24:40 | [diff] [blame] | 39 | #include "components/invalidation/impl/invalidation_switches.h" |
noyau | 4cfb133 | 2016-10-25 17:05:42 | [diff] [blame] | 40 | #include "components/ntp_tiles/switches.h" |
Justin Donnelly | 33d712e | 2017-08-23 21:32:51 | [diff] [blame] | 41 | #include "components/omnibox/browser/omnibox_field_trial.h" |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 42 | #include "components/omnibox/common/omnibox_features.h" |
Raj T | 3898f03 | 2021-08-19 23:51:27 | [diff] [blame] | 43 | #include "components/optimization_guide/core/optimization_guide_features.h" |
Ioana Pandele | d14ce9e | 2017-11-28 14:41:46 | [diff] [blame] | 44 | #include "components/password_manager/core/common/password_manager_features.h" |
mathp | 9b4c11d | 2017-07-06 20:24:13 | [diff] [blame] | 45 | #include "components/payments/core/features.h" |
Guillaume Jenkins | eeb7007c | 2020-06-25 22:55:40 | [diff] [blame] | 46 | #import "components/policy/core/common/policy_loader_ios_constants.h" |
| 47 | #include "components/policy/policy_constants.h" |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 48 | #include "components/security_state/core/features.h" |
Victor Hugo Vianna Silva | 0399402f | 2021-09-07 21:41:25 | [diff] [blame] | 49 | #import "components/send_tab_to_self/features.h" |
Sébastien Séguin-Gagnon | dcb854b | 2019-04-10 16:36:44 | [diff] [blame] | 50 | #include "components/send_tab_to_self/features.h" |
Tommy Martino | 0caf336 | 2021-01-13 20:29:58 | [diff] [blame] | 51 | #include "components/shared_highlighting/core/common/shared_highlighting_features.h" |
Valeriya Sinevich | a79dc61 | 2018-09-25 14:49:09 | [diff] [blame] | 52 | #include "components/signin/core/browser/account_reconcilor.h" |
Jérôme Lebel | c374fdd | 2019-09-27 10:36:48 | [diff] [blame] | 53 | #include "components/signin/ios/browser/features.h" |
Colin Blundell | 3517170e | 2019-07-11 08:16:34 | [diff] [blame] | 54 | #include "components/signin/public/base/signin_switches.h" |
sdefresne | 3657978 | 2016-02-05 11:08:25 | [diff] [blame] | 55 | #include "components/strings/grit/components_strings.h" |
Ewann | 570a630 | 2021-08-17 07:22:42 | [diff] [blame] | 56 | #include "components/sync/base/pref_names.h" |
Rushan Suleymanov | 988ad37 | 2020-07-26 19:10:08 | [diff] [blame] | 57 | #include "components/sync/base/sync_base_switches.h" |
Moe Ahmadi | d6d5d17 | 2018-06-20 17:20:23 | [diff] [blame] | 58 | #include "components/sync/driver/sync_driver_switches.h" |
Moe Ahmadi | e4cce1f | 2018-12-18 23:48:01 | [diff] [blame] | 59 | #include "components/translate/core/browser/translate_prefs.h" |
Sylvain Defresne | ae6987e | 2018-03-01 13:21:40 | [diff] [blame] | 60 | #include "ios/chrome/browser/browsing_data/browsing_data_features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 61 | #include "ios/chrome/browser/chrome_switches.h" |
Eugene But | 2823dc7e | 2020-07-21 18:10:37 | [diff] [blame] | 62 | #include "ios/chrome/browser/crash_report/features.h" |
Nazerke | 21bdc45a | 2019-07-11 09:02:05 | [diff] [blame] | 63 | #include "ios/chrome/browser/flags/ios_chrome_flag_descriptions.h" |
edchin | 6869684 | 2020-04-09 17:19:31 | [diff] [blame] | 64 | #include "ios/chrome/browser/policy/policy_features.h" |
Vincent Boisselle | 19200bc | 2021-09-01 17:58:25 | [diff] [blame] | 65 | #include "ios/chrome/browser/policy/policy_util.h" |
Sylvain Defresne | 9c10708 | 2020-10-27 16:39:13 | [diff] [blame] | 66 | #include "ios/chrome/browser/screen_time/screen_time_buildflags.h" |
Olivier Robin | 3a957df | 2021-12-21 18:04:34 | [diff] [blame] | 67 | #import "ios/chrome/browser/sessions/session_features.h" |
Gauthier Ambard | 33e0330 | 2019-02-21 13:28:58 | [diff] [blame] | 68 | #include "ios/chrome/browser/system_flags.h" |
adamta | 22a4d50 | 2020-05-21 03:12:21 | [diff] [blame] | 69 | #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h" |
Javier Ernesto Flores Robles | 209b282 | 2021-03-25 19:16:50 | [diff] [blame] | 70 | #import "ios/chrome/browser/ui/default_promo/default_browser_utils.h" |
Ewann | 1a9d33d | 2021-06-14 11:12:24 | [diff] [blame] | 71 | #import "ios/chrome/browser/ui/download/features.h" |
Aliona DANGLA | ebfd7d02 | 2021-10-08 14:15:45 | [diff] [blame] | 72 | #include "ios/chrome/browser/ui/first_run/fre_field_trial.h" |
Kurt Horimoto | 4da682b02 | 2018-04-12 07:43:35 | [diff] [blame] | 73 | #import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h" |
adamta | 27356847 | 2020-12-04 23:53:57 | [diff] [blame] | 74 | #import "ios/chrome/browser/ui/ntp/new_tab_page_feature.h" |
Tina Wang | 17514e2f | 2021-09-24 23:57:18 | [diff] [blame] | 75 | #import "ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_features.h" |
Robbie Gibson | 686c5673 | 2021-10-04 17:11:45 | [diff] [blame] | 76 | #import "ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.h" |
Chris Lu | e45c94c6 | 2021-05-21 01:32:59 | [diff] [blame] | 77 | #import "ios/chrome/browser/ui/reading_list/reading_list_features.h" |
gogerald | 0ff29e5 | 2021-02-03 18:56:19 | [diff] [blame] | 78 | #import "ios/chrome/browser/ui/start_surface/start_surface_features.h" |
Nazerke | 0bf10c4 | 2020-11-12 11:17:32 | [diff] [blame] | 79 | #import "ios/chrome/browser/ui/tab_switcher/tab_grid/features.h" |
Kurt Horimoto | 79d590b | 2018-09-12 19:09:28 | [diff] [blame] | 80 | #import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h" |
Justin Cohen | 2d81c58 | 2018-01-22 14:46:44 | [diff] [blame] | 81 | #include "ios/chrome/browser/ui/ui_feature_flags.h" |
Yi Su | 392b303 | 2018-06-05 07:26:47 | [diff] [blame] | 82 | #include "ios/chrome/browser/web/features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 83 | #include "ios/chrome/grit/ios_strings.h" |
Sylvain Defresne | 559ce5f | 2022-01-13 17:14:58 | [diff] [blame] | 84 | #include "ios/public/provider/chrome/browser/app_utils/app_utils_api.h" |
Eugene But | 61818bc | 2019-04-15 21:04:07 | [diff] [blame] | 85 | #include "ios/web/common/features.h" |
Eugene But | e79f274 | 2019-07-26 17:07:22 | [diff] [blame] | 86 | #include "ios/web/common/user_agent.h" |
Eugene But | b141623 | 2019-07-22 17:31:58 | [diff] [blame] | 87 | #include "ios/web/common/web_view_creation_util.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 88 | |
Sylvain Defresne | 9c10708 | 2020-10-27 16:39:13 | [diff] [blame] | 89 | #if BUILDFLAG(IOS_SCREEN_TIME_ENABLED) |
| 90 | #include "ios/chrome/browser/screen_time/features.h" |
| 91 | #endif |
| 92 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 93 | #if !defined(OFFICIAL_BUILD) |
| 94 | #include "components/variations/variations_switches.h" |
vitaliii | 489217aa | 2017-01-30 14:50:22 | [diff] [blame] | 95 | #endif |
stkhapugin | c1be179 | 2016-12-13 14:30:53 | [diff] [blame] | 96 | |
| 97 | #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 98 | #error "This file requires ARC support." |
| 99 | #endif |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 100 | |
elawrence | 816f6790e | 2017-06-16 18:19:28 | [diff] [blame] | 101 | using flags_ui::FeatureEntry; |
| 102 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 103 | namespace { |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 104 | |
Olivier Robin | 3d6041162 | 2018-02-23 10:03:22 | [diff] [blame] | 105 | const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = { |
| 106 | {flags_ui::kGenericExperimentChoiceDefault, "", ""}, |
| 107 | {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"}, |
| 108 | {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"}, |
| 109 | {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"}, |
| 110 | {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"}, |
| 111 | {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"}, |
| 112 | {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"}, |
| 113 | {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"}, |
| 114 | {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"}, |
| 115 | }; |
| 116 | |
Nohemi Fernandez | 222d6d4 | 2020-09-30 20:35:57 | [diff] [blame] | 117 | const FeatureEntry::Choice kDelayThresholdMinutesToUpdateGaiaCookieChoices[] = { |
| 118 | {flags_ui::kGenericExperimentChoiceDefault, "", ""}, |
| 119 | {"0", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "0"}, |
| 120 | {"10", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "10"}, |
| 121 | {"60", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "60"}, |
| 122 | }; |
| 123 | |
Nohemi Fernandez | c00842a | 2021-07-26 11:47:34 | [diff] [blame] | 124 | const FeatureEntry::Choice |
| 125 | kWaitThresholdMillisecondsForCapabilitiesApiChoices[] = { |
| 126 | {flags_ui::kGenericExperimentChoiceDefault, "", ""}, |
| 127 | {"200", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "200"}, |
| 128 | {"500", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "500"}, |
| 129 | {"5000", signin::kWaitThresholdMillisecondsForCapabilitiesApi, "5000"}, |
| 130 | }; |
| 131 | |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 132 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = { |
| 133 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}}; |
| 134 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = { |
| 135 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}}; |
| 136 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = { |
| 137 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}}; |
| 138 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = { |
| 139 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}}; |
| 140 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = { |
| 141 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}}; |
| 142 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = { |
| 143 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}}; |
| 144 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = { |
| 145 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}}; |
| 146 | |
| 147 | const FeatureEntry::FeatureVariation |
| 148 | kOmniboxUIMaxAutocompleteMatchesVariations[] = { |
| 149 | {"3 matches", kOmniboxUIMaxAutocompleteMatches3, |
| 150 | base::size(kOmniboxUIMaxAutocompleteMatches3), nullptr}, |
| 151 | {"4 matches", kOmniboxUIMaxAutocompleteMatches4, |
| 152 | base::size(kOmniboxUIMaxAutocompleteMatches4), nullptr}, |
| 153 | {"5 matches", kOmniboxUIMaxAutocompleteMatches5, |
| 154 | base::size(kOmniboxUIMaxAutocompleteMatches5), nullptr}, |
| 155 | {"6 matches", kOmniboxUIMaxAutocompleteMatches6, |
| 156 | base::size(kOmniboxUIMaxAutocompleteMatches6), nullptr}, |
| 157 | {"8 matches", kOmniboxUIMaxAutocompleteMatches8, |
| 158 | base::size(kOmniboxUIMaxAutocompleteMatches8), nullptr}, |
| 159 | {"10 matches", kOmniboxUIMaxAutocompleteMatches10, |
| 160 | base::size(kOmniboxUIMaxAutocompleteMatches10), nullptr}, |
| 161 | {"12 matches", kOmniboxUIMaxAutocompleteMatches12, |
| 162 | base::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}}; |
| 163 | |
Caitlin Fischer | 37e0123 | 2019-05-24 13:05:45 | [diff] [blame] | 164 | const FeatureEntry::FeatureParam |
| 165 | kAutofillUseMobileLabelDisambiguationShowAll[] = { |
| 166 | {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName, |
| 167 | autofill::features:: |
| 168 | kAutofillUseMobileLabelDisambiguationParameterShowAll}}; |
| 169 | const FeatureEntry::FeatureParam |
| 170 | kAutofillUseMobileLabelDisambiguationShowOne[] = { |
| 171 | {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName, |
| 172 | autofill::features:: |
| 173 | kAutofillUseMobileLabelDisambiguationParameterShowOne}}; |
| 174 | |
| 175 | const FeatureEntry::FeatureVariation |
| 176 | kAutofillUseMobileLabelDisambiguationVariations[] = { |
| 177 | {"(show all)", kAutofillUseMobileLabelDisambiguationShowAll, |
| 178 | base::size(kAutofillUseMobileLabelDisambiguationShowAll), nullptr}, |
| 179 | {"(show one)", kAutofillUseMobileLabelDisambiguationShowOne, |
| 180 | base::size(kAutofillUseMobileLabelDisambiguationShowOne), nullptr}}; |
| 181 | |
David Maunder | f4a5e1e | 2021-10-18 17:24:28 | [diff] [blame] | 182 | const FeatureEntry::FeatureParam kCommercePriceTrackingWithOptimizationGuide[] = |
David Maunder | dbffda4f | 2022-01-06 23:16:41 | [diff] [blame] | 183 | {{"price_tracking_with_optimization_guide", "true"}, |
| 184 | {"price_tracking_opt_out", "false"}}; |
| 185 | |
| 186 | const FeatureEntry::FeatureParam |
| 187 | kCommercePriceTrackingWithOptimizationGuideAndOptOut[] = { |
| 188 | {"price_tracking_with_optimization_guide", "true"}, |
| 189 | {"price_tracking_opt_out", "true"}}; |
David Maunder | f4a5e1e | 2021-10-18 17:24:28 | [diff] [blame] | 190 | |
| 191 | const FeatureEntry::FeatureVariation kCommercePriceTrackingVariations[] = { |
| 192 | {"Price Tracking with Optimization Guide", |
| 193 | kCommercePriceTrackingWithOptimizationGuide, |
David Maunder | dbffda4f | 2022-01-06 23:16:41 | [diff] [blame] | 194 | base::size(kCommercePriceTrackingWithOptimizationGuide), nullptr}, |
| 195 | {"Price Tracking with Optimization Guide and Opt Out", |
| 196 | kCommercePriceTrackingWithOptimizationGuideAndOptOut, |
| 197 | base::size(kCommercePriceTrackingWithOptimizationGuideAndOptOut), |
| 198 | nullptr}}; |
David Maunder | f4a5e1e | 2021-10-18 17:24:28 | [diff] [blame] | 199 | |
Javier Ernesto Flores Robles | e85f4a1 | 2021-02-23 18:10:10 | [diff] [blame] | 200 | const FeatureEntry::FeatureParam |
Javier Ernesto Flores Robles | 15941423 | 2021-06-16 14:29:59 | [diff] [blame] | 201 | kDefaultBrowserFullscreenPromoExperimentRemindMeLater[] = { |
| 202 | {kDefaultBrowserFullscreenPromoExperimentRemindMeGroupParam, "true"}}; |
| 203 | const FeatureEntry::FeatureVariation |
| 204 | kDefaultBrowserFullscreenPromoExperimentVariations[] = { |
| 205 | {"Remind me later", |
| 206 | kDefaultBrowserFullscreenPromoExperimentRemindMeLater, |
| 207 | base::size(kDefaultBrowserFullscreenPromoExperimentRemindMeLater), |
| 208 | nullptr}}; |
| 209 | |
gogerald | db0d8ae | 2020-11-13 03:56:58 | [diff] [blame] | 210 | const FeatureEntry::FeatureParam kDiscoverFeedInNtpEnableNativeUI[] = { |
| 211 | {kDiscoverFeedIsNativeUIEnabled, "true"}}; |
| 212 | const FeatureEntry::FeatureVariation kDiscoverFeedInNtpVariations[] = { |
| 213 | {"Native UI", kDiscoverFeedInNtpEnableNativeUI, |
| 214 | base::size(kDiscoverFeedInNtpEnableNativeUI), nullptr}}; |
| 215 | |
Sergio Collazos | 9fcc6ed | 2021-10-06 00:58:03 | [diff] [blame] | 216 | const FeatureEntry::FeatureParam kDiscoverFeedSRSReconstructedTemplates[] = { |
| 217 | {kDiscoverFeedSRSReconstructedTemplatesEnabled, "true"}}; |
| 218 | const FeatureEntry::FeatureParam kDiscoverFeedSRSPreloadTemplates[] = { |
| 219 | {kDiscoverFeedSRSPreloadTemplatesEnabled, "true"}}; |
| 220 | const FeatureEntry::FeatureVariation |
| 221 | kEnableDiscoverFeedStaticResourceServingVariations[] = { |
| 222 | {"Reconstruct Templates", kDiscoverFeedSRSReconstructedTemplates, |
| 223 | base::size(kDiscoverFeedSRSReconstructedTemplates), nullptr}, |
| 224 | {"Preload Templates", kDiscoverFeedSRSPreloadTemplates, |
| 225 | base::size(kDiscoverFeedSRSPreloadTemplates), nullptr}, |
| 226 | }; |
| 227 | |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 228 | const FeatureEntry::FeatureParam kStartSurfaceTenSecondsShrinkLogo[] = { |
Chris Lu | 5470417c | 2021-03-03 18:43:08 | [diff] [blame] | 229 | {kStartSurfaceShrinkLogoParam, "true"}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 230 | {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}}; |
| 231 | const FeatureEntry::FeatureParam kStartSurfaceTenSecondsHideShortcuts[] = { |
Chris Lu | 5470417c | 2021-03-03 18:43:08 | [diff] [blame] | 232 | {kStartSurfaceHideShortcutsParam, "true"}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 233 | {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}}; |
| 234 | const FeatureEntry::FeatureParam kStartSurfaceTenSecondsReturnToRecentTab[] = { |
Chris Lu | 5470417c | 2021-03-03 18:43:08 | [diff] [blame] | 235 | {kStartSurfaceReturnToRecentTabParam, "true"}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 236 | {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}}; |
| 237 | const FeatureEntry::FeatureParam |
| 238 | kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab[] = { |
| 239 | {kStartSurfaceShrinkLogoParam, "true"}, |
| 240 | {kStartSurfaceReturnToRecentTabParam, "true"}, |
| 241 | {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}}; |
| 242 | const FeatureEntry::FeatureParam |
| 243 | kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab[] = { |
| 244 | {kStartSurfaceHideShortcutsParam, "true"}, |
| 245 | {kStartSurfaceReturnToRecentTabParam, "true"}, |
| 246 | {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}}; |
| 247 | const FeatureEntry::FeatureParam kStartSurfaceOneHourShrinkLogo[] = { |
Chris Lu | 5470417c | 2021-03-03 18:43:08 | [diff] [blame] | 248 | {kStartSurfaceShrinkLogoParam, "true"}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 249 | {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}}; |
| 250 | const FeatureEntry::FeatureParam kStartSurfaceOneHourHideShortcuts[] = { |
| 251 | {kStartSurfaceHideShortcutsParam, "true"}, |
| 252 | {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}}; |
| 253 | const FeatureEntry::FeatureParam kStartSurfaceOneHourReturnToRecentTab[] = { |
Chris Lu | 5470417c | 2021-03-03 18:43:08 | [diff] [blame] | 254 | {kStartSurfaceReturnToRecentTabParam, "true"}, |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 255 | {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}}; |
| 256 | const FeatureEntry::FeatureParam |
| 257 | kStartSurfaceOneHourShrinkLogoReturnToRecentTab[] = { |
| 258 | {kStartSurfaceShrinkLogoParam, "true"}, |
| 259 | {kStartSurfaceReturnToRecentTabParam, "true"}, |
| 260 | {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}}; |
| 261 | const FeatureEntry::FeatureParam |
| 262 | kStartSurfaceOneHourHideShortcutsReturnToRecentTab[] = { |
| 263 | {kStartSurfaceHideShortcutsParam, "true"}, |
| 264 | {kStartSurfaceReturnToRecentTabParam, "true"}, |
| 265 | {kReturnToStartSurfaceInactiveDurationInSeconds, "3600"}}; |
Chris Lu | 5470417c | 2021-03-03 18:43:08 | [diff] [blame] | 266 | |
gogerald | 0e39e3aa | 2021-02-10 18:41:23 | [diff] [blame] | 267 | const FeatureEntry::FeatureVariation kStartSurfaceVariations[] = { |
gogerald | 53c6e7a | 2021-04-15 22:07:35 | [diff] [blame] | 268 | {"10s:Show Return to Recent Tab tile", |
| 269 | kStartSurfaceTenSecondsReturnToRecentTab, |
| 270 | base::size(kStartSurfaceTenSecondsReturnToRecentTab), nullptr}, |
| 271 | {"10s:Shrink Logo", kStartSurfaceTenSecondsShrinkLogo, |
| 272 | base::size(kStartSurfaceTenSecondsShrinkLogo), nullptr}, |
| 273 | {"10s:Hide Shortcuts", kStartSurfaceTenSecondsHideShortcuts, |
| 274 | base::size(kStartSurfaceTenSecondsHideShortcuts), nullptr}, |
| 275 | {"10s:Shrink Logo and show Return to Recent Tab tile", |
| 276 | kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab, |
| 277 | base::size(kStartSurfaceTenSecondsShrinkLogoReturnToRecentTab), nullptr}, |
| 278 | {"10s:Hide Shortcuts and show Return to Recent Tab tile", |
| 279 | kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab, |
| 280 | base::size(kStartSurfaceTenSecondsHideShortcutsReturnToRecentTab), |
| 281 | nullptr}, |
| 282 | {"1h:Show Return to Recent Tab tile", kStartSurfaceOneHourReturnToRecentTab, |
| 283 | base::size(kStartSurfaceOneHourReturnToRecentTab), nullptr}, |
| 284 | {"1h:Shrink Logo", kStartSurfaceOneHourShrinkLogo, |
| 285 | base::size(kStartSurfaceOneHourShrinkLogo), nullptr}, |
| 286 | {"1h:Hide Shortcuts", kStartSurfaceOneHourHideShortcuts, |
| 287 | base::size(kStartSurfaceOneHourHideShortcuts), nullptr}, |
| 288 | {"1h:Shrink Logo and show Return to Recent Tab tile", |
| 289 | kStartSurfaceOneHourShrinkLogoReturnToRecentTab, |
| 290 | base::size(kStartSurfaceOneHourShrinkLogoReturnToRecentTab), nullptr}, |
| 291 | {"1h:Hide Shortcuts and show Return to Recent Tab tile", |
| 292 | kStartSurfaceOneHourHideShortcutsReturnToRecentTab, |
| 293 | base::size(kStartSurfaceOneHourHideShortcutsReturnToRecentTab), nullptr}, |
Chris Lu | 5470417c | 2021-03-03 18:43:08 | [diff] [blame] | 294 | }; |
gogerald | 0e39e3aa | 2021-02-10 18:41:23 | [diff] [blame] | 295 | |
Aliona DANGLA | 8fae66f0 | 2021-10-06 15:47:11 | [diff] [blame] | 296 | const FeatureEntry::FeatureParam kFREDefaultPromoTestingDefaultDelay[] = { |
| 297 | {kFREDefaultPromoTestingDefaultDelayParam, "true"}}; |
Aliona DANGLA | ebfd7d02 | 2021-10-08 14:15:45 | [diff] [blame] | 298 | const FeatureEntry::FeatureParam kFREDefaultPromoTestingOnly[] = { |
| 299 | {kFREDefaultPromoTestingOnlyParam, "true"}}; |
Aliona DANGLA | 8fae66f0 | 2021-10-06 15:47:11 | [diff] [blame] | 300 | const FeatureEntry::FeatureParam kFREDefaultPromoTestingShortDelay[] = { |
| 301 | {kFREDefaultPromoTestingShortDelayParam, "true"}}; |
| 302 | const FeatureEntry::FeatureVariation kFREDefaultPromoTestingVariations[] = { |
| 303 | {"Wait 14 days after FRE default browser promo", |
| 304 | kFREDefaultPromoTestingDefaultDelay, |
| 305 | base::size(kFREDefaultPromoTestingDefaultDelay), nullptr}, |
Aliona DANGLA | ebfd7d02 | 2021-10-08 14:15:45 | [diff] [blame] | 306 | {"FRE default browser promo only", kFREDefaultPromoTestingOnly, |
| 307 | base::size(kFREDefaultPromoTestingOnly), nullptr}, |
Aliona DANGLA | 8fae66f0 | 2021-10-06 15:47:11 | [diff] [blame] | 308 | {"Wait 3 days after FRE default browser promo", |
| 309 | kFREDefaultPromoTestingShortDelay, |
| 310 | base::size(kFREDefaultPromoTestingShortDelay), nullptr}, |
| 311 | }; |
| 312 | |
Veronique Nguyen | 6593c76 | 2021-11-30 17:28:56 | [diff] [blame] | 313 | const FeatureEntry::FeatureVariation kEnableFREUIModuleIOSVariations[] = { |
| 314 | {"TOP | OLD", |
| 315 | (FeatureEntry::FeatureParam[]){ |
| 316 | {kFREUIIdentitySwitcherPositionParam, "top"}, |
| 317 | {kFREUIStringsSetParam, "old"}}, |
| 318 | 2, nullptr}, |
| 319 | {"BOTTOM | OLD", |
| 320 | (FeatureEntry::FeatureParam[]){ |
| 321 | {kFREUIIdentitySwitcherPositionParam, "bottom"}, |
| 322 | {kFREUIStringsSetParam, "old"}}, |
| 323 | 2, nullptr}, |
| 324 | {"TOP | NEW", |
| 325 | (FeatureEntry::FeatureParam[]){ |
| 326 | {kFREUIIdentitySwitcherPositionParam, "top"}, |
| 327 | {kFREUIStringsSetParam, "new"}}, |
| 328 | 2, nullptr}, |
| 329 | {"BOTTOM | NEW", |
| 330 | (FeatureEntry::FeatureParam[]){ |
| 331 | {kFREUIIdentitySwitcherPositionParam, "bottom"}, |
| 332 | {kFREUIStringsSetParam, "new"}}, |
| 333 | 2, nullptr}}; |
| 334 | |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 335 | // To add a new entry, add to the end of kFeatureEntries. There are four |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 336 | // distinct types of entries: |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 337 | // . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the |
| 338 | // default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 339 | // macro for this type supplying the command line to the macro. |
| 340 | // . MULTI_VALUE: a list of choices, the first of which should correspond to a |
| 341 | // deactivated state for this lab (i.e. no command line option). To specify |
| 342 | // this type of entry use the macro MULTI_VALUE_TYPE supplying it the |
| 343 | // array of choices. |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 344 | // . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is |
| 345 | // either enabled, disabled, or uses the default value of the associated |
| 346 | // base::Feature instance. To specify this type of entry use the macro |
| 347 | // FEATURE_VALUE_TYPE supplying it the base::Feature instance. |
| 348 | // . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a |
| 349 | // base::Feature instance. Choices corresponding to the default state, a |
| 350 | // universally enabled state, and a universally disabled state are |
| 351 | // automatically included. To specify this type of entry use the macro |
| 352 | // FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and |
| 353 | // the array of choices. |
| 354 | // |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 355 | // See the documentation of FeatureEntry for details on the fields. |
| 356 | // |
| 357 | // When adding a new choice, add it to the end of the list. |
| 358 | const flags_ui::FeatureEntry kFeatureEntries[] = { |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 359 | {"in-product-help-demo-mode-choice", |
| 360 | flag_descriptions::kInProductHelpDemoModeName, |
| 361 | flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos, |
| 362 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
Tommy Nyquist | c1d6dea1 | 2017-07-26 20:37:23 | [diff] [blame] | 363 | feature_engagement::kIPHDemoMode, |
| 364 | feature_engagement::kIPHDemoModeChoiceVariations, |
Marc Treib | 2752e8b | 2017-08-04 14:12:09 | [diff] [blame] | 365 | "IPH_DemoMode")}, |
Moe Ahmadi | c3fd7cd | 2018-05-11 21:40:22 | [diff] [blame] | 366 | {"enable-autofill-credit-card-upload", |
| 367 | flag_descriptions::kAutofillCreditCardUploadName, |
| 368 | flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos, |
Anne Lim | 579b573 | 2018-08-30 18:24:24 | [diff] [blame] | 369 | FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)}, |
Tina Wang | 41d431c | 2021-06-21 21:04:13 | [diff] [blame] | 370 | {"enable-discover-feed-preview", |
| 371 | flag_descriptions::kEnableDiscoverFeedPreviewName, |
| 372 | flag_descriptions::kEnableDiscoverFeedPreviewDescription, flags_ui::kOsIos, |
| 373 | FEATURE_VALUE_TYPE(kEnableDiscoverFeedPreview)}, |
Moe Ahmadi | d6d5d17 | 2018-06-20 17:20:23 | [diff] [blame] | 374 | {"use-sync-sandbox", flag_descriptions::kSyncSandboxName, |
| 375 | flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos, |
| 376 | SINGLE_VALUE_TYPE_AND_VALUE( |
| 377 | switches::kSyncServiceURL, |
| 378 | "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")}, |
| 379 | {"wallet-service-use-sandbox", |
| 380 | flag_descriptions::kWalletServiceUseSandboxName, |
| 381 | flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos, |
| 382 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE( |
| 383 | autofill::switches::kWalletServiceUseSandbox, |
| 384 | "1", |
| 385 | autofill::switches::kWalletServiceUseSandbox, |
| 386 | "0")}, |
Mohamad Ahmadi | c4df81f | 2017-12-20 04:41:59 | [diff] [blame] | 387 | {"show-autofill-type-predictions", |
| 388 | flag_descriptions::kShowAutofillTypePredictionsName, |
| 389 | flag_descriptions::kShowAutofillTypePredictionsDescription, |
| 390 | flags_ui::kOsIos, |
Gauthier Ambard | cfd8518 | 2018-01-05 10:37:46 | [diff] [blame] | 391 | FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)}, |
Olivier Robin | 3d6041162 | 2018-02-23 10:03:22 | [diff] [blame] | 392 | {"autofill-ios-delay-between-fields", |
| 393 | flag_descriptions::kAutofillIOSDelayBetweenFieldsName, |
| 394 | flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription, |
| 395 | flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)}, |
Kurt Horimoto | dc33af3 | 2018-05-01 01:39:14 | [diff] [blame] | 396 | {"fullscreen-viewport-adjustment-experiment", |
Chris Lu | 481a932 | 2019-09-25 22:16:53 | [diff] [blame] | 397 | flag_descriptions::kFullscreenSmoothScrollingName, |
| 398 | flag_descriptions::kFullscreenSmoothScrollingDescription, flags_ui::kOsIos, |
| 399 | FEATURE_VALUE_TYPE(fullscreen::features::kSmoothScrollingDefault)}, |
Robbie Gibson | 1f37a5e | 2020-08-06 17:03:06 | [diff] [blame] | 400 | {"webpage-default-zoom-from-dynamic-type", |
| 401 | flag_descriptions::kWebPageDefaultZoomFromDynamicTypeName, |
| 402 | flag_descriptions::kWebPageDefaultZoomFromDynamicTypeDescription, |
| 403 | flags_ui::kOsIos, |
| 404 | FEATURE_VALUE_TYPE(web::kWebPageDefaultZoomFromDynamicType)}, |
Robbie Gibson | 88f2396 | 2020-09-28 14:35:56 | [diff] [blame] | 405 | {"webpage-alternative-text-zoom", |
| 406 | flag_descriptions::kWebPageAlternativeTextZoomName, |
| 407 | flag_descriptions::kWebPageAlternativeTextZoomDescription, |
| 408 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(web::kWebPageAlternativeTextZoom)}, |
Kurt Horimoto | 79d590b | 2018-09-12 19:09:28 | [diff] [blame] | 409 | {"toolbar-container", flag_descriptions::kToolbarContainerName, |
| 410 | flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos, |
| 411 | FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)}, |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 412 | {"omnibox-ui-max-autocomplete-matches", |
| 413 | flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName, |
| 414 | flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription, |
| 415 | flags_ui::kOsIos, |
| 416 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 417 | omnibox::kUIExperimentMaxAutocompleteMatches, |
| 418 | kOmniboxUIMaxAutocompleteMatchesVariations, |
| 419 | "OmniboxUIMaxAutocompleteVariations")}, |
Robbie Gibson | 84f1ddc | 2020-12-10 21:41:28 | [diff] [blame] | 420 | {"omnibox-local-history-zero-suggest", |
| 421 | flag_descriptions::kOmniboxLocalHistoryZeroSuggestName, |
| 422 | flag_descriptions::kOmniboxLocalHistoryZeroSuggestDescription, |
| 423 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(omnibox::kLocalHistoryZeroSuggest)}, |
Justin Cohen | 20b6f07 | 2019-01-16 01:38:50 | [diff] [blame] | 424 | #if defined(DCHECK_IS_CONFIGURABLE) |
| 425 | {"dcheck-is-fatal", flag_descriptions::kDcheckIsFatalName, |
| 426 | flag_descriptions::kDcheckIsFatalDescription, flags_ui::kOsIos, |
| 427 | FEATURE_VALUE_TYPE(base::kDCheckIsFatalFeature)}, |
| 428 | #endif // defined(DCHECK_IS_CONFIGURABLE) |
Caitlin Fischer | 43edd90a | 2019-05-01 13:24:30 | [diff] [blame] | 429 | {"autofill-use-mobile-label-disambiguation", |
| 430 | flag_descriptions::kAutofillUseMobileLabelDisambiguationName, |
| 431 | flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription, |
| 432 | flags_ui::kOsIos, |
Caitlin Fischer | 37e0123 | 2019-05-24 13:05:45 | [diff] [blame] | 433 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 434 | autofill::features::kAutofillUseMobileLabelDisambiguation, |
| 435 | kAutofillUseMobileLabelDisambiguationVariations, |
| 436 | "AutofillUseMobileLabelDisambiguation")}, |
Olivier Robin | 43814bb | 2021-06-22 15:25:45 | [diff] [blame] | 437 | {"metrickit-crash-reports", flag_descriptions::kMetrickitCrashReportName, |
| 438 | flag_descriptions::kMetrickitCrashReportDescription, flags_ui::kOsIos, |
| 439 | FEATURE_VALUE_TYPE(kMetrickitCrashReport)}, |
Mike Dougherty | b6c770d | 2019-09-13 22:56:46 | [diff] [blame] | 440 | {"ios-breadcrumbs", flag_descriptions::kLogBreadcrumbsName, |
| 441 | flag_descriptions::kLogBreadcrumbsDescription, flags_ui::kOsIos, |
Jesse McKenna | 85c1a59f | 2021-05-05 19:08:30 | [diff] [blame] | 442 | FEATURE_VALUE_TYPE(breadcrumbs::kLogBreadcrumbs)}, |
Eugene But | 2823dc7e | 2020-07-21 18:10:37 | [diff] [blame] | 443 | {"ios-synthetic-crash-reports", |
| 444 | flag_descriptions::kSyntheticCrashReportsForUteName, |
| 445 | flag_descriptions::kSyntheticCrashReportsForUteDescription, |
| 446 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSyntheticCrashReportsForUte)}, |
Jérôme Lebel | c374fdd | 2019-09-27 10:36:48 | [diff] [blame] | 447 | {"force-startup-signin-promo", |
| 448 | flag_descriptions::kForceStartupSigninPromoName, |
| 449 | flag_descriptions::kForceStartupSigninPromoDescription, flags_ui::kOsIos, |
Alice Wang | 345e0944 | 2021-07-05 09:03:29 | [diff] [blame] | 450 | FEATURE_VALUE_TYPE(switches::kForceStartupSigninPromo)}, |
Yoichi Osato | 7ae1175 | 2021-03-16 03:27:22 | [diff] [blame] | 451 | {"restore-session-from-cache", |
| 452 | flag_descriptions::kRestoreSessionFromCacheName, |
| 453 | flag_descriptions::kRestoreSessionFromCacheDescription, flags_ui::kOsIos, |
Justin Cohen | 3ec2522c | 2021-04-23 18:23:49 | [diff] [blame] | 454 | FEATURE_VALUE_TYPE(web::kRestoreSessionFromCache)}, |
sczs | 4622e6e | 2019-11-06 01:17:59 | [diff] [blame] | 455 | {"autofill-save-card-dismiss-on-navigation", |
| 456 | flag_descriptions::kAutofillSaveCardDismissOnNavigationName, |
| 457 | flag_descriptions::kAutofillSaveCardDismissOnNavigationDescription, |
| 458 | flags_ui::kOsIos, |
| 459 | FEATURE_VALUE_TYPE( |
| 460 | autofill::features::kAutofillSaveCardDismissOnNavigation)}, |
sczs | 37d9c13 | 2020-07-18 06:06:33 | [diff] [blame] | 461 | {"new-content-suggestions-feed", flag_descriptions::kDiscoverFeedInNtpName, |
adamta | 22a4d50 | 2020-05-21 03:12:21 | [diff] [blame] | 462 | flag_descriptions::kDiscoverFeedInNtpDescription, flags_ui::kOsIos, |
gogerald | db0d8ae | 2020-11-13 03:56:58 | [diff] [blame] | 463 | FEATURE_WITH_PARAMS_VALUE_TYPE(kDiscoverFeedInNtp, |
| 464 | kDiscoverFeedInNtpVariations, |
| 465 | "IOSDiscoverFeed")}, |
Roberto Moura | b87b972 | 2020-06-17 17:12:09 | [diff] [blame] | 466 | {"expanded-tab-strip", flag_descriptions::kExpandedTabStripName, |
| 467 | flag_descriptions::kExpandedTabStripDescription, flags_ui::kOsIos, |
| 468 | FEATURE_VALUE_TYPE(kExpandedTabStrip)}, |
Ben Blake | 14592fe | 2020-06-16 15:34:38 | [diff] [blame] | 469 | {"autofill-enable-offers-in-downstream", |
| 470 | flag_descriptions::kAutofillEnableOffersInDownstreamName, |
| 471 | flag_descriptions::kAutofillEnableOffersInDownstreamDescription, |
| 472 | flags_ui::kOsIos, |
| 473 | FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableOffersInDownstream)}, |
Tommy Martino | 6b4eb7e | 2020-06-25 18:25:41 | [diff] [blame] | 474 | {"shared-highlighting-ios", flag_descriptions::kSharedHighlightingIOSName, |
| 475 | flag_descriptions::kSharedHighlightingIOSDescription, flags_ui::kOsIos, |
| 476 | FEATURE_VALUE_TYPE(kSharedHighlightingIOS)}, |
Veronique Nguyen | 6593c76 | 2021-11-30 17:28:56 | [diff] [blame] | 477 | {"enable-fre-ui-module-ios-with-options", |
| 478 | flag_descriptions::kEnableFREUIModuleIOSName, |
Tina Wang | a252ca4 | 2021-04-01 17:14:23 | [diff] [blame] | 479 | flag_descriptions::kEnableFREUIModuleIOSDescription, flags_ui::kOsIos, |
Veronique Nguyen | 6593c76 | 2021-11-30 17:28:56 | [diff] [blame] | 480 | FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFREUIModuleIOS, |
| 481 | kEnableFREUIModuleIOSVariations, |
| 482 | "EnableFREUIModuleIOS")}, |
Tina Wang | 17514e2f | 2021-09-24 23:57:18 | [diff] [blame] | 483 | {"enable-long-message-duration", |
| 484 | flag_descriptions::kEnableLongMessageDurationName, |
| 485 | flag_descriptions::kEnableLongMessageDurationDescription, flags_ui::kOsIos, |
| 486 | FEATURE_VALUE_TYPE(kEnableLongMessageDuration)}, |
Raj T | 3898f03 | 2021-08-19 23:51:27 | [diff] [blame] | 487 | {"enable-optimization-guide", |
| 488 | flag_descriptions::kEnableOptimizationGuideName, |
| 489 | flag_descriptions::kEnableOptimizationGuideDescription, flags_ui::kOsIos, |
| 490 | FEATURE_VALUE_TYPE(optimization_guide::features::kOptimizationHints)}, |
Raj T | 4f742fb | 2021-09-28 04:50:12 | [diff] [blame] | 491 | {"enable-optimization-guide-metadata-validation", |
| 492 | flag_descriptions::kEnableOptimizationGuideMetadataValidationName, |
| 493 | flag_descriptions::kEnableOptimizationGuideMetadataValidationDescription, |
| 494 | flags_ui::kOsIos, |
| 495 | FEATURE_VALUE_TYPE( |
| 496 | optimization_guide::features::kOptimizationGuideMetadataValidation)}, |
Raj T | f18ad5c | 2021-10-07 17:08:00 | [diff] [blame] | 497 | {"enable-optimization-hints-fetching-msbb", |
| 498 | flag_descriptions::kEnableOptimizationHintsFetchingMSBBName, |
| 499 | flag_descriptions::kEnableOptimizationHintsFetchingMSBBDescription, |
| 500 | flags_ui::kOsIos, |
| 501 | FEATURE_VALUE_TYPE( |
| 502 | optimization_guide::features:: |
| 503 | kRemoteOptimizationGuideFetchingAnonymousDataConsent)}, |
Sylvain Defresne | 9c10708 | 2020-10-27 16:39:13 | [diff] [blame] | 504 | #if BUILDFLAG(IOS_SCREEN_TIME_ENABLED) |
edchin | 81467b8 | 2020-09-03 19:31:45 | [diff] [blame] | 505 | {"screen-time-integration-ios", |
| 506 | flag_descriptions::kScreenTimeIntegrationName, |
| 507 | flag_descriptions::kScreenTimeIntegrationDescription, flags_ui::kOsIos, |
| 508 | FEATURE_VALUE_TYPE(kScreenTimeIntegration)}, |
Sylvain Defresne | 9c10708 | 2020-10-27 16:39:13 | [diff] [blame] | 509 | #endif |
Nazerke | 3e993f7 | 2020-09-21 13:00:06 | [diff] [blame] | 510 | {"modern-tab-strip", flag_descriptions::kModernTabStripName, |
| 511 | flag_descriptions::kModernTabStripDescription, flags_ui::kOsIos, |
| 512 | FEATURE_VALUE_TYPE(kModernTabStrip)}, |
Nohemi Fernandez | 222d6d4 | 2020-09-30 20:35:57 | [diff] [blame] | 513 | {"minutes-delay-to-restore-gaia-cookies-if-deleted", |
| 514 | flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieName, |
| 515 | flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieDescription, |
| 516 | flags_ui::kOsIos, |
| 517 | MULTI_VALUE_TYPE(kDelayThresholdMinutesToUpdateGaiaCookieChoices)}, |
Vidhan Jain | b4de5c5 | 2021-08-30 17:08:02 | [diff] [blame] | 518 | {"add-passwords-in-settings", |
| 519 | flag_descriptions::kAddPasswordsInSettingsName, |
| 520 | flag_descriptions::kAddPasswordsInSettingsDescription, flags_ui::kOsIos, |
| 521 | FEATURE_VALUE_TYPE( |
| 522 | password_manager::features::kSupportForAddPasswordsInSettings)}, |
Viktor Semeniuk | d932ff5 | 2020-10-13 13:10:17 | [diff] [blame] | 523 | {"edit-passwords-in-settings", |
| 524 | flag_descriptions::kEditPasswordsInSettingsName, |
| 525 | flag_descriptions::kEditPasswordsInSettingsDescription, flags_ui::kOsIos, |
| 526 | FEATURE_VALUE_TYPE(password_manager::features::kEditPasswordsInSettings)}, |
Eugene But | f869bff | 2020-12-10 01:16:55 | [diff] [blame] | 527 | {"record-snapshot-size", flag_descriptions::kRecordSnapshotSizeName, |
| 528 | flag_descriptions::kRecordSnapshotSizeDescription, flags_ui::kOsIos, |
| 529 | FEATURE_VALUE_TYPE(web::features::kRecordSnapshotSize)}, |
Chris Lu | b17195f | 2020-12-10 20:49:14 | [diff] [blame] | 530 | {"default-browser-fullscreen-promo-experiment", |
| 531 | flag_descriptions::kDefaultBrowserFullscreenPromoExperimentName, |
| 532 | flag_descriptions::kDefaultBrowserFullscreenPromoExperimentDescription, |
| 533 | flags_ui::kOsIos, |
Javier Ernesto Flores Robles | 15941423 | 2021-06-16 14:29:59 | [diff] [blame] | 534 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 535 | kDefaultBrowserFullscreenPromoExperiment, |
| 536 | kDefaultBrowserFullscreenPromoExperimentVariations, |
| 537 | "IOSDefaultBrowserFullscreenPromoExperiment")}, |
Cheick Cisse | 76ade3d | 2020-12-16 00:15:11 | [diff] [blame] | 538 | {"ios-shared-highlighting-color-change", |
| 539 | flag_descriptions::kIOSSharedHighlightingColorChangeName, |
| 540 | flag_descriptions::kIOSSharedHighlightingColorChangeDescription, |
Cheick Cisse | d0b5bfe | 2021-02-11 14:23:07 | [diff] [blame] | 541 | flags_ui::kOsIos, |
| 542 | FEATURE_VALUE_TYPE(web::features::kIOSSharedHighlightingColorChange)}, |
Cheick Cisse | fe99486 | 2021-12-15 16:01:34 | [diff] [blame] | 543 | {"ios-shared-highlighting-v2", |
| 544 | flag_descriptions::kIOSSharedHighlightingV2Name, |
| 545 | flag_descriptions::kIOSSharedHighlightingV2Description, flags_ui::kOsIos, |
| 546 | FEATURE_VALUE_TYPE(shared_highlighting::kIOSSharedHighlightingV2)}, |
Stepan Khapugin | 0434120 | 2021-01-07 12:22:45 | [diff] [blame] | 547 | {"omnibox-new-textfield-implementation", |
| 548 | flag_descriptions::kOmniboxNewImplementationName, |
| 549 | flag_descriptions::kOmniboxNewImplementationDescription, flags_ui::kOsIos, |
| 550 | FEATURE_VALUE_TYPE(kIOSNewOmniboxImplementation)}, |
gogerald | 0ff29e5 | 2021-02-03 18:56:19 | [diff] [blame] | 551 | {"start-surface", flag_descriptions::kStartSurfaceName, |
| 552 | flag_descriptions::kStartSurfaceDescription, flags_ui::kOsIos, |
gogerald | 0e39e3aa | 2021-02-10 18:41:23 | [diff] [blame] | 553 | FEATURE_WITH_PARAMS_VALUE_TYPE(kStartSurface, |
| 554 | kStartSurfaceVariations, |
| 555 | "StartSurface")}, |
Justin Cohen | 13ac7a20 | 2021-02-04 18:27:28 | [diff] [blame] | 556 | {"ios-crashpad", flag_descriptions::kCrashpadIOSName, |
| 557 | flag_descriptions::kCrashpadIOSDescription, flags_ui::kOsIos, |
| 558 | FEATURE_VALUE_TYPE(kCrashpadIOS)}, |
Maria Kazinova | b69b75d | 2021-02-16 00:09:37 | [diff] [blame] | 559 | {"detect-form-submission-on-form-clear", |
| 560 | flag_descriptions::kDetectFormSubmissionOnFormClearIOSName, |
| 561 | flag_descriptions::kDetectFormSubmissionOnFormClearIOSDescription, |
| 562 | flags_ui::kOsIos, |
| 563 | FEATURE_VALUE_TYPE( |
| 564 | password_manager::features::kDetectFormSubmissionOnFormClear)}, |
Maria Kazinova | 852e2370 | 2021-02-24 11:10:11 | [diff] [blame] | 565 | {"enable-manual-password-generation", |
| 566 | flag_descriptions::kEnableManualPasswordGenerationName, |
| 567 | flag_descriptions::kEnableManualPasswordGenerationDescription, |
| 568 | flags_ui::kOsIos, |
| 569 | FEATURE_VALUE_TYPE( |
| 570 | password_manager::features::kEnableManualPasswordGeneration)}, |
Vidhan Jain | 451b475 | 2021-07-15 10:16:42 | [diff] [blame] | 571 | {"autofill-address-verification-in-save-prompt", |
| 572 | flag_descriptions::kEnableAutofillAddressSavePromptAddressVerificationName, |
| 573 | flag_descriptions:: |
| 574 | kEnableAutofillAddressSavePromptAddressVerificationDescription, |
| 575 | flags_ui::kOsIos, |
| 576 | FEATURE_VALUE_TYPE( |
| 577 | autofill::features:: |
| 578 | kAutofillAddressProfileSavePromptAddressVerificationSupport)}, |
Vidhan Jain | a6574155 | 2021-03-09 17:18:27 | [diff] [blame] | 579 | {"autofill-address-save-prompt", |
| 580 | flag_descriptions::kEnableAutofillAddressSavePromptName, |
| 581 | flag_descriptions::kEnableAutofillAddressSavePromptDescription, |
| 582 | flags_ui::kOsIos, |
| 583 | FEATURE_VALUE_TYPE(autofill::features::kAutofillAddressProfileSavePrompt)}, |
Viktor Semeniuk | 68e794a | 2021-03-24 10:23:25 | [diff] [blame] | 584 | {"filling-across-affiliated-websites", |
| 585 | flag_descriptions::kFillingAcrossAffiliatedWebsitesName, |
| 586 | flag_descriptions::kFillingAcrossAffiliatedWebsitesDescription, |
| 587 | flags_ui::kOsIos, |
| 588 | FEATURE_VALUE_TYPE( |
| 589 | password_manager::features::kFillingAcrossAffiliatedWebsites)}, |
Jared Saul | d47c2b7 | 2021-03-25 22:47:31 | [diff] [blame] | 590 | {"autofill-parse-merchant-promo-code-fields", |
| 591 | flag_descriptions::kAutofillParseMerchantPromoCodeFieldsName, |
| 592 | flag_descriptions::kAutofillParseMerchantPromoCodeFieldsDescription, |
| 593 | flags_ui::kOsIos, |
| 594 | FEATURE_VALUE_TYPE( |
| 595 | autofill::features::kAutofillParseMerchantPromoCodeFields)}, |
harrisonsean | a9d1304 | 2021-03-31 17:21:13 | [diff] [blame] | 596 | {"search-history-link-ios", flag_descriptions::kSearchHistoryLinkIOSName, |
| 597 | flag_descriptions::kSearchHistoryLinkIOSDescription, flags_ui::kOsIos, |
| 598 | FEATURE_VALUE_TYPE(kSearchHistoryLinkIOS)}, |
edchin | 257cea2f | 2021-04-07 13:07:13 | [diff] [blame] | 599 | {"interest-feed-v2-clicks-and-views-cond-upload", |
| 600 | flag_descriptions::kInterestFeedV2ClickAndViewActionsConditionalUploadName, |
| 601 | flag_descriptions:: |
| 602 | kInterestFeedV2ClickAndViewActionsConditionalUploadDescription, |
| 603 | flags_ui::kOsIos, |
| 604 | FEATURE_VALUE_TYPE(feed::kInterestFeedV2ClicksAndViewsConditionalUpload)}, |
Mohammad Refaat | 76b14f54 | 2021-10-27 14:46:55 | [diff] [blame] | 605 | {"tabs-search-ios", flag_descriptions::kTabsSearchName, |
| 606 | flag_descriptions::kTabsSearchDescription, flags_ui::kOsIos, |
| 607 | FEATURE_VALUE_TYPE(kTabsSearch)}, |
Side Yilmaz | 0e6c15a | 2021-04-26 12:55:09 | [diff] [blame] | 608 | {"incognito-brand-consistency-for-ios", |
| 609 | flag_descriptions::kIncognitoBrandConsistencyForIOSName, |
| 610 | flag_descriptions::kIncognitoBrandConsistencyForIOSDescription, |
| 611 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kIncognitoBrandConsistencyForIOS)}, |
Side Yilmaz | 6c53f710 | 2021-09-07 13:26:19 | [diff] [blame] | 612 | {"incognito-ntp-revamp", flag_descriptions::kIncognitoNtpRevampName, |
| 613 | flag_descriptions::kIncognitoNtpRevampDescription, flags_ui::kOsIos, |
| 614 | FEATURE_VALUE_TYPE(kIncognitoNtpRevamp)}, |
Side Yilmaz | c0e4a4c6 | 2021-05-05 13:41:42 | [diff] [blame] | 615 | {"update-history-entry-points-in-incognito", |
| 616 | flag_descriptions::kUpdateHistoryEntryPointsInIncognitoName, |
| 617 | flag_descriptions::kUpdateHistoryEntryPointsInIncognitoDescription, |
| 618 | flags_ui::kOsIos, |
| 619 | FEATURE_VALUE_TYPE(kUpdateHistoryEntryPointsInIncognito)}, |
Chris Lu | e45c94c6 | 2021-05-21 01:32:59 | [diff] [blame] | 620 | {"reading-list-messages", flag_descriptions::kReadingListMessagesName, |
| 621 | flag_descriptions::kReadingListMessagesDescription, flags_ui::kOsIos, |
| 622 | FEATURE_VALUE_TYPE(kReadingListMessages)}, |
Nohemi Fernandez | 58baec0f | 2021-06-10 10:41:36 | [diff] [blame] | 623 | {"force-disable-extended-sync-promos", |
| 624 | flag_descriptions::kForceDisableExtendedSyncPromosName, |
| 625 | flag_descriptions::kForceDisableExtendedSyncPromosDescription, |
| 626 | flags_ui::kOsIos, |
| 627 | FEATURE_VALUE_TYPE(switches::kForceDisableExtendedSyncPromos)}, |
Ewann | 5f340696 | 2021-11-04 20:08:45 | [diff] [blame] | 628 | |
jlebel | d95434d65 | 2021-06-22 10:32:48 | [diff] [blame] | 629 | {"sync-trusted-vault-passphrase-ios-rpc", |
| 630 | flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCName, |
| 631 | flag_descriptions::kSyncTrustedVaultPassphraseiOSRPCDescription, |
| 632 | flags_ui::kOsIos, |
| 633 | FEATURE_VALUE_TYPE(::switches::kSyncTrustedVaultPassphraseiOSRPC)}, |
Mikel Astiz | 850b0fe | 2021-06-16 09:47:27 | [diff] [blame] | 634 | {"sync-trusted-vault-passphrase-promo", |
| 635 | flag_descriptions::kSyncTrustedVaultPassphrasePromoName, |
| 636 | flag_descriptions::kSyncTrustedVaultPassphrasePromoDescription, |
| 637 | flags_ui::kOsIos, |
| 638 | FEATURE_VALUE_TYPE(::switches::kSyncTrustedVaultPassphrasePromo)}, |
| 639 | {"sync-trusted-vault-passphrase-recovery", |
| 640 | flag_descriptions::kSyncTrustedVaultPassphraseRecoveryName, |
| 641 | flag_descriptions::kSyncTrustedVaultPassphraseRecoveryDescription, |
| 642 | flags_ui::kOsIos, |
| 643 | FEATURE_VALUE_TYPE(::switches::kSyncTrustedVaultPassphraseRecovery)}, |
Nohemi Fernandez | c00842a | 2021-07-26 11:47:34 | [diff] [blame] | 644 | {"wait-threshold-seconds-for-capabilities-api", |
| 645 | flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiName, |
| 646 | flag_descriptions::kWaitThresholdMillisecondsForCapabilitiesApiDescription, |
| 647 | flags_ui::kOsIos, |
| 648 | MULTI_VALUE_TYPE(kWaitThresholdMillisecondsForCapabilitiesApiChoices)}, |
Jared Saul | 2188f76 | 2021-08-02 21:22:23 | [diff] [blame] | 649 | {"autofill-fill-merchant-promo-code-fields", |
| 650 | flag_descriptions::kAutofillFillMerchantPromoCodeFieldsName, |
| 651 | flag_descriptions::kAutofillFillMerchantPromoCodeFieldsDescription, |
| 652 | flags_ui::kOsIos, |
| 653 | FEATURE_VALUE_TYPE( |
| 654 | autofill::features::kAutofillFillMerchantPromoCodeFields)}, |
Ewann | 8cfdfb5 | 2021-08-24 08:40:17 | [diff] [blame] | 655 | {"context-menu-actions-refresh", |
| 656 | flag_descriptions::kContextMenuActionsRefreshName, |
| 657 | flag_descriptions::kContextMenuActionsRefreshDescription, flags_ui::kOsIos, |
| 658 | FEATURE_VALUE_TYPE(kContextMenuActionsRefresh)}, |
Gauthier Ambard | 14d3a26 | 2021-08-09 18:09:23 | [diff] [blame] | 659 | {"context-menu-phase2", |
| 660 | flag_descriptions::kWebViewNativeContextMenuPhase2Name, |
| 661 | flag_descriptions::kWebViewNativeContextMenuPhase2Description, |
| 662 | flags_ui::kOsIos, |
| 663 | FEATURE_VALUE_TYPE(web::features::kWebViewNativeContextMenuPhase2)}, |
Gauthier Ambard | 14d3a26 | 2021-08-09 18:09:23 | [diff] [blame] | 664 | {"default-wkwebview-context-menu", |
| 665 | flag_descriptions::kDefaultWebViewContextMenuName, |
| 666 | flag_descriptions::kDefaultWebViewContextMenuDescription, flags_ui::kOsIos, |
| 667 | FEATURE_VALUE_TYPE(web::features::kDefaultWebViewContextMenu)}, |
Sylvain Defresne | dff67e4 | 2021-09-24 09:43:03 | [diff] [blame] | 668 | {"new-overflow-menu", flag_descriptions::kNewOverflowMenuName, |
| 669 | flag_descriptions::kNewOverflowMenuDescription, flags_ui::kOsIos, |
| 670 | FEATURE_VALUE_TYPE(kNewOverflowMenu)}, |
| 671 | {"enable-new-download-api", flag_descriptions::kEnableNewDownloadAPIName, |
| 672 | flag_descriptions::kEnableNewDownloadAPIDescription, flags_ui::kOsIos, |
| 673 | FEATURE_VALUE_TYPE(web::features::kEnableNewDownloadAPI)}, |
Evan Bernstein | 0a85f33 | 2021-09-29 19:07:24 | [diff] [blame] | 674 | {"use-lens-to-search-for-image", |
| 675 | flag_descriptions::kUseLensToSearchForImageName, |
| 676 | flag_descriptions::kUseLensToSearchForImageDescription, flags_ui::kOsIos, |
Ali Juma | 02a9b7b | 2021-10-01 13:44:44 | [diff] [blame] | 677 | FEATURE_VALUE_TYPE(kUseLensToSearchForImage)}, |
Ewann | f7ed075 | 2021-10-01 17:43:01 | [diff] [blame] | 678 | {"download-vcard", flag_descriptions::kDownloadVcardName, |
| 679 | flag_descriptions::kDownloadVcardDescription, flags_ui::kOsIos, |
| 680 | FEATURE_VALUE_TYPE(kDownloadVcard)}, |
Sergio Collazos | 9fcc6ed | 2021-10-06 00:58:03 | [diff] [blame] | 681 | {"enable-discover-feed-static-resource-serving", |
| 682 | flag_descriptions::kEnableDiscoverFeedStaticResourceServingName, |
| 683 | flag_descriptions::kEnableDiscoverFeedStaticResourceServingDescription, |
| 684 | flags_ui::kOsIos, |
| 685 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 686 | kEnableDiscoverFeedStaticResourceServing, |
| 687 | kEnableDiscoverFeedStaticResourceServingVariations, |
| 688 | "IOSDiscoverFeedStaticResourceServing")}, |
| 689 | {"enable-disco-feed-endpoint", |
| 690 | flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointName, |
| 691 | flag_descriptions::kEnableDiscoverFeedDiscoFeedEndpointDescription, |
| 692 | flags_ui::kOsIos, |
Aliona DANGLA | 8fae66f0 | 2021-10-06 15:47:11 | [diff] [blame] | 693 | FEATURE_VALUE_TYPE(kEnableDiscoverFeedDiscoFeedEndpoint)}, |
| 694 | {"enable-fre-default-browser-screen-testing", |
| 695 | flag_descriptions::kEnableFREDefaultBrowserScreenTestingName, |
| 696 | flag_descriptions::kEnableFREDefaultBrowserScreenTestingDescription, |
| 697 | flags_ui::kOsIos, |
| 698 | FEATURE_WITH_PARAMS_VALUE_TYPE(kEnableFREDefaultBrowserScreenTesting, |
| 699 | kFREDefaultPromoTestingVariations, |
ginny huang | 5ba43b8 | 2021-10-06 18:28:18 | [diff] [blame] | 700 | "EnableFREDefaultBrowserScreenTesting")}, |
| 701 | {"credential-provider-extension-promo", |
| 702 | flag_descriptions::kCredentialProviderExtensionPromoName, |
| 703 | flag_descriptions::kCredentialProviderExtensionPromoDescription, |
edchin | 1313f2b | 2021-10-11 08:08:47 | [diff] [blame] | 704 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kCredentialProviderExtensionPromo)}, |
| 705 | {"enable-discover-feed-shorter-cache", |
| 706 | flag_descriptions::kEnableDiscoverFeedShorterCacheName, |
| 707 | flag_descriptions::kEnableDiscoverFeedShorterCacheDescription, |
| 708 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableDiscoverFeedShorterCache)}, |
Tommy Martino | 7393d76 | 2021-10-12 17:59:28 | [diff] [blame] | 709 | {"shared-highlighting-amp", |
| 710 | flag_descriptions::kIOSSharedHighlightingAmpName, |
| 711 | flag_descriptions::kIOSSharedHighlightingAmpDescription, flags_ui::kOsIos, |
| 712 | FEATURE_VALUE_TYPE(shared_highlighting::kSharedHighlightingAmp)}, |
David Maunder | f4a5e1e | 2021-10-18 17:24:28 | [diff] [blame] | 713 | {"enable-commerce-price-tracking", |
| 714 | flag_descriptions::kCommercePriceTrackingName, |
| 715 | flag_descriptions::kCommercePriceTrackingDescription, flags_ui::kOsIos, |
| 716 | FEATURE_WITH_PARAMS_VALUE_TYPE(kCommercePriceTracking, |
| 717 | kCommercePriceTrackingVariations, |
adamta | 67b6c581 | 2021-10-19 17:02:15 | [diff] [blame] | 718 | "CommercePriceTracking")}, |
Tina Wang | 8058d5f | 2021-11-04 20:06:06 | [diff] [blame] | 719 | {"web-feed-ios", flag_descriptions::kEnableWebChannelsName, |
| 720 | flag_descriptions::kEnableWebChannelsDescription, flags_ui::kOsIos, |
| 721 | FEATURE_VALUE_TYPE(kEnableWebChannels)}, |
adamta | 3933159 | 2021-11-01 20:18:54 | [diff] [blame] | 722 | {"ntp-view-hierarchy-repair", |
| 723 | flag_descriptions::kNTPViewHierarchyRepairName, |
| 724 | flag_descriptions::kNTPViewHierarchyRepairDescription, flags_ui::kOsIos, |
| 725 | FEATURE_VALUE_TYPE(kNTPViewHierarchyRepair)}, |
Chris Lu | 37588a9 | 2021-11-02 21:19:45 | [diff] [blame] | 726 | {"single-ntp", flag_descriptions::kSingleNtpName, |
| 727 | flag_descriptions::kSingleNtpDescription, flags_ui::kOsIos, |
| 728 | FEATURE_VALUE_TYPE(kSingleNtp)}, |
Justin Cohen | 69cec68 | 2021-11-04 20:10:26 | [diff] [blame] | 729 | {"synthesized-restore-session", |
| 730 | flag_descriptions::kSynthesizedRestoreSessionName, |
| 731 | flag_descriptions::kSynthesizedRestoreSessionDescription, flags_ui::kOsIos, |
| 732 | FEATURE_VALUE_TYPE(web::features::kSynthesizedRestoreSession)}, |
Chris Lu | 4723b82 | 2021-11-05 21:47:44 | [diff] [blame] | 733 | {"remove-extra-ntps", flag_descriptions::kRemoveExcessNTPsExperimentName, |
| 734 | flag_descriptions::kRemoveExcessNTPsExperimentDescription, |
Sylvain Defresne | 1619dd00 | 2021-11-06 10:09:48 | [diff] [blame] | 735 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kRemoveExcessNTPs)}, |
| 736 | {"lazily-create-web-state-on-restoration", |
| 737 | flag_descriptions::kLazilyCreateWebStateOnRestorationName, |
| 738 | flag_descriptions::kLazilyCreateWebStateOnRestorationDescription, |
| 739 | flags_ui::kOsIos, |
| 740 | FEATURE_VALUE_TYPE(web::features::kEnableUnrealizedWebStates)}, |
Chris Lu | 45664b6 | 2021-11-08 20:09:29 | [diff] [blame] | 741 | {"reading-list-time-to-read", flag_descriptions::kReadingListTimeToReadName, |
| 742 | flag_descriptions::kReadingListTimeToReadDescription, flags_ui::kOsIos, |
| 743 | FEATURE_VALUE_TYPE(kReadingListTimeToRead)}, |
ginny huang | 1f1755c | 2021-11-11 23:38:23 | [diff] [blame] | 744 | {"enable-shortened-password-auto-fill-instruction", |
| 745 | flag_descriptions::kEnableShortenedPasswordAutoFillInstructionName, |
| 746 | flag_descriptions::kEnableShortenedPasswordAutoFillInstructionDescription, |
| 747 | flags_ui::kOsIos, |
| 748 | FEATURE_VALUE_TYPE(kEnableShortenedPasswordAutoFillInstruction)}, |
Benjamin Williams | 0e7e2fb | 2021-11-17 03:03:41 | [diff] [blame] | 749 | {"enable-password-manager-branding-update", |
| 750 | flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateName, |
| 751 | flag_descriptions::kIOSEnablePasswordManagerBrandingUpdateDescription, |
| 752 | flags_ui::kOsIos, |
Aliona DANGLA | e5b0b6e5 | 2021-11-30 11:58:19 | [diff] [blame] | 753 | FEATURE_VALUE_TYPE( |
| 754 | password_manager::features::kIOSEnablePasswordManagerBrandingUpdate)}, |
Gauthier Ambard | 1d326e2 | 2021-12-16 10:57:53 | [diff] [blame] | 755 | {"default-mode-ua", flag_descriptions::kAddSettingForDefaultPageModeName, |
| 756 | flag_descriptions::kAddSettingForDefaultPageModeDescription, |
| 757 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kAddSettingForDefaultPageMode)}, |
ginnnnnnny | 1532d87 | 2021-12-20 15:57:37 | [diff] [blame] | 758 | {"ios-media-permissions-control", |
| 759 | flag_descriptions::kMediaPermissionsControlName, |
| 760 | flag_descriptions::kMediaPermissionsControlDescription, flags_ui::kOsIos, |
| 761 | FEATURE_VALUE_TYPE(web::features::kMediaPermissionsControl)}, |
Olivier Robin | 3a957df | 2021-12-21 18:04:34 | [diff] [blame] | 762 | {"enable-save-session-tabs-in-separate-files", |
| 763 | flag_descriptions::kSaveSessionTabsToSeparateFilesName, |
| 764 | flag_descriptions::kSaveSessionTabsToSeparateFilesDescription, |
| 765 | flags_ui::kOsIos, |
| 766 | FEATURE_VALUE_TYPE(sessions::kSaveSessionTabsToSeparateFiles)}, |
Gauthier Ambard | 42ad0bb | 2021-12-22 16:50:48 | [diff] [blame] | 767 | {"use-sf-symbols-samples", flag_descriptions::kUseSFSymbolsSamplesName, |
| 768 | flag_descriptions::kUseSFSymbolsSamplesDescription, flags_ui::kOsIos, |
| 769 | FEATURE_VALUE_TYPE(kUseSFSymbolsSamples)}, |
Gauthier Ambard | fa18254 | 2022-01-07 08:27:50 | [diff] [blame] | 770 | {"use-new-popup-menu", flag_descriptions::kUseUIKitPopupMenuName, |
| 771 | flag_descriptions::kUseUIKitPopupMenuDescription, flags_ui::kOsIos, |
| 772 | FEATURE_VALUE_TYPE(kUseUIKitPopupMenu)}, |
Nohemi Fernandez | 76f5480 | 2022-01-10 18:23:32 | [diff] [blame] | 773 | {"enable-unicorn-account-support", |
| 774 | flag_descriptions::kEnableUnicornAccountSupportName, |
| 775 | flag_descriptions::kEnableUnicornAccountSupportDescription, |
| 776 | flags_ui::kOsIos, |
| 777 | FEATURE_VALUE_TYPE(signin::kEnableUnicornAccountSupport)}, |
Jérôme Lebel | fa9e0bc | 2022-01-31 08:50:06 | [diff] [blame] | 778 | {"fre-mobile-identity-consistency", |
| 779 | flag_descriptions::kFREMobileIdentityConsistencyName, |
| 780 | flag_descriptions::kFREMobileIdentityConsistencyDescription, |
| 781 | flags_ui::kOsIos, |
| 782 | FEATURE_VALUE_TYPE(signin::kFREMobileIdentityConsistency)}, |
Chris Lu | 411bea8 | 2022-01-12 18:19:22 | [diff] [blame] | 783 | {"single-cell-content-suggestions", |
| 784 | flag_descriptions::kSingleCellContentSuggestionsName, |
| 785 | flag_descriptions::kSingleCellContentSuggestionsDescription, |
| 786 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSingleCellContentSuggestions)}, |
Chris Lu | e521105 | 2022-02-02 20:44:04 | [diff] [blame] | 787 | {"content-suggestions-header-migration", |
| 788 | flag_descriptions::kContentSuggestionsHeaderMigrationName, |
| 789 | flag_descriptions::kContentSuggestionsHeaderMigrationDescription, |
| 790 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kContentSuggestionsHeaderMigration)}, |
rgod | 90cca8b | 2022-02-04 12:38:27 | [diff] [blame] | 791 | {"leak-detection-unauthenticated", |
| 792 | flag_descriptions::kLeakDetectionUnauthenticatedName, |
| 793 | flag_descriptions::kLeakDetectionUnauthenticatedDescription, |
| 794 | flags_ui::kOsIos, |
| 795 | FEATURE_VALUE_TYPE( |
| 796 | password_manager::features::kLeakDetectionUnauthenticated)}, |
Shivani Chauhan | bf97b0d | 2022-02-08 22:21:28 | [diff] [blame] | 797 | {"autofill-enable-sending-bcn-in-get-upload-details", |
| 798 | flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsName, |
| 799 | flag_descriptions::kAutofillEnableSendingBcnInGetUploadDetailsDescription, |
| 800 | flags_ui::kOsIos, |
| 801 | FEATURE_VALUE_TYPE( |
| 802 | autofill::features::kAutofillEnableSendingBcnInGetUploadDetails)}, |
Ali Juma | 1429cf8a | 2022-02-09 15:31:01 | [diff] [blame^] | 803 | {"enable-fullscreen-api", flag_descriptions::kEnableFullscreenAPIName, |
| 804 | flag_descriptions::kEnableFullscreenAPIDescription, flags_ui::kOsIos, |
| 805 | FEATURE_VALUE_TYPE(web::features::kEnableFullscreenAPI)}, |
Sylvain Defresne | 1619dd00 | 2021-11-06 10:09:48 | [diff] [blame] | 806 | }; |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 807 | |
Rohit Rao | bed794c | 2020-04-27 15:27:45 | [diff] [blame] | 808 | bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) { |
| 809 | return false; |
| 810 | } |
| 811 | |
| 812 | flags_ui::FlagsState& GetGlobalFlagsState() { |
| 813 | static base::NoDestructor<flags_ui::FlagsState> flags_state(kFeatureEntries, |
| 814 | nullptr); |
| 815 | return *flags_state; |
| 816 | } |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 817 | // Creates the experimental test policies map, used by AsyncPolicyLoader and |
| 818 | // PolicyLoaderIOS to locally enable policies. |
Vincent Boisselle | ed0e6f1a | 2021-11-09 06:47:34 | [diff] [blame] | 819 | NSMutableDictionary* CreateExperimentalTestingPolicies() { |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 820 | NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
| 821 | |
Guillaume Jenkins | 25e9bd7 | 2020-08-27 17:39:06 | [diff] [blame] | 822 | // Shared variables for all enterprise experimental flags. |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 823 | NSMutableDictionary* testing_policies = [[NSMutableDictionary alloc] init]; |
Guillaume Jenkins | 25e9bd7 | 2020-08-27 17:39:06 | [diff] [blame] | 824 | NSMutableArray* allowed_experimental_policies = [[NSMutableArray alloc] init]; |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 825 | |
Guillaume Jenkins | 25e9bd7 | 2020-08-27 17:39:06 | [diff] [blame] | 826 | // Set some sample policy values for testing if EnableSamplePolicies is set to |
| 827 | // true. |
Guillaume Jenkins | eeb7007c | 2020-06-25 22:55:40 | [diff] [blame] | 828 | if ([defaults boolForKey:@"EnableSamplePolicies"]) { |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 829 | [testing_policies addEntriesFromDictionary:@{ |
Tina Wang | 59d0b7e | 2020-08-11 04:41:01 | [diff] [blame] | 830 | base::SysUTF8ToNSString(policy::key::kAutofillAddressEnabled) : @NO, |
| 831 | |
Guillaume Jenkins | eeb7007c | 2020-06-25 22:55:40 | [diff] [blame] | 832 | base::SysUTF8ToNSString(policy::key::kAutofillCreditCardEnabled) : @NO, |
| 833 | |
| 834 | // 2 = Disable all variations |
| 835 | base::SysUTF8ToNSString(policy::key::kChromeVariations) : @2, |
| 836 | |
| 837 | // 2 = Do not allow any site to show popups |
| 838 | base::SysUTF8ToNSString(policy::key::kDefaultPopupsSetting) : @2, |
| 839 | |
Tina Wang | 5abee80 | 2020-07-29 23:09:52 | [diff] [blame] | 840 | // Set default search engine. |
| 841 | base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderEnabled) : |
| 842 | @YES, |
| 843 | base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderSearchURL) : |
| 844 | @"http://www.google.com/search?q={searchTerms}", |
| 845 | base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderName) : |
Tina Wang | 7cd0a06 | 2020-09-15 21:31:02 | [diff] [blame] | 846 | @"TestEngine", |
Tina Wang | 5abee80 | 2020-07-29 23:09:52 | [diff] [blame] | 847 | |
Tina Wang | 89068c8 | 2020-10-29 15:51:50 | [diff] [blame] | 848 | base::SysUTF8ToNSString(policy::key::kEditBookmarksEnabled) : @NO, |
| 849 | |
Gauthier Ambard | 21b2370 | 2021-04-16 16:11:27 | [diff] [blame] | 850 | base::SysUTF8ToNSString(policy::key::kNTPContentSuggestionsEnabled) : @NO, |
| 851 | |
Guillaume Jenkins | eeb7007c | 2020-06-25 22:55:40 | [diff] [blame] | 852 | base::SysUTF8ToNSString(policy::key::kPasswordManagerEnabled) : @NO, |
Tina Wang | 59d0b7e | 2020-08-11 04:41:01 | [diff] [blame] | 853 | |
| 854 | base::SysUTF8ToNSString(policy::key::kTranslateEnabled) : @NO, |
Tina Wang | 54dddfc2 | 2020-08-20 22:34:53 | [diff] [blame] | 855 | |
| 856 | // 2 = Enhanced safe browsing protection |
| 857 | base::SysUTF8ToNSString(policy::key::kSafeBrowsingProtectionLevel) : @2, |
| 858 | |
| 859 | base::SysUTF8ToNSString(policy::key::kSearchSuggestEnabled) : @YES, |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 860 | }]; |
| 861 | } |
| 862 | |
Ewann | 227a3c0 | 2021-04-19 12:04:54 | [diff] [blame] | 863 | if ([defaults boolForKey:@"EnableSyncDisabledPolicy"]) { |
Guillaume Jenkins | fe46d3a | 2021-04-26 19:51:04 | [diff] [blame] | 864 | NSString* sync_policy_key = |
| 865 | base::SysUTF8ToNSString(policy::key::kSyncDisabled); |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 866 | [testing_policies addEntriesFromDictionary:@{sync_policy_key : @YES}]; |
Ewann | 227a3c0 | 2021-04-19 12:04:54 | [diff] [blame] | 867 | } |
Ewann | 227a3c0 | 2021-04-19 12:04:54 | [diff] [blame] | 868 | |
Ewann | 570a630 | 2021-08-17 07:22:42 | [diff] [blame] | 869 | // SyncTypesListDisabled policy. |
| 870 | NSString* Sync_types_list_disabled_key = |
| 871 | base::SysUTF8ToNSString(policy::key::kSyncTypesListDisabled); |
| 872 | NSMutableArray* Sync_types_list_disabled_values = |
| 873 | [[NSMutableArray alloc] init]; |
| 874 | if ([defaults boolForKey:@"SyncTypesListBookmarks"]) { |
| 875 | [Sync_types_list_disabled_values addObject:@"bookmarks"]; |
| 876 | } |
| 877 | if ([defaults boolForKey:@"SyncTypesListReadingList"]) { |
| 878 | [Sync_types_list_disabled_values addObject:@"readingList"]; |
| 879 | } |
| 880 | if ([defaults boolForKey:@"SyncTypesListPreferences"]) { |
| 881 | [Sync_types_list_disabled_values addObject:@"preferences"]; |
| 882 | } |
| 883 | if ([defaults boolForKey:@"SyncTypesListPasswords"]) { |
| 884 | [Sync_types_list_disabled_values addObject:@"passwords"]; |
| 885 | } |
| 886 | if ([defaults boolForKey:@"SyncTypesListAutofill"]) { |
| 887 | [Sync_types_list_disabled_values addObject:@"autofill"]; |
| 888 | } |
| 889 | if ([defaults boolForKey:@"SyncTypesListTypedUrls"]) { |
| 890 | [Sync_types_list_disabled_values addObject:@"typedUrls"]; |
| 891 | } |
| 892 | if ([defaults boolForKey:@"SyncTypesListTabs"]) { |
| 893 | [Sync_types_list_disabled_values addObject:@"tabs"]; |
| 894 | } |
| 895 | if ([Sync_types_list_disabled_values count]) { |
| 896 | [testing_policies addEntriesFromDictionary:@{ |
| 897 | Sync_types_list_disabled_key : Sync_types_list_disabled_values |
| 898 | }]; |
Ewann | 570a630 | 2021-08-17 07:22:42 | [diff] [blame] | 899 | } |
| 900 | |
Gauthier Ambard | 073eaa9 | 2021-11-22 15:24:13 | [diff] [blame] | 901 | // If an incognito mode availability is set, set the value. |
Tina Wang | c6bcf57 | 2021-01-27 18:15:52 | [diff] [blame] | 902 | NSString* incognito_policy_key = |
| 903 | base::SysUTF8ToNSString(policy::key::kIncognitoModeAvailability); |
| 904 | NSInteger incognito_mode_availability = |
| 905 | [defaults integerForKey:incognito_policy_key]; |
| 906 | if (incognito_mode_availability) { |
Tina Wang | c6bcf57 | 2021-01-27 18:15:52 | [diff] [blame] | 907 | [testing_policies addEntriesFromDictionary:@{ |
| 908 | incognito_policy_key : @(incognito_mode_availability), |
| 909 | }]; |
| 910 | } |
| 911 | |
Ewann | 40a8f8a | 2021-07-29 10:01:20 | [diff] [blame] | 912 | NSString* restriction_pattern = |
| 913 | [defaults stringForKey:@"RestrictAccountsToPatterns"]; |
| 914 | if ([restriction_pattern length] > 0) { |
Ewann | b3bee38 | 2021-08-16 09:12:29 | [diff] [blame] | 915 | NSString* restrict_key = |
| 916 | base::SysUTF8ToNSString(policy::key::kRestrictAccountsToPatterns); |
Ewann | 40a8f8a | 2021-07-29 10:01:20 | [diff] [blame] | 917 | [testing_policies addEntriesFromDictionary:@{ |
Ewann | b3bee38 | 2021-08-16 09:12:29 | [diff] [blame] | 918 | restrict_key : @[ restriction_pattern ] |
Ewann | 40a8f8a | 2021-07-29 10:01:20 | [diff] [blame] | 919 | }]; |
| 920 | } |
| 921 | |
Vincent Boisselle | 19200bc | 2021-09-01 17:58:25 | [diff] [blame] | 922 | // If the sign-in policy is set (not "None"), add the policy key to the list |
| 923 | // of enabled experimental policies, and set the value. |
| 924 | NSString* const kSigninPolicyKey = @"BrowserSignin"; |
| 925 | NSInteger signin_policy_mode = [defaults integerForKey:kSigninPolicyKey]; |
| 926 | if (signin_policy_mode) { |
| 927 | // Remove the mode offset that was used to represent the unset policy. |
| 928 | --signin_policy_mode; |
| 929 | DCHECK(signin_policy_mode >= 0); |
| 930 | |
Vincent Boisselle | 19200bc | 2021-09-01 17:58:25 | [diff] [blame] | 931 | [testing_policies addEntriesFromDictionary:@{ |
| 932 | kSigninPolicyKey : @(signin_policy_mode), |
| 933 | }]; |
| 934 | } |
| 935 | |
Veronique Nguyen | 9b1044f | 2022-01-11 14:41:13 | [diff] [blame] | 936 | // If the New Tab Page URL is set (not empty) add the value to the list of |
| 937 | // test policies. |
| 938 | NSString* ntp_location = [defaults stringForKey:@"NTPLocation"]; |
| 939 | if ([ntp_location length] > 0) { |
| 940 | NSString* ntp_location_key = |
| 941 | base::SysUTF8ToNSString(policy::key::kNewTabPageLocation); |
| 942 | [testing_policies |
| 943 | addEntriesFromDictionary:@{ntp_location_key : ntp_location}]; |
Veronique Nguyen | 302d870 | 2022-01-12 21:18:57 | [diff] [blame] | 944 | [allowed_experimental_policies addObject:ntp_location_key]; |
Veronique Nguyen | 9b1044f | 2022-01-11 14:41:13 | [diff] [blame] | 945 | } |
| 946 | |
Guillaume Jenkins | 25e9bd7 | 2020-08-27 17:39:06 | [diff] [blame] | 947 | // If any experimental policy was allowed, set the EnableExperimentalPolicies |
| 948 | // policy. |
| 949 | if ([allowed_experimental_policies count] > 0) { |
| 950 | [testing_policies setValue:allowed_experimental_policies |
| 951 | forKey:base::SysUTF8ToNSString( |
| 952 | policy::key::kEnableExperimentalPolicies)]; |
| 953 | } |
| 954 | |
David Jean | 6f85d44f | 2021-08-19 08:08:45 | [diff] [blame] | 955 | // Warning: Add new flags to TestingPoliciesHash() below. |
| 956 | |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 957 | return testing_policies; |
| 958 | } |
David Jean | 6f85d44f | 2021-08-19 08:08:45 | [diff] [blame] | 959 | |
| 960 | // Generates a unique NSString based on currently monitored policies from |
| 961 | // NSUserDefaults standardUserDefaults. |
| 962 | NSString* TestingPoliciesHash() { |
| 963 | NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
| 964 | return [NSString |
| 965 | stringWithFormat:@"%d|%d|%d|%@|%d|%d|%d|%d|%d|%d|%d", |
| 966 | [defaults boolForKey:@"EnableSyncDisabledPolicy"], |
| 967 | [defaults boolForKey:@"EnableSamplePolicies"], |
| 968 | (int)[defaults |
| 969 | integerForKey:@"IncognitoModeAvailability"], |
| 970 | [defaults stringForKey:@"RestrictAccountsToPatterns"], |
| 971 | [defaults boolForKey:@"SyncTypesListBookmarks"], |
| 972 | [defaults boolForKey:@"SyncTypesListReadingList"], |
| 973 | [defaults boolForKey:@"SyncTypesListPreferences"], |
| 974 | [defaults boolForKey:@"SyncTypesListPasswords"], |
| 975 | [defaults boolForKey:@"SyncTypesListAutofill"], |
| 976 | [defaults boolForKey:@"SyncTypesListTypedUrls"], |
| 977 | [defaults boolForKey:@"SyncTypesListTabs"]]; |
| 978 | } |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 979 | } // namespace |
| 980 | |
| 981 | // Add all switches from experimental flags to |command_line|. |
| 982 | void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) { |
| 983 | NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
| 984 | |
| 985 | // Set the UA flag if UseMobileSafariUA is enabled. |
| 986 | if ([defaults boolForKey:@"UseMobileSafariUA"]) { |
| 987 | // Safari uses "Vesion/", followed by the OS version excluding bugfix, where |
| 988 | // Chrome puts its product token. |
| 989 | int32_t major = 0; |
| 990 | int32_t minor = 0; |
| 991 | int32_t bugfix = 0; |
| 992 | base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); |
| 993 | std::string product = base::StringPrintf("Version/%d.%d", major, minor); |
| 994 | |
| 995 | command_line->AppendSwitchASCII(switches::kUserAgent, |
| 996 | web::BuildMobileUserAgent(product)); |
| 997 | } |
| 998 | |
| 999 | // Shared variables for all enterprise experimental flags. |
Vincent Boisselle | ed0e6f1a | 2021-11-09 06:47:34 | [diff] [blame] | 1000 | NSMutableDictionary* testing_policies = CreateExperimentalTestingPolicies(); |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 1001 | |
| 1002 | // If a CBCM enrollment token is provided, force Chrome Browser Cloud |
| 1003 | // Management to enabled and add the token to the list of policies. |
| 1004 | NSString* token_key = |
| 1005 | base::SysUTF8ToNSString(policy::key::kCloudManagementEnrollmentToken); |
| 1006 | NSString* token = [defaults stringForKey:token_key]; |
| 1007 | |
| 1008 | if ([token length] > 0) { |
| 1009 | command_line->AppendSwitch(switches::kEnableChromeBrowserCloudManagement); |
| 1010 | [testing_policies setValue:token forKey:token_key]; |
| 1011 | } |
| 1012 | |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 1013 | // If some policies were set, commit them to the app's registration defaults. |
| 1014 | if ([testing_policies count] > 0) { |
Guillaume Jenkins | eeb7007c | 2020-06-25 22:55:40 | [diff] [blame] | 1015 | NSDictionary* registration_defaults = |
| 1016 | @{kPolicyLoaderIOSConfigurationKey : testing_policies}; |
| 1017 | [defaults registerDefaults:registration_defaults]; |
| 1018 | } |
| 1019 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1020 | // Freeform commandline flags. These are added last, so that any flags added |
| 1021 | // earlier in this function take precedence. |
| 1022 | if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) { |
| 1023 | base::CommandLine::StringVector flags; |
| 1024 | // Append an empty "program" argument. |
| 1025 | flags.push_back(""); |
| 1026 | |
| 1027 | // The number of flags corresponds to the number of text fields in |
| 1028 | // Experimental.plist. |
| 1029 | const int kNumFreeformFlags = 5; |
| 1030 | for (int i = 1; i <= kNumFreeformFlags; ++i) { |
| 1031 | NSString* key = |
| 1032 | [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i]; |
| 1033 | NSString* flag = [defaults stringForKey:key]; |
| 1034 | if ([flag length]) { |
Robbie Gibson | c91ce62 | 2019-05-20 14:44:33 | [diff] [blame] | 1035 | // iOS keyboard replaces -- with —, so undo that. |
| 1036 | flag = [flag stringByReplacingOccurrencesOfString:@"—" |
| 1037 | withString:@"--" |
| 1038 | options:0 |
| 1039 | range:NSMakeRange(0, 1)]; |
| 1040 | // To make things easier, allow flags with no dashes by prepending them |
| 1041 | // here. This also allows for flags that just have one dash if they |
| 1042 | // exist. |
| 1043 | if (![flag hasPrefix:@"-"]) { |
| 1044 | flag = [@"--" stringByAppendingString:flag]; |
| 1045 | } |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1046 | flags.push_back(base::SysNSStringToUTF8(flag)); |
| 1047 | } |
| 1048 | } |
| 1049 | |
| 1050 | base::CommandLine temp_command_line(flags); |
| 1051 | command_line->AppendArguments(temp_command_line, false); |
| 1052 | } |
msarda | fc76f66 | 2017-02-24 12:46:28 | [diff] [blame] | 1053 | |
justincohen | dacc85d | 2017-06-28 23:34:10 | [diff] [blame] | 1054 | // Populate command line flag for 3rd party keyboard omnibox workaround. |
| 1055 | NSString* enableThirdPartyKeyboardWorkaround = |
| 1056 | [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"]; |
| 1057 | if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) { |
| 1058 | command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround); |
| 1059 | } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) { |
| 1060 | command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround); |
| 1061 | } |
| 1062 | |
Sylvain Defresne | d3cd8d9 | 2022-01-18 13:35:08 | [diff] [blame] | 1063 | ios::provider::AppendSwitchesFromExperimentalSettings(defaults, command_line); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1064 | } |
| 1065 | |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 1066 | void MonitorExperimentalSettingsChanges() { |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 1067 | // Startup values for settings to be observed. |
David Jean | 6f85d44f | 2021-08-19 08:08:45 | [diff] [blame] | 1068 | __block NSString* hash = TestingPoliciesHash(); |
David Jean | e83ed65 | 2021-08-25 14:52:48 | [diff] [blame] | 1069 | static std::atomic_bool pending_check(false); |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 1070 | |
| 1071 | auto monitor = ^(NSNotification* notification) { |
David Jean | e83ed65 | 2021-08-25 14:52:48 | [diff] [blame] | 1072 | bool has_pending_check = pending_check.exchange(true); |
| 1073 | if (has_pending_check) |
| 1074 | return; |
| 1075 | |
David Jean | bc0fae3 | 2021-08-25 10:31:39 | [diff] [blame] | 1076 | // Can be called from any thread from where the notification was sent, |
| 1077 | // but since it may change standardUserDefaults, and that has to be on main |
| 1078 | // thread, dispatch to main thread. |
| 1079 | dispatch_async(dispatch_get_main_queue(), ^{ |
| 1080 | // Check if observed settings have changed. Since source and destination |
| 1081 | // are both user defaults, this is required to avoid cycling back here. |
| 1082 | NSString* newHash = TestingPoliciesHash(); |
| 1083 | if (![newHash isEqualToString:hash]) { |
| 1084 | hash = newHash; |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 1085 | |
David Jean | bc0fae3 | 2021-08-25 10:31:39 | [diff] [blame] | 1086 | // Publish update. |
| 1087 | NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
| 1088 | NSMutableDictionary* testing_policies = |
Vincent Boisselle | ed0e6f1a | 2021-11-09 06:47:34 | [diff] [blame] | 1089 | CreateExperimentalTestingPolicies(); |
David Jean | bc0fae3 | 2021-08-25 10:31:39 | [diff] [blame] | 1090 | NSDictionary* registration_defaults = |
| 1091 | @{kPolicyLoaderIOSConfigurationKey : testing_policies}; |
| 1092 | [defaults registerDefaults:registration_defaults]; |
| 1093 | } |
David Jean | e83ed65 | 2021-08-25 14:52:48 | [diff] [blame] | 1094 | |
| 1095 | pending_check.store(false); |
David Jean | bc0fae3 | 2021-08-25 10:31:39 | [diff] [blame] | 1096 | }); |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 1097 | }; |
| 1098 | |
| 1099 | NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; |
| 1100 | [center addObserverForName:NSUserDefaultsDidChangeNotification |
| 1101 | object:nil |
David Jean | bc0fae3 | 2021-08-25 10:31:39 | [diff] [blame] | 1102 | queue:nil |
David Jean | 5ca263c | 2021-08-18 09:19:30 | [diff] [blame] | 1103 | usingBlock:monitor]; |
| 1104 | } |
| 1105 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1106 | void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage, |
| 1107 | base::CommandLine* command_line) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 1108 | GetGlobalFlagsState().ConvertFlagsToSwitches( |
sdefresne | c976390 | 2015-12-02 10:30:11 | [diff] [blame] | 1109 | flags_storage, command_line, flags_ui::kAddSentinels, |
Gregory Chatzinoff | f652372 | 2017-11-21 01:33:53 | [diff] [blame] | 1110 | switches::kEnableFeatures, switches::kDisableFeatures); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1111 | } |
| 1112 | |
jkrcal | bf07337 | 2016-07-29 07:21:31 | [diff] [blame] | 1113 | std::vector<std::string> RegisterAllFeatureVariationParameters( |
| 1114 | flags_ui::FlagsStorage* flags_storage, |
| 1115 | base::FeatureList* feature_list) { |
Justin Cohen | 2e2adb5 | 2019-10-25 17:00:02 | [diff] [blame] | 1116 | // Occasionally DCHECK crashes on canary can be very distuptive. An |
| 1117 | // experimental flag was added to aid in temporarily disabling this for |
| 1118 | // canary testers. |
| 1119 | #if defined(DCHECK_IS_CONFIGURABLE) |
| 1120 | if (experimental_flags::AreDCHECKCrashesDisabled()) { |
| 1121 | std::vector<base::FeatureList::FeatureOverrideInfo> overrides; |
| 1122 | overrides.push_back( |
| 1123 | {std::cref(base::kDCheckIsFatalFeature), |
| 1124 | base::FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE}); |
| 1125 | feature_list->RegisterExtraFeatureOverrides(std::move(overrides)); |
| 1126 | } |
| 1127 | #endif // defined(DCHECK_IS_CONFIGURABLE) |
| 1128 | |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 1129 | return GetGlobalFlagsState().RegisterAllFeatureVariationParameters( |
| 1130 | flags_storage, feature_list); |
jkrcal | bf07337 | 2016-07-29 07:21:31 | [diff] [blame] | 1131 | } |
| 1132 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1133 | void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage, |
| 1134 | flags_ui::FlagAccess access, |
Morten Stenshorne | 7afa580 | 2021-07-15 10:04:43 | [diff] [blame] | 1135 | base::Value::ListStorage& supported_entries, |
| 1136 | base::Value::ListStorage& unsupported_entries) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 1137 | GetGlobalFlagsState().GetFlagFeatureEntries( |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1138 | flags_storage, access, supported_entries, unsupported_entries, |
Renjie Tang | 208c819 | 2020-11-03 00:46:51 | [diff] [blame] | 1139 | base::BindRepeating(&SkipConditionalFeatureEntry)); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1140 | } |
| 1141 | |
| 1142 | void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage, |
| 1143 | const std::string& internal_name, |
| 1144 | bool enable) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 1145 | GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name, |
| 1146 | enable); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1147 | } |
| 1148 | |
| 1149 | void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 1150 | GetGlobalFlagsState().ResetAllFlags(flags_storage); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1151 | } |
| 1152 | |
| 1153 | namespace testing { |
| 1154 | |
Elly Fong-Jones | 323ab109 | 2021-08-23 22:36:31 | [diff] [blame] | 1155 | base::span<const flags_ui::FeatureEntry> GetFeatureEntries() { |
| 1156 | return base::span<const flags_ui::FeatureEntry>(kFeatureEntries, |
| 1157 | base::size(kFeatureEntries)); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 1158 | } |
| 1159 | |
| 1160 | } // namespace testing |