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