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" |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 19 | #include "base/no_destructor.h" |
kokihoon | 189a402 | 2018-10-13 02:43:44 | [diff] [blame] | 20 | #include "base/stl_util.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" |
Robbie Gibson | 5e343663 | 2020-04-27 15:48:04 | [diff] [blame] | 28 | #include "components/content_settings/core/common/features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 29 | #include "components/dom_distiller/core/dom_distiller_switches.h" |
Guillaume Jenkins | 4e6ac1e | 2020-11-11 16:57:40 | [diff] [blame] | 30 | #include "components/enterprise/browser/enterprise_switches.h" |
Tommy Nyquist | c1d6dea1 | 2017-07-26 20:37:23 | [diff] [blame] | 31 | #include "components/feature_engagement/public/feature_constants.h" |
| 32 | #include "components/feature_engagement/public/feature_list.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 33 | #include "components/flags_ui/feature_entry.h" |
| 34 | #include "components/flags_ui/feature_entry_macros.h" |
| 35 | #include "components/flags_ui/flags_storage.h" |
| 36 | #include "components/flags_ui/flags_ui_switches.h" |
sczs | 27e389e | 2020-01-15 15:19:18 | [diff] [blame] | 37 | #include "components/infobars/core/infobar_feature.h" |
Tanja Gornak | b0985dd | 2018-10-11 17:24:40 | [diff] [blame] | 38 | #include "components/invalidation/impl/invalidation_switches.h" |
noyau | 4cfb133 | 2016-10-25 17:05:42 | [diff] [blame] | 39 | #include "components/ntp_tiles/switches.h" |
Justin Donnelly | 33d712e | 2017-08-23 21:32:51 | [diff] [blame] | 40 | #include "components/omnibox/browser/omnibox_field_trial.h" |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 41 | #include "components/omnibox/common/omnibox_features.h" |
Ioana Pandele | d14ce9e | 2017-11-28 14:41:46 | [diff] [blame] | 42 | #include "components/password_manager/core/common/password_manager_features.h" |
mathp | 9b4c11d | 2017-07-06 20:24:13 | [diff] [blame] | 43 | #include "components/payments/core/features.h" |
Guillaume Jenkins | eeb7007c | 2020-06-25 22:55:40 | [diff] [blame] | 44 | #import "components/policy/core/common/policy_loader_ios_constants.h" |
| 45 | #include "components/policy/policy_constants.h" |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 46 | #include "components/security_state/core/features.h" |
Sébastien Séguin-Gagnon | dcb854b | 2019-04-10 16:36:44 | [diff] [blame] | 47 | #include "components/send_tab_to_self/features.h" |
Valeriya Sinevich | a79dc61 | 2018-09-25 14:49:09 | [diff] [blame] | 48 | #include "components/signin/core/browser/account_reconcilor.h" |
Jérôme Lebel | c374fdd | 2019-09-27 10:36:48 | [diff] [blame] | 49 | #include "components/signin/ios/browser/features.h" |
Nohemi Fernandez | 983d6d5 | 2020-09-09 09:46:19 | [diff] [blame] | 50 | #include "components/signin/public/base/account_consistency_method.h" |
Colin Blundell | 3517170e | 2019-07-11 08:16:34 | [diff] [blame] | 51 | #include "components/signin/public/base/signin_switches.h" |
sdefresne | 3657978 | 2016-02-05 11:08:25 | [diff] [blame] | 52 | #include "components/strings/grit/components_strings.h" |
Rushan Suleymanov | 988ad37 | 2020-07-26 19:10:08 | [diff] [blame] | 53 | #include "components/sync/base/sync_base_switches.h" |
Moe Ahmadi | d6d5d17 | 2018-06-20 17:20:23 | [diff] [blame] | 54 | #include "components/sync/driver/sync_driver_switches.h" |
Moe Ahmadi | e4cce1f | 2018-12-18 23:48:01 | [diff] [blame] | 55 | #include "components/translate/core/browser/translate_prefs.h" |
Chris Lu | 0683adf | 2019-02-26 15:56:45 | [diff] [blame] | 56 | #include "components/ukm/ios/features.h" |
Sylvain Defresne | ae6987e | 2018-03-01 13:21:40 | [diff] [blame] | 57 | #include "ios/chrome/browser/browsing_data/browsing_data_features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 58 | #include "ios/chrome/browser/chrome_switches.h" |
Mike Dougherty | b6c770d | 2019-09-13 22:56:46 | [diff] [blame] | 59 | #include "ios/chrome/browser/crash_report/breadcrumbs/features.h" |
Eugene But | 2823dc7e | 2020-07-21 18:10:37 | [diff] [blame] | 60 | #include "ios/chrome/browser/crash_report/features.h" |
Nazerke | 21bdc45a | 2019-07-11 09:02:05 | [diff] [blame] | 61 | #include "ios/chrome/browser/flags/ios_chrome_flag_descriptions.h" |
Ewann | 163e395 | 2020-08-21 12:34:49 | [diff] [blame] | 62 | #import "ios/chrome/browser/open_in/features.h" |
edchin | 6869684 | 2020-04-09 17:19:31 | [diff] [blame] | 63 | #include "ios/chrome/browser/policy/policy_features.h" |
Sylvain Defresne | 9c10708 | 2020-10-27 16:39:13 | [diff] [blame] | 64 | #include "ios/chrome/browser/screen_time/screen_time_buildflags.h" |
Gauthier Ambard | 33e0330 | 2019-02-21 13:28:58 | [diff] [blame] | 65 | #include "ios/chrome/browser/system_flags.h" |
adamta | 22a4d50 | 2020-05-21 03:12:21 | [diff] [blame] | 66 | #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h" |
Kurt Horimoto | 4da682b02 | 2018-04-12 07:43:35 | [diff] [blame] | 67 | #import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h" |
sczs | 80a6f46 | 2018-12-05 20:37:18 | [diff] [blame] | 68 | #import "ios/chrome/browser/ui/infobars/infobar_feature.h" |
adamta | 27356847 | 2020-12-04 23:53:57 | [diff] [blame] | 69 | #import "ios/chrome/browser/ui/ntp/new_tab_page_feature.h" |
Nazerke | 0bf10c4 | 2020-11-12 11:17:32 | [diff] [blame] | 70 | #import "ios/chrome/browser/ui/tab_switcher/tab_grid/features.h" |
sczs | 76b9ba0 | 2019-07-23 23:34:30 | [diff] [blame] | 71 | #import "ios/chrome/browser/ui/table_view/feature_flags.h" |
Kurt Horimoto | 79d590b | 2018-09-12 19:09:28 | [diff] [blame] | 72 | #import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h" |
Justin Cohen | 2d81c58 | 2018-01-22 14:46:44 | [diff] [blame] | 73 | #include "ios/chrome/browser/ui/ui_feature_flags.h" |
Yi Su | 392b303 | 2018-06-05 07:26:47 | [diff] [blame] | 74 | #include "ios/chrome/browser/web/features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 75 | #include "ios/chrome/grit/ios_strings.h" |
msarda | fc76f66 | 2017-02-24 12:46:28 | [diff] [blame] | 76 | #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
Eugene But | 61818bc | 2019-04-15 21:04:07 | [diff] [blame] | 77 | #include "ios/web/common/features.h" |
Eugene But | e79f274 | 2019-07-26 17:07:22 | [diff] [blame] | 78 | #include "ios/web/common/user_agent.h" |
Eugene But | b141623 | 2019-07-22 17:31:58 | [diff] [blame] | 79 | #include "ios/web/common/web_view_creation_util.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 80 | |
Sylvain Defresne | 9c10708 | 2020-10-27 16:39:13 | [diff] [blame] | 81 | #if BUILDFLAG(IOS_SCREEN_TIME_ENABLED) |
| 82 | #include "ios/chrome/browser/screen_time/features.h" |
| 83 | #endif |
| 84 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 85 | #if !defined(OFFICIAL_BUILD) |
| 86 | #include "components/variations/variations_switches.h" |
vitaliii | 489217aa | 2017-01-30 14:50:22 | [diff] [blame] | 87 | #endif |
stkhapugin | c1be179 | 2016-12-13 14:30:53 | [diff] [blame] | 88 | |
| 89 | #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 90 | #error "This file requires ARC support." |
| 91 | #endif |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 92 | |
elawrence | 816f6790e | 2017-06-16 18:19:28 | [diff] [blame] | 93 | using flags_ui::FeatureEntry; |
| 94 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 95 | namespace { |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 96 | |
Olivier Robin | 3d6041162 | 2018-02-23 10:03:22 | [diff] [blame] | 97 | const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = { |
| 98 | {flags_ui::kGenericExperimentChoiceDefault, "", ""}, |
| 99 | {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"}, |
| 100 | {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"}, |
| 101 | {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"}, |
| 102 | {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"}, |
| 103 | {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"}, |
| 104 | {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"}, |
| 105 | {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"}, |
| 106 | {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"}, |
| 107 | }; |
| 108 | |
Nohemi Fernandez | 222d6d4 | 2020-09-30 20:35:57 | [diff] [blame] | 109 | const FeatureEntry::Choice kDelayThresholdMinutesToUpdateGaiaCookieChoices[] = { |
| 110 | {flags_ui::kGenericExperimentChoiceDefault, "", ""}, |
| 111 | {"0", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "0"}, |
| 112 | {"10", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "10"}, |
| 113 | {"60", signin::kDelayThresholdMinutesToUpdateGaiaCookie, "60"}, |
| 114 | }; |
| 115 | |
Ce Chen | c8d803a | 2020-04-27 09:31:33 | [diff] [blame] | 116 | const FeatureEntry::FeatureVariation |
Ce Chen | c8d803a | 2020-04-27 09:31:33 | [diff] [blame] | 117 | kOmniboxOnDeviceHeadSuggestNonIncognitoExperimentVariations[] = { |
| 118 | { |
| 119 | "relevance-1000", |
| 120 | (FeatureEntry::FeatureParam[]){ |
| 121 | {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput, |
| 122 | "1000"}, |
| 123 | {OmniboxFieldTrial::kOnDeviceHeadSuggestDemoteMode, |
| 124 | "decrease-relevances"}}, |
| 125 | 2, |
| 126 | nullptr, |
| 127 | }, |
| 128 | { |
| 129 | "request-delay-100ms", |
| 130 | (FeatureEntry::FeatureParam[]){ |
| 131 | {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs, |
| 132 | "100"}}, |
| 133 | 1, |
| 134 | nullptr, |
| 135 | }, |
| 136 | { |
| 137 | "delay-100ms-relevance-1000", |
| 138 | (FeatureEntry::FeatureParam[]){ |
| 139 | {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs, |
| 140 | "100"}, |
| 141 | {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput, |
| 142 | "1000"}, |
| 143 | {OmniboxFieldTrial::kOnDeviceHeadSuggestDemoteMode, |
| 144 | "decrease-relevances"}}, |
| 145 | 3, |
| 146 | nullptr, |
| 147 | }, |
| 148 | { |
| 149 | "request-delay-200ms", |
| 150 | (FeatureEntry::FeatureParam[]){ |
| 151 | {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs, |
| 152 | "200"}}, |
| 153 | 1, |
| 154 | nullptr, |
| 155 | }, |
| 156 | { |
| 157 | "delay-200ms-relevance-1000", |
| 158 | (FeatureEntry::FeatureParam[]){ |
| 159 | {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs, |
| 160 | "200"}, |
| 161 | {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput, |
| 162 | "1000"}, |
| 163 | {OmniboxFieldTrial::kOnDeviceHeadSuggestDemoteMode, |
| 164 | "decrease-relevances"}}, |
| 165 | 3, |
| 166 | nullptr, |
| 167 | }}; |
Ce Chen | 104a538 | 2019-12-10 01:09:05 | [diff] [blame] | 168 | |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 169 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = { |
| 170 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}}; |
| 171 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = { |
| 172 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}}; |
| 173 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = { |
| 174 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}}; |
| 175 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = { |
| 176 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}}; |
| 177 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = { |
| 178 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}}; |
| 179 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = { |
| 180 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}}; |
| 181 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = { |
| 182 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}}; |
| 183 | |
| 184 | const FeatureEntry::FeatureVariation |
| 185 | kOmniboxUIMaxAutocompleteMatchesVariations[] = { |
| 186 | {"3 matches", kOmniboxUIMaxAutocompleteMatches3, |
| 187 | base::size(kOmniboxUIMaxAutocompleteMatches3), nullptr}, |
| 188 | {"4 matches", kOmniboxUIMaxAutocompleteMatches4, |
| 189 | base::size(kOmniboxUIMaxAutocompleteMatches4), nullptr}, |
| 190 | {"5 matches", kOmniboxUIMaxAutocompleteMatches5, |
| 191 | base::size(kOmniboxUIMaxAutocompleteMatches5), nullptr}, |
| 192 | {"6 matches", kOmniboxUIMaxAutocompleteMatches6, |
| 193 | base::size(kOmniboxUIMaxAutocompleteMatches6), nullptr}, |
| 194 | {"8 matches", kOmniboxUIMaxAutocompleteMatches8, |
| 195 | base::size(kOmniboxUIMaxAutocompleteMatches8), nullptr}, |
| 196 | {"10 matches", kOmniboxUIMaxAutocompleteMatches10, |
| 197 | base::size(kOmniboxUIMaxAutocompleteMatches10), nullptr}, |
| 198 | {"12 matches", kOmniboxUIMaxAutocompleteMatches12, |
| 199 | base::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}}; |
| 200 | |
Caitlin Fischer | 37e0123 | 2019-05-24 13:05:45 | [diff] [blame] | 201 | const FeatureEntry::FeatureParam |
| 202 | kAutofillUseMobileLabelDisambiguationShowAll[] = { |
| 203 | {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName, |
| 204 | autofill::features:: |
| 205 | kAutofillUseMobileLabelDisambiguationParameterShowAll}}; |
| 206 | const FeatureEntry::FeatureParam |
| 207 | kAutofillUseMobileLabelDisambiguationShowOne[] = { |
| 208 | {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName, |
| 209 | autofill::features:: |
| 210 | kAutofillUseMobileLabelDisambiguationParameterShowOne}}; |
| 211 | |
| 212 | const FeatureEntry::FeatureVariation |
| 213 | kAutofillUseMobileLabelDisambiguationVariations[] = { |
| 214 | {"(show all)", kAutofillUseMobileLabelDisambiguationShowAll, |
| 215 | base::size(kAutofillUseMobileLabelDisambiguationShowAll), nullptr}, |
| 216 | {"(show one)", kAutofillUseMobileLabelDisambiguationShowOne, |
| 217 | base::size(kAutofillUseMobileLabelDisambiguationShowOne), nullptr}}; |
| 218 | |
gogerald | db0d8ae | 2020-11-13 03:56:58 | [diff] [blame] | 219 | const FeatureEntry::FeatureParam kDiscoverFeedInNtpEnableNativeUI[] = { |
| 220 | {kDiscoverFeedIsNativeUIEnabled, "true"}}; |
| 221 | const FeatureEntry::FeatureVariation kDiscoverFeedInNtpVariations[] = { |
| 222 | {"Native UI", kDiscoverFeedInNtpEnableNativeUI, |
| 223 | base::size(kDiscoverFeedInNtpEnableNativeUI), nullptr}}; |
| 224 | |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 225 | // To add a new entry, add to the end of kFeatureEntries. There are four |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 226 | // distinct types of entries: |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 227 | // . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the |
| 228 | // default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 229 | // macro for this type supplying the command line to the macro. |
| 230 | // . MULTI_VALUE: a list of choices, the first of which should correspond to a |
| 231 | // deactivated state for this lab (i.e. no command line option). To specify |
| 232 | // this type of entry use the macro MULTI_VALUE_TYPE supplying it the |
| 233 | // array of choices. |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 234 | // . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is |
| 235 | // either enabled, disabled, or uses the default value of the associated |
| 236 | // base::Feature instance. To specify this type of entry use the macro |
| 237 | // FEATURE_VALUE_TYPE supplying it the base::Feature instance. |
| 238 | // . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a |
| 239 | // base::Feature instance. Choices corresponding to the default state, a |
| 240 | // universally enabled state, and a universally disabled state are |
| 241 | // automatically included. To specify this type of entry use the macro |
| 242 | // FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and |
| 243 | // the array of choices. |
| 244 | // |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 245 | // See the documentation of FeatureEntry for details on the fields. |
| 246 | // |
| 247 | // When adding a new choice, add it to the end of the list. |
| 248 | const flags_ui::FeatureEntry kFeatureEntries[] = { |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 249 | {"in-product-help-demo-mode-choice", |
| 250 | flag_descriptions::kInProductHelpDemoModeName, |
| 251 | flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos, |
| 252 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
Tommy Nyquist | c1d6dea1 | 2017-07-26 20:37:23 | [diff] [blame] | 253 | feature_engagement::kIPHDemoMode, |
| 254 | feature_engagement::kIPHDemoModeChoiceVariations, |
Marc Treib | 2752e8b | 2017-08-04 14:12:09 | [diff] [blame] | 255 | "IPH_DemoMode")}, |
Moe Ahmadi | c3fd7cd | 2018-05-11 21:40:22 | [diff] [blame] | 256 | {"enable-autofill-credit-card-upload", |
| 257 | flag_descriptions::kAutofillCreditCardUploadName, |
| 258 | flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos, |
Anne Lim | 579b573 | 2018-08-30 18:24:24 | [diff] [blame] | 259 | FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)}, |
Moe Ahmadi | d6d5d17 | 2018-06-20 17:20:23 | [diff] [blame] | 260 | {"use-sync-sandbox", flag_descriptions::kSyncSandboxName, |
| 261 | flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos, |
| 262 | SINGLE_VALUE_TYPE_AND_VALUE( |
| 263 | switches::kSyncServiceURL, |
| 264 | "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")}, |
| 265 | {"wallet-service-use-sandbox", |
| 266 | flag_descriptions::kWalletServiceUseSandboxName, |
| 267 | flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos, |
| 268 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE( |
| 269 | autofill::switches::kWalletServiceUseSandbox, |
| 270 | "1", |
| 271 | autofill::switches::kWalletServiceUseSandbox, |
| 272 | "0")}, |
Mohamad Ahmadi | c4df81f | 2017-12-20 04:41:59 | [diff] [blame] | 273 | {"show-autofill-type-predictions", |
| 274 | flag_descriptions::kShowAutofillTypePredictionsName, |
| 275 | flag_descriptions::kShowAutofillTypePredictionsDescription, |
| 276 | flags_ui::kOsIos, |
Gauthier Ambard | cfd8518 | 2018-01-05 10:37:46 | [diff] [blame] | 277 | FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)}, |
Olivier Robin | 3d6041162 | 2018-02-23 10:03:22 | [diff] [blame] | 278 | {"autofill-ios-delay-between-fields", |
| 279 | flag_descriptions::kAutofillIOSDelayBetweenFieldsName, |
| 280 | flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription, |
| 281 | flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)}, |
Moe Ahmadi | d3ddfcb | 2018-04-20 19:51:08 | [diff] [blame] | 282 | {"autofill-restrict-formless-form-extraction", |
| 283 | flag_descriptions::kAutofillRestrictUnownedFieldsToFormlessCheckoutName, |
| 284 | flag_descriptions:: |
| 285 | kAutofillRestrictUnownedFieldsToFormlessCheckoutDescription, |
| 286 | flags_ui::kOsIos, |
| 287 | FEATURE_VALUE_TYPE( |
| 288 | autofill::features::kAutofillRestrictUnownedFieldsToFormlessCheckout)}, |
Roger McFarlane | e193ab12 | 2018-11-22 20:55:07 | [diff] [blame] | 289 | {"autofill-rich-metadata-queries", |
| 290 | flag_descriptions::kAutofillRichMetadataQueriesName, |
| 291 | flag_descriptions::kAutofillRichMetadataQueriesDescription, |
| 292 | flags_ui::kOsIos, |
| 293 | FEATURE_VALUE_TYPE(autofill::features::kAutofillRichMetadataQueries)}, |
Kurt Horimoto | dc33af3 | 2018-05-01 01:39:14 | [diff] [blame] | 294 | {"fullscreen-viewport-adjustment-experiment", |
Chris Lu | 481a932 | 2019-09-25 22:16:53 | [diff] [blame] | 295 | flag_descriptions::kFullscreenSmoothScrollingName, |
| 296 | flag_descriptions::kFullscreenSmoothScrollingDescription, flags_ui::kOsIos, |
| 297 | FEATURE_VALUE_TYPE(fullscreen::features::kSmoothScrollingDefault)}, |
Roger McFarlane | 2eceba98 | 2018-05-18 01:37:11 | [diff] [blame] | 298 | {"autofill-cache-query-responses", |
| 299 | flag_descriptions::kAutofillCacheQueryResponsesName, |
| 300 | flag_descriptions::kAutofillCacheQueryResponsesDescription, |
| 301 | flags_ui::kOsIos, |
| 302 | FEATURE_VALUE_TYPE(autofill::features::kAutofillCacheQueryResponses)}, |
Robbie Gibson | 1f37a5e | 2020-08-06 17:03:06 | [diff] [blame] | 303 | {"webpage-default-zoom-from-dynamic-type", |
| 304 | flag_descriptions::kWebPageDefaultZoomFromDynamicTypeName, |
| 305 | flag_descriptions::kWebPageDefaultZoomFromDynamicTypeDescription, |
| 306 | flags_ui::kOsIos, |
| 307 | FEATURE_VALUE_TYPE(web::kWebPageDefaultZoomFromDynamicType)}, |
Yi Su | 392b303 | 2018-06-05 07:26:47 | [diff] [blame] | 308 | {"webpage-text-accessibility", |
| 309 | flag_descriptions::kWebPageTextAccessibilityName, |
| 310 | flag_descriptions::kWebPageTextAccessibilityDescription, flags_ui::kOsIos, |
| 311 | FEATURE_VALUE_TYPE(web::kWebPageTextAccessibility)}, |
Robbie Gibson | 88f2396 | 2020-09-28 14:35:56 | [diff] [blame] | 312 | {"webpage-alternative-text-zoom", |
| 313 | flag_descriptions::kWebPageAlternativeTextZoomName, |
| 314 | flag_descriptions::kWebPageAlternativeTextZoomDescription, |
| 315 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(web::kWebPageAlternativeTextZoom)}, |
Kurt Horimoto | 79d590b | 2018-09-12 19:09:28 | [diff] [blame] | 316 | {"toolbar-container", flag_descriptions::kToolbarContainerName, |
| 317 | flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos, |
| 318 | FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)}, |
Ce Chen | c8d803a | 2020-04-27 09:31:33 | [diff] [blame] | 319 | {"omnibox-on-device-head-suggestions-incognito", |
| 320 | flag_descriptions::kOmniboxOnDeviceHeadSuggestionsIncognitoName, |
| 321 | flag_descriptions::kOmniboxOnDeviceHeadSuggestionsIncognitoDescription, |
Ce Chen | 104a538 | 2019-12-10 01:09:05 | [diff] [blame] | 322 | flags_ui::kOsIos, |
Ce Chen | d565f71f | 2020-08-12 01:15:53 | [diff] [blame] | 323 | FEATURE_VALUE_TYPE(omnibox::kOnDeviceHeadProviderIncognito)}, |
Ce Chen | c8d803a | 2020-04-27 09:31:33 | [diff] [blame] | 324 | {"omnibox-on-device-head-suggestions-non-incognito", |
| 325 | flag_descriptions::kOmniboxOnDeviceHeadSuggestionsNonIncognitoName, |
| 326 | flag_descriptions::kOmniboxOnDeviceHeadSuggestionsNonIncognitoDescription, |
| 327 | flags_ui::kOsIos, |
| 328 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 329 | omnibox::kOnDeviceHeadProviderNonIncognito, |
| 330 | kOmniboxOnDeviceHeadSuggestNonIncognitoExperimentVariations, |
| 331 | "OmniboxOnDeviceHeadSuggestNonIncognitoIOS")}, |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 332 | {"omnibox-ui-max-autocomplete-matches", |
| 333 | flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName, |
| 334 | flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription, |
| 335 | flags_ui::kOsIos, |
| 336 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 337 | omnibox::kUIExperimentMaxAutocompleteMatches, |
| 338 | kOmniboxUIMaxAutocompleteMatchesVariations, |
| 339 | "OmniboxUIMaxAutocompleteVariations")}, |
Robbie Gibson | 84f1ddc | 2020-12-10 21:41:28 | [diff] [blame] | 340 | {"omnibox-local-history-zero-suggest", |
| 341 | flag_descriptions::kOmniboxLocalHistoryZeroSuggestName, |
| 342 | flag_descriptions::kOmniboxLocalHistoryZeroSuggestDescription, |
| 343 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(omnibox::kLocalHistoryZeroSuggest)}, |
sczs | 80a6f46 | 2018-12-05 20:37:18 | [diff] [blame] | 344 | {"infobar-ui-reboot", flag_descriptions::kInfobarUIRebootName, |
| 345 | flag_descriptions::kInfobarUIRebootDescription, flags_ui::kOsIos, |
sczs | 27e389e | 2020-01-15 15:19:18 | [diff] [blame] | 346 | FEATURE_VALUE_TYPE(kIOSInfobarUIReboot)}, |
edchin | 5ae0b4c | 2019-01-06 06:52:28 | [diff] [blame] | 347 | {"snapshot-draw-view", flag_descriptions::kSnapshotDrawViewName, |
| 348 | flag_descriptions::kSnapshotDrawViewDescription, flags_ui::kOsIos, |
| 349 | FEATURE_VALUE_TYPE(kSnapshotDrawView)}, |
Justin Cohen | 20b6f07 | 2019-01-16 01:38:50 | [diff] [blame] | 350 | #if defined(DCHECK_IS_CONFIGURABLE) |
| 351 | {"dcheck-is-fatal", flag_descriptions::kDcheckIsFatalName, |
| 352 | flag_descriptions::kDcheckIsFatalDescription, flags_ui::kOsIos, |
| 353 | FEATURE_VALUE_TYPE(base::kDCheckIsFatalFeature)}, |
| 354 | #endif // defined(DCHECK_IS_CONFIGURABLE) |
Gauthier Ambard | 5f61086 | 2019-01-17 11:43:55 | [diff] [blame] | 355 | {"settings-refresh", flag_descriptions::kSettingsRefreshName, |
| 356 | flag_descriptions::kSettingsRefreshDescription, flags_ui::kOsIos, |
| 357 | FEATURE_VALUE_TYPE(kSettingsRefresh)}, |
Chris Lu | 8153e6e | 2019-03-26 16:28:21 | [diff] [blame] | 358 | {"send-uma-cellular", flag_descriptions::kSendUmaOverAnyNetwork, |
| 359 | flag_descriptions::kSendUmaOverAnyNetworkDescription, flags_ui::kOsIos, |
Chris Lu | 0683adf | 2019-02-26 15:56:45 | [diff] [blame] | 360 | FEATURE_VALUE_TYPE(kUmaCellular)}, |
Caitlin Fischer | 43edd90a | 2019-05-01 13:24:30 | [diff] [blame] | 361 | {"autofill-use-mobile-label-disambiguation", |
| 362 | flag_descriptions::kAutofillUseMobileLabelDisambiguationName, |
| 363 | flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription, |
| 364 | flags_ui::kOsIos, |
Caitlin Fischer | 37e0123 | 2019-05-24 13:05:45 | [diff] [blame] | 365 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 366 | autofill::features::kAutofillUseMobileLabelDisambiguation, |
| 367 | kAutofillUseMobileLabelDisambiguationVariations, |
| 368 | "AutofillUseMobileLabelDisambiguation")}, |
edchin | b5d9258 | 2020-03-11 15:26:11 | [diff] [blame] | 369 | {"autofill-prune-suggestions", |
Caitlin Fischer | 6d60954 | 2019-05-01 21:59:21 | [diff] [blame] | 370 | flag_descriptions::kAutofillPruneSuggestionsName, |
| 371 | flag_descriptions::kAutofillPruneSuggestionsDescription, flags_ui::kOsIos, |
| 372 | FEATURE_VALUE_TYPE(autofill::features::kAutofillPruneSuggestions)}, |
sczs | 76b9ba0 | 2019-07-23 23:34:30 | [diff] [blame] | 373 | {"collections-card-presentation-style", |
| 374 | flag_descriptions::kCollectionsCardPresentationStyleName, |
| 375 | flag_descriptions::kCollectionsCardPresentationStyleDescription, |
| 376 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kCollectionsCardPresentationStyle)}, |
Mike Dougherty | b6c770d | 2019-09-13 22:56:46 | [diff] [blame] | 377 | {"ios-breadcrumbs", flag_descriptions::kLogBreadcrumbsName, |
| 378 | flag_descriptions::kLogBreadcrumbsDescription, flags_ui::kOsIos, |
| 379 | FEATURE_VALUE_TYPE(kLogBreadcrumbs)}, |
Eugene But | 2823dc7e | 2020-07-21 18:10:37 | [diff] [blame] | 380 | {"ios-synthetic-crash-reports", |
| 381 | flag_descriptions::kSyntheticCrashReportsForUteName, |
| 382 | flag_descriptions::kSyntheticCrashReportsForUteDescription, |
| 383 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSyntheticCrashReportsForUte)}, |
Jérôme Lebel | c374fdd | 2019-09-27 10:36:48 | [diff] [blame] | 384 | {"force-startup-signin-promo", |
| 385 | flag_descriptions::kForceStartupSigninPromoName, |
| 386 | flag_descriptions::kForceStartupSigninPromoDescription, flags_ui::kOsIos, |
| 387 | FEATURE_VALUE_TYPE(signin::kForceStartupSigninPromo)}, |
Justin Cohen | c57413a | 2019-09-30 19:42:29 | [diff] [blame] | 388 | {"embedder-block-restore-url", |
| 389 | flag_descriptions::kEmbedderBlockRestoreUrlName, |
| 390 | flag_descriptions::kEmbedderBlockRestoreUrlDescription, flags_ui::kOsIos, |
| 391 | FEATURE_VALUE_TYPE(kEmbedderBlockRestoreUrl)}, |
sczs | 004fa6c | 2019-10-18 17:22:52 | [diff] [blame] | 392 | {"messages-save-card-infobar", |
| 393 | flag_descriptions::kSaveCardInfobarMessagesUIName, |
| 394 | flag_descriptions::kSaveCardInfobarMessagesUIDescription, flags_ui::kOsIos, |
| 395 | FEATURE_VALUE_TYPE(kSaveCardInfobarMessagesUI)}, |
Chris Lu | 4cc111b45 | 2019-10-18 22:18:48 | [diff] [blame] | 396 | {"messages-translate-infobar", |
| 397 | flag_descriptions::kTranslateInfobarMessagesUIName, |
| 398 | flag_descriptions::kTranslateInfobarMessagesUIDescription, |
| 399 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kTranslateInfobarMessagesUI)}, |
sczs | 4622e6e | 2019-11-06 01:17:59 | [diff] [blame] | 400 | {"autofill-save-card-dismiss-on-navigation", |
| 401 | flag_descriptions::kAutofillSaveCardDismissOnNavigationName, |
| 402 | flag_descriptions::kAutofillSaveCardDismissOnNavigationDescription, |
| 403 | flags_ui::kOsIos, |
| 404 | FEATURE_VALUE_TYPE( |
| 405 | autofill::features::kAutofillSaveCardDismissOnNavigation)}, |
Rohit Rao | e7b48931 | 2019-11-12 12:28:55 | [diff] [blame] | 406 | {"force-unstacked-tabstrip", flag_descriptions::kForceUnstackedTabstripName, |
| 407 | flag_descriptions::kForceUnstackedTabstripDescription, flags_ui::kOsIos, |
| 408 | FEATURE_VALUE_TYPE(kForceUnstackedTabstrip)}, |
Gauthier Ambard | 9391400 | 2019-11-14 12:56:12 | [diff] [blame] | 409 | {"use-js-error-page", flag_descriptions::kUseJSForErrorPageName, |
| 410 | flag_descriptions::kUseJSForErrorPageDescription, flags_ui::kOsIos, |
| 411 | FEATURE_VALUE_TYPE(web::features::kUseJSForErrorPage)}, |
Gauthier Ambard | bde9def | 2019-11-19 18:04:33 | [diff] [blame] | 412 | {"desktop-version-default", flag_descriptions::kDefaultToDesktopOnIPadName, |
| 413 | flag_descriptions::kDefaultToDesktopOnIPadDescription, flags_ui::kOsIos, |
Gauthier Ambard | 054175f | 2019-12-16 11:54:09 | [diff] [blame] | 414 | FEATURE_VALUE_TYPE(web::features::kUseDefaultUserAgentInWebClient)}, |
Gauthier Ambard | bde9def | 2019-11-19 18:04:33 | [diff] [blame] | 415 | {"mobile-google-srp", flag_descriptions::kMobileGoogleSRPName, |
| 416 | flag_descriptions::kMobileGoogleSRPDescription, flags_ui::kOsIos, |
| 417 | FEATURE_VALUE_TYPE(web::kMobileGoogleSRP)}, |
Kurt Horimoto | d754e8ec | 2019-12-03 20:54:02 | [diff] [blame] | 418 | {"infobar-overlay-ui", flag_descriptions::kInfobarOverlayUIName, |
| 419 | flag_descriptions::kInfobarOverlayUIDescription, flags_ui::kOsIos, |
| 420 | FEATURE_VALUE_TYPE(kInfobarOverlayUI)}, |
sczs | 391ebba | 2019-12-05 06:59:30 | [diff] [blame] | 421 | {"autofill-save-card-infobar-edit-support", |
| 422 | flag_descriptions::kAutofillSaveCardInfobarEditSupportName, |
| 423 | flag_descriptions::kAutofillSaveCardInfobarEditSupportDescription, |
| 424 | flags_ui::kOsIos, |
| 425 | FEATURE_VALUE_TYPE( |
| 426 | autofill::features::kAutofillSaveCardInfobarEditSupport)}, |
edchin | 6869684 | 2020-04-09 17:19:31 | [diff] [blame] | 427 | {"managed-bookmarks-ios", flag_descriptions::kManagedBookmarksIOSName, |
| 428 | flag_descriptions::kManagedBookmarksIOSDescription, flags_ui::kOsIos, |
| 429 | FEATURE_VALUE_TYPE(kManagedBookmarksIOS)}, |
sczs | 5b8ac5f | 2020-04-17 16:23:20 | [diff] [blame] | 430 | {"infobar-ui-reboot-only-ios13", |
| 431 | flag_descriptions::kInfobarUIRebootOnlyiOS13Name, |
| 432 | flag_descriptions::kInfobarUIRebootOnlyiOS13Description, flags_ui::kOsIos, |
| 433 | FEATURE_VALUE_TYPE(kInfobarUIRebootOnlyiOS13)}, |
edchin | 39d08d6 | 2020-04-20 13:11:24 | [diff] [blame] | 434 | {"edit-bookmarks-ios", flag_descriptions::kEditBookmarksIOSName, |
| 435 | flag_descriptions::kEditBookmarksIOSDescription, flags_ui::kOsIos, |
| 436 | FEATURE_VALUE_TYPE(kEditBookmarksIOS)}, |
Mike Dougherty | 76838950 | 2020-04-21 08:28:35 | [diff] [blame] | 437 | {"url-blocklist-ios", flag_descriptions::kURLBlocklistIOSName, |
| 438 | flag_descriptions::kURLBlocklistIOSDescription, flags_ui::kOsIos, |
| 439 | FEATURE_VALUE_TYPE(kURLBlocklistIOS)}, |
siashah | 0a38622 | 2020-04-23 03:31:35 | [diff] [blame] | 440 | {"autofill-enable-google-issued-card", |
| 441 | flag_descriptions::kAutofillEnableGoogleIssuedCardName, |
| 442 | flag_descriptions::kAutofillEnableGoogleIssuedCardDescription, |
| 443 | flags_ui::kOsIos, |
| 444 | FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableGoogleIssuedCard)}, |
Siyu An | d1f86e2 | 2020-05-13 20:35:16 | [diff] [blame] | 445 | {"autofill-enable-card-nickname-management", |
| 446 | flag_descriptions::kAutofillEnableCardNicknameManagementName, |
| 447 | flag_descriptions::kAutofillEnableCardNicknameManagementDescription, |
| 448 | flags_ui::kOsIos, |
| 449 | FEATURE_VALUE_TYPE( |
| 450 | autofill::features::kAutofillEnableCardNicknameManagement)}, |
Tina Wang | 52aea19d | 2020-05-15 16:47:33 | [diff] [blame] | 451 | {"enable-ios-managed-settings-ui", |
| 452 | flag_descriptions::kEnableIOSManagedSettingsUIName, |
| 453 | flag_descriptions::kEnableIOSManagedSettingsUIDescription, |
| 454 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableIOSManagedSettingsUI)}, |
Sean Harrison | 0ada3b08 | 2020-05-18 19:07:51 | [diff] [blame] | 455 | {"safety-check-ios", flag_descriptions::kSafetyCheckIOSName, |
| 456 | flag_descriptions::kSafetyCheckIOSDescription, flags_ui::kOsIos, |
| 457 | FEATURE_VALUE_TYPE(kSafetyCheckIOS)}, |
sczs | 37d9c13 | 2020-07-18 06:06:33 | [diff] [blame] | 458 | {"new-content-suggestions-feed", flag_descriptions::kDiscoverFeedInNtpName, |
adamta | 22a4d50 | 2020-05-21 03:12:21 | [diff] [blame] | 459 | flag_descriptions::kDiscoverFeedInNtpDescription, flags_ui::kOsIos, |
gogerald | db0d8ae | 2020-11-13 03:56:58 | [diff] [blame] | 460 | FEATURE_WITH_PARAMS_VALUE_TYPE(kDiscoverFeedInNtp, |
| 461 | kDiscoverFeedInNtpVariations, |
| 462 | "IOSDiscoverFeed")}, |
adamta | 27356847 | 2020-12-04 23:53:57 | [diff] [blame] | 463 | {"refactored-ntp", flag_descriptions::kRefactoredNTPName, |
| 464 | flag_descriptions::kRefactoredNTPDescription, flags_ui::kOsIos, |
| 465 | FEATURE_VALUE_TYPE(kRefactoredNTP)}, |
Siyu An | 6ca4cdb | 2020-05-29 20:56:17 | [diff] [blame] | 466 | {"autofill-enable-card-nickname-upstream", |
| 467 | flag_descriptions::kAutofillEnableCardNicknameUpstreamName, |
| 468 | flag_descriptions::kAutofillEnableCardNicknameUpstreamDescription, |
| 469 | flags_ui::kOsIos, |
| 470 | FEATURE_VALUE_TYPE( |
| 471 | autofill::features::kAutofillEnableCardNicknameUpstream)}, |
Maxime Charland | 425d9b4 | 2020-06-01 19:47:21 | [diff] [blame] | 472 | {"illustrated-empty-states", flag_descriptions::kIllustratedEmptyStatesName, |
| 473 | flag_descriptions::kIllustratedEmptyStatesDescription, flags_ui::kOsIos, |
| 474 | FEATURE_VALUE_TYPE(kIllustratedEmptyStates)}, |
Sebastien Lalancette | 414fc1ce | 2020-06-11 14:43:06 | [diff] [blame] | 475 | {"enable-native-context-menus", |
| 476 | flag_descriptions::kEnableNativeContextMenusName, |
| 477 | flag_descriptions::kEnableNativeContextMenusDescription, flags_ui::kOsIos, |
| 478 | FEATURE_VALUE_TYPE(kEnableNativeContextMenus)}, |
Roberto Moura | b87b972 | 2020-06-17 17:12:09 | [diff] [blame] | 479 | {"expanded-tab-strip", flag_descriptions::kExpandedTabStripName, |
| 480 | flag_descriptions::kExpandedTabStripDescription, flags_ui::kOsIos, |
| 481 | FEATURE_VALUE_TYPE(kExpandedTabStrip)}, |
Ben Blake | 14592fe | 2020-06-16 15:34:38 | [diff] [blame] | 482 | {"autofill-enable-offers-in-downstream", |
| 483 | flag_descriptions::kAutofillEnableOffersInDownstreamName, |
| 484 | flag_descriptions::kAutofillEnableOffersInDownstreamDescription, |
| 485 | flags_ui::kOsIos, |
| 486 | FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableOffersInDownstream)}, |
Tommy Martino | 6b4eb7e | 2020-06-25 18:25:41 | [diff] [blame] | 487 | {"shared-highlighting-ios", flag_descriptions::kSharedHighlightingIOSName, |
| 488 | flag_descriptions::kSharedHighlightingIOSDescription, flags_ui::kOsIos, |
| 489 | FEATURE_VALUE_TYPE(kSharedHighlightingIOS)}, |
Julian Mentasti-Meza | 4c0a416 | 2020-07-20 18:51:41 | [diff] [blame] | 490 | {"enable-fullpage-screenshot", |
| 491 | flag_descriptions::kEnableFullPageScreenshotName, |
| 492 | flag_descriptions::kEnableFullPageScreenshotDescription, flags_ui::kOsIos, |
| 493 | FEATURE_VALUE_TYPE(kEnableFullPageScreenshot)}, |
Tommy Martino | 4012467 | 2020-07-31 17:29:44 | [diff] [blame] | 494 | {"scroll-to-text-ios", flag_descriptions::kScrollToTextIOSName, |
| 495 | flag_descriptions::kScrollToTextIOSDescription, flags_ui::kOsIos, |
| 496 | FEATURE_VALUE_TYPE(web::features::kScrollToTextIOS)}, |
Chris Thompson | 40cbb16 | 2020-08-04 23:22:15 | [diff] [blame] | 497 | {"legacy-tls-interstitial", |
| 498 | flag_descriptions::kIOSLegacyTLSInterstitialsName, |
| 499 | flag_descriptions::kIOSLegacyTLSInterstitialsDescription, flags_ui::kOsIos, |
| 500 | FEATURE_VALUE_TYPE(web::features::kIOSLegacyTLSInterstitial)}, |
Ewann | 163e395 | 2020-08-21 12:34:49 | [diff] [blame] | 501 | {"extend-open-in-files-support", |
| 502 | flag_descriptions::kExtendOpenInFilesSupportName, |
| 503 | flag_descriptions::kExtendOpenInFilesSupportDescription, flags_ui::kOsIos, |
| 504 | FEATURE_VALUE_TYPE(kExtendOpenInFilesSupport)}, |
Ewann | e1ffc6d | 2020-09-01 07:56:13 | [diff] [blame] | 505 | {"enable-close-all-tabs-confirmation", |
| 506 | flag_descriptions::kEnableCloseAllTabsConfirmationName, |
| 507 | flag_descriptions::kEnableCloseAllTabsConfirmationDescription, |
| 508 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableCloseAllTabsConfirmation)}, |
Sylvain Defresne | 9c10708 | 2020-10-27 16:39:13 | [diff] [blame] | 509 | #if BUILDFLAG(IOS_SCREEN_TIME_ENABLED) |
edchin | 81467b8 | 2020-09-03 19:31:45 | [diff] [blame] | 510 | {"screen-time-integration-ios", |
| 511 | flag_descriptions::kScreenTimeIntegrationName, |
| 512 | flag_descriptions::kScreenTimeIntegrationDescription, flags_ui::kOsIos, |
| 513 | FEATURE_VALUE_TYPE(kScreenTimeIntegration)}, |
Sylvain Defresne | 9c10708 | 2020-10-27 16:39:13 | [diff] [blame] | 514 | #endif |
Nohemi Fernandez | 983d6d5 | 2020-09-09 09:46:19 | [diff] [blame] | 515 | {"mobile-identity-consistency", |
| 516 | flag_descriptions::kMobileIdentityConsistencyName, |
| 517 | flag_descriptions::kMobileIdentityConsistencyDescription, flags_ui::kOsIos, |
| 518 | FEATURE_VALUE_TYPE(signin::kMobileIdentityConsistency)}, |
Gauthier Ambard | a1d88a0 | 2020-09-14 11:46:37 | [diff] [blame] | 519 | {"default-browser-setting", flag_descriptions::kDefaultBrowserSettingsName, |
| 520 | flag_descriptions::kDefaultBrowserSettingsDescription, flags_ui::kOsIos, |
| 521 | FEATURE_VALUE_TYPE(kDefaultBrowserSettings)}, |
Nazerke | 3e993f7 | 2020-09-21 13:00:06 | [diff] [blame] | 522 | {"modern-tab-strip", flag_descriptions::kModernTabStripName, |
| 523 | flag_descriptions::kModernTabStripDescription, flags_ui::kOsIos, |
| 524 | FEATURE_VALUE_TYPE(kModernTabStrip)}, |
Maria Kazinova | d4e2ed7 | 2020-09-22 17:40:50 | [diff] [blame] | 525 | {"autofill-use-renderer-ids", |
| 526 | flag_descriptions::kAutofillUseRendererIDsName, |
| 527 | flag_descriptions::kAutofillUseRendererIDsDescription, flags_ui::kOsIos, |
| 528 | FEATURE_VALUE_TYPE( |
| 529 | autofill::features::kAutofillUseUniqueRendererIDsOnIOS)}, |
Nohemi Fernandez | 70452749 | 2020-09-23 14:00:08 | [diff] [blame] | 530 | {"restore-gaia-cookies-if-deleted", |
| 531 | flag_descriptions::kRestoreGaiaCookiesIfDeletedName, |
| 532 | flag_descriptions::kRestoreGaiaCookiesIfDeletedDescription, |
| 533 | flags_ui::kOsIos, |
| 534 | FEATURE_VALUE_TYPE(signin::kRestoreGaiaCookiesIfDeleted)}, |
Nohemi Fernandez | 7af63ca2 | 2020-12-11 13:06:40 | [diff] [blame] | 535 | {"restore-gaia-cookies-on-user-action", |
| 536 | flag_descriptions::kRestoreGaiaCookiesOnUserActionName, |
| 537 | flag_descriptions::kRestoreGaiaCookiesOnUserActionDescription, |
| 538 | flags_ui::kOsIos, |
| 539 | FEATURE_VALUE_TYPE(signin::kRestoreGaiaCookiesOnUserAction)}, |
Nohemi Fernandez | 14a80f7 | 2020-11-09 13:01:04 | [diff] [blame] | 540 | {"use-username-for-signin-notification-infobar-title", |
| 541 | flag_descriptions::kSigninNotificationInfobarUsernameInTitleName, |
| 542 | flag_descriptions::kSigninNotificationInfobarUsernameInTitleDescription, |
| 543 | flags_ui::kOsIos, |
| 544 | FEATURE_VALUE_TYPE(signin::kSigninNotificationInfobarUsernameInTitle)}, |
Nohemi Fernandez | 222d6d4 | 2020-09-30 20:35:57 | [diff] [blame] | 545 | {"minutes-delay-to-restore-gaia-cookies-if-deleted", |
| 546 | flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieName, |
| 547 | flag_descriptions::kDelayThresholdMinutesToUpdateGaiaCookieDescription, |
| 548 | flags_ui::kOsIos, |
| 549 | MULTI_VALUE_TYPE(kDelayThresholdMinutesToUpdateGaiaCookieChoices)}, |
Viktor Semeniuk | d932ff5 | 2020-10-13 13:10:17 | [diff] [blame] | 550 | {"edit-passwords-in-settings", |
| 551 | flag_descriptions::kEditPasswordsInSettingsName, |
| 552 | flag_descriptions::kEditPasswordsInSettingsDescription, flags_ui::kOsIos, |
| 553 | FEATURE_VALUE_TYPE(password_manager::features::kEditPasswordsInSettings)}, |
Stepan Khapugin | ddb8596 | 2020-10-21 11:49:58 | [diff] [blame] | 554 | {"enable-incognito-authentication-ios", |
| 555 | flag_descriptions::kIncognitoAuthenticationName, |
| 556 | flag_descriptions::kIncognitoAuthenticationDescription, flags_ui::kOsIos, |
| 557 | FEATURE_VALUE_TYPE(kIncognitoAuthentication)}, |
Tina Wang | ff4ac85 | 2020-11-24 18:46:46 | [diff] [blame] | 558 | {"enable-incognito-mode-availability-ios", |
| 559 | flag_descriptions::kEnableIncognitoModeAvailabilityIOSName, |
| 560 | flag_descriptions::kEnableIncognitoModeAvailabilityIOSDescription, |
| 561 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kEnableIncognitoModeAvailabilityIOS)}, |
Gauthier Ambard | cb6a0ccc | 2020-10-30 13:12:00 | [diff] [blame] | 562 | {"web-view-native-context-menu", |
| 563 | flag_descriptions::kWebViewNativeContextMenuName, |
| 564 | flag_descriptions::kWebViewNativeContextMenuDescription, flags_ui::kOsIos, |
| 565 | FEATURE_VALUE_TYPE(web::features::kWebViewNativeContextMenu)}, |
Chris Lu | 4b15abc | 2020-11-09 20:19:19 | [diff] [blame] | 566 | {"location-permissions-prompt", |
| 567 | flag_descriptions::kLocationPermissionsPromptName, |
| 568 | flag_descriptions::kLocationPermissionsPromptDescription, flags_ui::kOsIos, |
| 569 | FEATURE_VALUE_TYPE(kLocationPermissionsPrompt)}, |
Eugene But | f869bff | 2020-12-10 01:16:55 | [diff] [blame] | 570 | {"record-snapshot-size", flag_descriptions::kRecordSnapshotSizeName, |
| 571 | flag_descriptions::kRecordSnapshotSizeDescription, flags_ui::kOsIos, |
| 572 | FEATURE_VALUE_TYPE(web::features::kRecordSnapshotSize)}, |
Chris Lu | b17195f | 2020-12-10 20:49:14 | [diff] [blame] | 573 | {"default-browser-fullscreen-promo-experiment", |
| 574 | flag_descriptions::kDefaultBrowserFullscreenPromoExperimentName, |
| 575 | flag_descriptions::kDefaultBrowserFullscreenPromoExperimentDescription, |
| 576 | flags_ui::kOsIos, |
| 577 | FEATURE_VALUE_TYPE(kDefaultBrowserFullscreenPromoExperiment)}, |
Cheick Cisse | 76ade3d | 2020-12-16 00:15:11 | [diff] [blame] | 578 | {"ios-shared-highlighting-color-change", |
| 579 | flag_descriptions::kIOSSharedHighlightingColorChangeName, |
| 580 | flag_descriptions::kIOSSharedHighlightingColorChangeDescription, |
| 581 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kIOSSharedHighlightingColorChange)}, |
Chris Lu | 07e3277 | 2020-12-30 01:54:44 | [diff] [blame] | 582 | {"ios-persist-crash-restore-infobar", |
| 583 | flag_descriptions::kIOSPersistCrashRestoreName, |
| 584 | flag_descriptions::kIOSPersistCrashRestoreDescription, flags_ui::kOsIos, |
| 585 | FEATURE_VALUE_TYPE(kIOSPersistCrashRestore)}, |
Viktor Semeniuk | 61177b33 | 2021-01-05 12:48:19 | [diff] [blame] | 586 | {"change-password-affiliation", |
| 587 | flag_descriptions::kChangePasswordAffiliationInfoName, |
| 588 | flag_descriptions::kChangePasswordAffiliationInfoDescription, |
| 589 | flags_ui::kOsIos, |
| 590 | FEATURE_VALUE_TYPE( |
| 591 | password_manager::features::kChangePasswordAffiliationInfo)}, |
| 592 | {"use-of-hash-affiliation-fetcher", |
| 593 | flag_descriptions::kUseOfHashAffiliationFetcherName, |
| 594 | flag_descriptions::kUseOfHashAffiliationFetcherDescription, |
| 595 | flags_ui::kOsIos, |
| 596 | FEATURE_VALUE_TYPE( |
| 597 | password_manager::features::kUseOfHashAffiliationFetcher)}, |
Stepan Khapugin | 0434120 | 2021-01-07 12:22:45 | [diff] [blame^] | 598 | {"omnibox-new-textfield-implementation", |
| 599 | flag_descriptions::kOmniboxNewImplementationName, |
| 600 | flag_descriptions::kOmniboxNewImplementationDescription, flags_ui::kOsIos, |
| 601 | FEATURE_VALUE_TYPE(kIOSNewOmniboxImplementation)}, |
Gauthier Ambard | e813c07f | 2020-01-09 10:18:49 | [diff] [blame] | 602 | }; |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 603 | |
Rohit Rao | bed794c | 2020-04-27 15:27:45 | [diff] [blame] | 604 | bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) { |
| 605 | return false; |
| 606 | } |
| 607 | |
| 608 | flags_ui::FlagsState& GetGlobalFlagsState() { |
| 609 | static base::NoDestructor<flags_ui::FlagsState> flags_state(kFeatureEntries, |
| 610 | nullptr); |
| 611 | return *flags_state; |
| 612 | } |
| 613 | } // namespace |
| 614 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 615 | // Add all switches from experimental flags to |command_line|. |
| 616 | void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) { |
| 617 | NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
| 618 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 619 | // Set the UA flag if UseMobileSafariUA is enabled. |
| 620 | if ([defaults boolForKey:@"UseMobileSafariUA"]) { |
| 621 | // Safari uses "Vesion/", followed by the OS version excluding bugfix, where |
| 622 | // Chrome puts its product token. |
avi | 57194367 | 2015-12-22 02:12:49 | [diff] [blame] | 623 | int32_t major = 0; |
| 624 | int32_t minor = 0; |
| 625 | int32_t bugfix = 0; |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 626 | base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); |
| 627 | std::string product = base::StringPrintf("Version/%d.%d", major, minor); |
| 628 | |
Gauthier Ambard | ba163d4 | 2020-05-27 14:48:17 | [diff] [blame] | 629 | command_line->AppendSwitchASCII(switches::kUserAgent, |
| 630 | web::BuildMobileUserAgent(product)); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 631 | } |
| 632 | |
Guillaume Jenkins | 25e9bd7 | 2020-08-27 17:39:06 | [diff] [blame] | 633 | // Shared variables for all enterprise experimental flags. |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 634 | NSMutableDictionary* testing_policies = [[NSMutableDictionary alloc] init]; |
Guillaume Jenkins | 25e9bd7 | 2020-08-27 17:39:06 | [diff] [blame] | 635 | NSMutableArray* allowed_experimental_policies = [[NSMutableArray alloc] init]; |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 636 | |
Guillaume Jenkins | 25e9bd7 | 2020-08-27 17:39:06 | [diff] [blame] | 637 | // Set some sample policy values for testing if EnableSamplePolicies is set to |
| 638 | // true. |
Guillaume Jenkins | eeb7007c | 2020-06-25 22:55:40 | [diff] [blame] | 639 | if ([defaults boolForKey:@"EnableSamplePolicies"]) { |
Guillaume Jenkins | 25e9bd7 | 2020-08-27 17:39:06 | [diff] [blame] | 640 | // Some of the sample policies are still marked as experimental and must be |
| 641 | // explicitly allowed, otherwise they will be ignored in Beta and Stable. |
| 642 | [allowed_experimental_policies addObjectsFromArray:@[ |
Tina Wang | 59d0b7e | 2020-08-11 04:41:01 | [diff] [blame] | 643 | base::SysUTF8ToNSString(policy::key::kAutofillAddressEnabled), |
Sébastien Séguin-Gagnon | c107b1f | 2020-07-02 21:43:58 | [diff] [blame] | 644 | base::SysUTF8ToNSString(policy::key::kAutofillCreditCardEnabled), |
| 645 | base::SysUTF8ToNSString(policy::key::kChromeVariations), |
| 646 | base::SysUTF8ToNSString(policy::key::kDefaultPopupsSetting), |
Tina Wang | 5abee80 | 2020-07-29 23:09:52 | [diff] [blame] | 647 | base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderEnabled), |
| 648 | base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderName), |
| 649 | base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderSearchURL), |
Tina Wang | 89068c8 | 2020-10-29 15:51:50 | [diff] [blame] | 650 | base::SysUTF8ToNSString(policy::key::kEditBookmarksEnabled), |
Tina Wang | 59d0b7e | 2020-08-11 04:41:01 | [diff] [blame] | 651 | base::SysUTF8ToNSString(policy::key::kPasswordManagerEnabled), |
Tina Wang | 54dddfc2 | 2020-08-20 22:34:53 | [diff] [blame] | 652 | base::SysUTF8ToNSString(policy::key::kSafeBrowsingProtectionLevel), |
| 653 | base::SysUTF8ToNSString(policy::key::kSearchSuggestEnabled), |
Tina Wang | 59d0b7e | 2020-08-11 04:41:01 | [diff] [blame] | 654 | base::SysUTF8ToNSString(policy::key::kTranslateEnabled) |
Guillaume Jenkins | 25e9bd7 | 2020-08-27 17:39:06 | [diff] [blame] | 655 | ]]; |
Sébastien Séguin-Gagnon | c107b1f | 2020-07-02 21:43:58 | [diff] [blame] | 656 | |
| 657 | // Define sample policies to enable. |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 658 | [testing_policies addEntriesFromDictionary:@{ |
Tina Wang | 59d0b7e | 2020-08-11 04:41:01 | [diff] [blame] | 659 | base::SysUTF8ToNSString(policy::key::kAutofillAddressEnabled) : @NO, |
| 660 | |
Guillaume Jenkins | eeb7007c | 2020-06-25 22:55:40 | [diff] [blame] | 661 | base::SysUTF8ToNSString(policy::key::kAutofillCreditCardEnabled) : @NO, |
| 662 | |
| 663 | // 2 = Disable all variations |
| 664 | base::SysUTF8ToNSString(policy::key::kChromeVariations) : @2, |
| 665 | |
| 666 | // 2 = Do not allow any site to show popups |
| 667 | base::SysUTF8ToNSString(policy::key::kDefaultPopupsSetting) : @2, |
| 668 | |
Tina Wang | 5abee80 | 2020-07-29 23:09:52 | [diff] [blame] | 669 | // Set default search engine. |
| 670 | base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderEnabled) : |
| 671 | @YES, |
| 672 | base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderSearchURL) : |
| 673 | @"http://www.google.com/search?q={searchTerms}", |
| 674 | base::SysUTF8ToNSString(policy::key::kDefaultSearchProviderName) : |
Tina Wang | 7cd0a06 | 2020-09-15 21:31:02 | [diff] [blame] | 675 | @"TestEngine", |
Tina Wang | 5abee80 | 2020-07-29 23:09:52 | [diff] [blame] | 676 | |
Tina Wang | 89068c8 | 2020-10-29 15:51:50 | [diff] [blame] | 677 | base::SysUTF8ToNSString(policy::key::kEditBookmarksEnabled) : @NO, |
| 678 | |
Guillaume Jenkins | eeb7007c | 2020-06-25 22:55:40 | [diff] [blame] | 679 | base::SysUTF8ToNSString(policy::key::kPasswordManagerEnabled) : @NO, |
Tina Wang | 59d0b7e | 2020-08-11 04:41:01 | [diff] [blame] | 680 | |
| 681 | base::SysUTF8ToNSString(policy::key::kTranslateEnabled) : @NO, |
Tina Wang | 54dddfc2 | 2020-08-20 22:34:53 | [diff] [blame] | 682 | |
| 683 | // 2 = Enhanced safe browsing protection |
| 684 | base::SysUTF8ToNSString(policy::key::kSafeBrowsingProtectionLevel) : @2, |
| 685 | |
| 686 | base::SysUTF8ToNSString(policy::key::kSearchSuggestEnabled) : @YES, |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 687 | }]; |
| 688 | } |
| 689 | |
| 690 | // If a CBCM enrollment token is provided, force Chrome Browser Cloud |
Guillaume Jenkins | 25e9bd7 | 2020-08-27 17:39:06 | [diff] [blame] | 691 | // Management to enabled, add the token to the list of policies, and allow |
| 692 | // the CloudReportingEnabled experimental policy. |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 693 | NSString* token_key = |
| 694 | base::SysUTF8ToNSString(policy::key::kCloudManagementEnrollmentToken); |
| 695 | NSString* token = [defaults stringForKey:token_key]; |
| 696 | |
| 697 | if ([token length] > 0) { |
| 698 | command_line->AppendSwitch(switches::kEnableChromeBrowserCloudManagement); |
Guillaume Jenkins | 25e9bd7 | 2020-08-27 17:39:06 | [diff] [blame] | 699 | [allowed_experimental_policies |
| 700 | addObject:base::SysUTF8ToNSString(policy::key::kCloudReportingEnabled)]; |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 701 | [testing_policies setValue:token forKey:token_key]; |
| 702 | } |
| 703 | |
Guillaume Jenkins | 25e9bd7 | 2020-08-27 17:39:06 | [diff] [blame] | 704 | // If any experimental policy was allowed, set the EnableExperimentalPolicies |
| 705 | // policy. |
| 706 | if ([allowed_experimental_policies count] > 0) { |
| 707 | [testing_policies setValue:allowed_experimental_policies |
| 708 | forKey:base::SysUTF8ToNSString( |
| 709 | policy::key::kEnableExperimentalPolicies)]; |
| 710 | } |
| 711 | |
Guillaume Jenkins | 57606d7 | 2020-08-13 17:32:55 | [diff] [blame] | 712 | // If some policies were set, commit them to the app's registration defaults. |
| 713 | if ([testing_policies count] > 0) { |
Guillaume Jenkins | eeb7007c | 2020-06-25 22:55:40 | [diff] [blame] | 714 | NSDictionary* registration_defaults = |
| 715 | @{kPolicyLoaderIOSConfigurationKey : testing_policies}; |
| 716 | [defaults registerDefaults:registration_defaults]; |
| 717 | } |
| 718 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 719 | // Freeform commandline flags. These are added last, so that any flags added |
| 720 | // earlier in this function take precedence. |
| 721 | if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) { |
| 722 | base::CommandLine::StringVector flags; |
| 723 | // Append an empty "program" argument. |
| 724 | flags.push_back(""); |
| 725 | |
| 726 | // The number of flags corresponds to the number of text fields in |
| 727 | // Experimental.plist. |
| 728 | const int kNumFreeformFlags = 5; |
| 729 | for (int i = 1; i <= kNumFreeformFlags; ++i) { |
| 730 | NSString* key = |
| 731 | [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i]; |
| 732 | NSString* flag = [defaults stringForKey:key]; |
| 733 | if ([flag length]) { |
Robbie Gibson | c91ce62 | 2019-05-20 14:44:33 | [diff] [blame] | 734 | // iOS keyboard replaces -- with —, so undo that. |
| 735 | flag = [flag stringByReplacingOccurrencesOfString:@"—" |
| 736 | withString:@"--" |
| 737 | options:0 |
| 738 | range:NSMakeRange(0, 1)]; |
| 739 | // To make things easier, allow flags with no dashes by prepending them |
| 740 | // here. This also allows for flags that just have one dash if they |
| 741 | // exist. |
| 742 | if (![flag hasPrefix:@"-"]) { |
| 743 | flag = [@"--" stringByAppendingString:flag]; |
| 744 | } |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 745 | flags.push_back(base::SysNSStringToUTF8(flag)); |
| 746 | } |
| 747 | } |
| 748 | |
| 749 | base::CommandLine temp_command_line(flags); |
| 750 | command_line->AppendArguments(temp_command_line, false); |
| 751 | } |
msarda | fc76f66 | 2017-02-24 12:46:28 | [diff] [blame] | 752 | |
justincohen | dacc85d | 2017-06-28 23:34:10 | [diff] [blame] | 753 | // Populate command line flag for 3rd party keyboard omnibox workaround. |
| 754 | NSString* enableThirdPartyKeyboardWorkaround = |
| 755 | [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"]; |
| 756 | if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) { |
| 757 | command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround); |
| 758 | } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) { |
| 759 | command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround); |
| 760 | } |
| 761 | |
msarda | fc76f66 | 2017-02-24 12:46:28 | [diff] [blame] | 762 | ios::GetChromeBrowserProvider()->AppendSwitchesFromExperimentalSettings( |
| 763 | defaults, command_line); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 764 | } |
| 765 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 766 | void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage, |
| 767 | base::CommandLine* command_line) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 768 | GetGlobalFlagsState().ConvertFlagsToSwitches( |
sdefresne | c976390 | 2015-12-02 10:30:11 | [diff] [blame] | 769 | flags_storage, command_line, flags_ui::kAddSentinels, |
Gregory Chatzinoff | f652372 | 2017-11-21 01:33:53 | [diff] [blame] | 770 | switches::kEnableFeatures, switches::kDisableFeatures); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 771 | } |
| 772 | |
jkrcal | bf07337 | 2016-07-29 07:21:31 | [diff] [blame] | 773 | std::vector<std::string> RegisterAllFeatureVariationParameters( |
| 774 | flags_ui::FlagsStorage* flags_storage, |
| 775 | base::FeatureList* feature_list) { |
Justin Cohen | 2e2adb5 | 2019-10-25 17:00:02 | [diff] [blame] | 776 | // Occasionally DCHECK crashes on canary can be very distuptive. An |
| 777 | // experimental flag was added to aid in temporarily disabling this for |
| 778 | // canary testers. |
| 779 | #if defined(DCHECK_IS_CONFIGURABLE) |
| 780 | if (experimental_flags::AreDCHECKCrashesDisabled()) { |
| 781 | std::vector<base::FeatureList::FeatureOverrideInfo> overrides; |
| 782 | overrides.push_back( |
| 783 | {std::cref(base::kDCheckIsFatalFeature), |
| 784 | base::FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE}); |
| 785 | feature_list->RegisterExtraFeatureOverrides(std::move(overrides)); |
| 786 | } |
| 787 | #endif // defined(DCHECK_IS_CONFIGURABLE) |
| 788 | |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 789 | return GetGlobalFlagsState().RegisterAllFeatureVariationParameters( |
| 790 | flags_storage, feature_list); |
jkrcal | bf07337 | 2016-07-29 07:21:31 | [diff] [blame] | 791 | } |
| 792 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 793 | void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage, |
| 794 | flags_ui::FlagAccess access, |
| 795 | base::ListValue* supported_entries, |
| 796 | base::ListValue* unsupported_entries) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 797 | GetGlobalFlagsState().GetFlagFeatureEntries( |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 798 | flags_storage, access, supported_entries, unsupported_entries, |
Renjie Tang | 208c819 | 2020-11-03 00:46:51 | [diff] [blame] | 799 | base::BindRepeating(&SkipConditionalFeatureEntry)); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 800 | } |
| 801 | |
| 802 | void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage, |
| 803 | const std::string& internal_name, |
| 804 | bool enable) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 805 | GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name, |
| 806 | enable); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 807 | } |
| 808 | |
| 809 | void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 810 | GetGlobalFlagsState().ResetAllFlags(flags_storage); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 811 | } |
| 812 | |
| 813 | namespace testing { |
| 814 | |
| 815 | const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) { |
kokihoon | 189a402 | 2018-10-13 02:43:44 | [diff] [blame] | 816 | *count = base::size(kFeatureEntries); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 817 | return kFeatureEntries; |
| 818 | } |
| 819 | |
| 820 | } // namespace testing |