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" |
| 16 | #include "base/command_line.h" |
| 17 | #include "base/logging.h" |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 18 | #include "base/no_destructor.h" |
kokihoon | 189a402 | 2018-10-13 02:43:44 | [diff] [blame] | 19 | #include "base/stl_util.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 20 | #include "base/strings/stringprintf.h" |
| 21 | #include "base/strings/sys_string_conversions.h" |
Sebastien Marchand | 75a7cdf | 2018-11-13 23:47:03 | [diff] [blame] | 22 | #include "base/system/sys_info.h" |
Mohamad Ahmadi | c4df81f | 2017-12-20 04:41:59 | [diff] [blame] | 23 | #include "components/autofill/core/common/autofill_features.h" |
Jared Saul | d998539f | 2019-03-19 15:11:17 | [diff] [blame] | 24 | #include "components/autofill/core/common/autofill_payments_features.h" |
Moe Ahmadi | d6d5d17 | 2018-06-20 17:20:23 | [diff] [blame] | 25 | #include "components/autofill/core/common/autofill_switches.h" |
Olivier Robin | 3d6041162 | 2018-02-23 10:03:22 | [diff] [blame] | 26 | #include "components/autofill/ios/browser/autofill_switches.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 27 | #include "components/dom_distiller/core/dom_distiller_switches.h" |
Tommy Nyquist | c1d6dea1 | 2017-07-26 20:37:23 | [diff] [blame] | 28 | #include "components/feature_engagement/public/feature_constants.h" |
| 29 | #include "components/feature_engagement/public/feature_list.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 30 | #include "components/flags_ui/feature_entry.h" |
| 31 | #include "components/flags_ui/feature_entry_macros.h" |
| 32 | #include "components/flags_ui/flags_storage.h" |
| 33 | #include "components/flags_ui/flags_ui_switches.h" |
Tanja Gornak | b0985dd | 2018-10-11 17:24:40 | [diff] [blame] | 34 | #include "components/invalidation/impl/invalidation_switches.h" |
noyau | 4cfb133 | 2016-10-25 17:05:42 | [diff] [blame] | 35 | #include "components/ntp_tiles/switches.h" |
Justin Donnelly | 33d712e | 2017-08-23 21:32:51 | [diff] [blame] | 36 | #include "components/omnibox/browser/omnibox_field_trial.h" |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 37 | #include "components/omnibox/common/omnibox_features.h" |
Ioana Pandele | d14ce9e | 2017-11-28 14:41:46 | [diff] [blame] | 38 | #include "components/password_manager/core/common/password_manager_features.h" |
mathp | 9b4c11d | 2017-07-06 20:24:13 | [diff] [blame] | 39 | #include "components/payments/core/features.h" |
Marc Treib | 5fc99e1f | 2017-11-08 12:19:18 | [diff] [blame] | 40 | #include "components/search_provider_logos/switches.h" |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 41 | #include "components/security_state/core/features.h" |
Sébastien Séguin-Gagnon | dcb854b | 2019-04-10 16:36:44 | [diff] [blame] | 42 | #include "components/send_tab_to_self/features.h" |
Valeriya Sinevich | a79dc61 | 2018-09-25 14:49:09 | [diff] [blame] | 43 | #include "components/signin/core/browser/account_reconcilor.h" |
David Roger | a6c8812 | 2017-10-25 13:02:46 | [diff] [blame] | 44 | #include "components/signin/core/browser/signin_switches.h" |
sdefresne | 3657978 | 2016-02-05 11:08:25 | [diff] [blame] | 45 | #include "components/strings/grit/components_strings.h" |
Moe Ahmadi | d6d5d17 | 2018-06-20 17:20:23 | [diff] [blame] | 46 | #include "components/sync/driver/sync_driver_switches.h" |
Moe Ahmadi | e4cce1f | 2018-12-18 23:48:01 | [diff] [blame] | 47 | #include "components/translate/core/browser/translate_prefs.h" |
Chris Lu | 0683adf | 2019-02-26 15:56:45 | [diff] [blame] | 48 | #include "components/ukm/ios/features.h" |
Mihai Sardarescu | 160ec66 | 2018-07-18 21:13:51 | [diff] [blame] | 49 | #include "components/unified_consent/feature.h" |
mrefaat | 4539b03 | 2018-08-02 22:25:45 | [diff] [blame] | 50 | #include "ios/chrome/browser/app_launcher/app_launcher_flags.h" |
Sylvain Defresne | ae6987e | 2018-03-01 13:21:40 | [diff] [blame] | 51 | #include "ios/chrome/browser/browsing_data/browsing_data_features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 52 | #include "ios/chrome/browser/chrome_switches.h" |
Olivier Robin | 2a898dc | 2018-10-31 14:37:04 | [diff] [blame] | 53 | #include "ios/chrome/browser/crash_report/crash_report_flags.h" |
Jean-François Geyelin | 30be591 | 2017-08-25 12:05:38 | [diff] [blame] | 54 | #include "ios/chrome/browser/drag_and_drop/drag_and_drop_flag.h" |
Chris Lu | 77905ac | 2018-12-06 20:46:51 | [diff] [blame] | 55 | #include "ios/chrome/browser/find_in_page/features.h" |
vabr | 0215a8e | 2017-03-28 12:47:34 | [diff] [blame] | 56 | #include "ios/chrome/browser/ios_chrome_flag_descriptions.h" |
David Jean | 7d0bff1 | 2019-04-01 08:21:14 | [diff] [blame] | 57 | #include "ios/chrome/browser/passwords/password_manager_features.h" |
Olivier Robin | 091319d | 2019-03-04 10:45:34 | [diff] [blame] | 58 | #include "ios/chrome/browser/reading_list/features.h" |
Jérôme Lebel | ec28283 | 2018-09-18 08:34:18 | [diff] [blame] | 59 | #include "ios/chrome/browser/signin/feature_flags.h" |
Gauthier Ambard | 33e0330 | 2019-02-21 13:28:58 | [diff] [blame] | 60 | #include "ios/chrome/browser/system_flags.h" |
Kurt Horimoto | 9165404a | 2018-11-13 23:48:12 | [diff] [blame] | 61 | #import "ios/chrome/browser/ui/dialogs/dialog_features.h" |
Kurt Horimoto | 4da682b02 | 2018-04-12 07:43:35 | [diff] [blame] | 62 | #import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h" |
sczs | 80a6f46 | 2018-12-05 20:37:18 | [diff] [blame] | 63 | #import "ios/chrome/browser/ui/infobars/infobar_feature.h" |
Mark Cogan | 02ed6c77 | 2018-05-31 17:00:51 | [diff] [blame] | 64 | #import "ios/chrome/browser/ui/toolbar/public/features.h" |
Kurt Horimoto | 79d590b | 2018-09-12 19:09:28 | [diff] [blame] | 65 | #import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h" |
Justin Cohen | 2d81c58 | 2018-01-22 14:46:44 | [diff] [blame] | 66 | #include "ios/chrome/browser/ui/ui_feature_flags.h" |
Yi Su | 392b303 | 2018-06-05 07:26:47 | [diff] [blame] | 67 | #include "ios/chrome/browser/web/features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 68 | #include "ios/chrome/grit/ios_strings.h" |
msarda | fc76f66 | 2017-02-24 12:46:28 | [diff] [blame] | 69 | #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
Eugene But | 61818bc | 2019-04-15 21:04:07 | [diff] [blame] | 70 | #include "ios/web/common/features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 71 | #include "ios/web/public/user_agent.h" |
| 72 | #include "ios/web/public/web_view_creation_util.h" |
| 73 | |
| 74 | #if !defined(OFFICIAL_BUILD) |
| 75 | #include "components/variations/variations_switches.h" |
vitaliii | 489217aa | 2017-01-30 14:50:22 | [diff] [blame] | 76 | #endif |
stkhapugin | c1be179 | 2016-12-13 14:30:53 | [diff] [blame] | 77 | |
| 78 | #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 79 | #error "This file requires ARC support." |
| 80 | #endif |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 81 | |
elawrence | 816f6790e | 2017-06-16 18:19:28 | [diff] [blame] | 82 | using flags_ui::FeatureEntry; |
| 83 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 84 | namespace { |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 85 | |
| 86 | const FeatureEntry::FeatureParam kMarkHttpAsDangerous[] = { |
| 87 | {security_state::features::kMarkHttpAsFeatureParameterName, |
| 88 | security_state::features::kMarkHttpAsParameterDangerous}}; |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 89 | const FeatureEntry::FeatureParam kMarkHttpAsWarningAndDangerousOnFormEdits[] = { |
| 90 | {security_state::features::kMarkHttpAsFeatureParameterName, |
| 91 | security_state::features:: |
| 92 | kMarkHttpAsParameterWarningAndDangerousOnFormEdits}}; |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 93 | |
| 94 | const FeatureEntry::FeatureVariation kMarkHttpAsFeatureVariations[] = { |
| 95 | {"(mark as actively dangerous)", kMarkHttpAsDangerous, |
kokihoon | 189a402 | 2018-10-13 02:43:44 | [diff] [blame] | 96 | base::size(kMarkHttpAsDangerous), nullptr}, |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 97 | {"(mark with a Not Secure warning and dangerous on form edits)", |
| 98 | kMarkHttpAsWarningAndDangerousOnFormEdits, |
Joe DeBlasio | 20e01fd | 2018-12-20 19:59:30 | [diff] [blame] | 99 | base::size(kMarkHttpAsWarningAndDangerousOnFormEdits), nullptr}}; |
elawrence | 816f6790e | 2017-06-16 18:19:28 | [diff] [blame] | 100 | |
Marc Treib | 5fc99e1f | 2017-11-08 12:19:18 | [diff] [blame] | 101 | const FeatureEntry::Choice kUseDdljsonApiChoices[] = { |
| 102 | {flags_ui::kGenericExperimentChoiceDefault, "", ""}, |
| 103 | {"(force test doodle 0)", search_provider_logos::switches::kGoogleDoodleUrl, |
| 104 | "https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios0.json"}, |
| 105 | {"(force test doodle 1)", search_provider_logos::switches::kGoogleDoodleUrl, |
| 106 | "https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios1.json"}, |
| 107 | {"(force test doodle 2)", search_provider_logos::switches::kGoogleDoodleUrl, |
| 108 | "https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios2.json"}, |
| 109 | {"(force test doodle 3)", search_provider_logos::switches::kGoogleDoodleUrl, |
| 110 | "https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios3.json"}, |
| 111 | {"(force test doodle 4)", search_provider_logos::switches::kGoogleDoodleUrl, |
| 112 | "https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios4.json"}, |
| 113 | }; |
Marc Treib | 2752e8b | 2017-08-04 14:12:09 | [diff] [blame] | 114 | |
Olivier Robin | 3d6041162 | 2018-02-23 10:03:22 | [diff] [blame] | 115 | const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = { |
| 116 | {flags_ui::kGenericExperimentChoiceDefault, "", ""}, |
| 117 | {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"}, |
| 118 | {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"}, |
| 119 | {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"}, |
| 120 | {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"}, |
| 121 | {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"}, |
| 122 | {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"}, |
| 123 | {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"}, |
| 124 | {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"}, |
| 125 | }; |
| 126 | |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 127 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = { |
| 128 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}}; |
| 129 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = { |
| 130 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}}; |
| 131 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = { |
| 132 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}}; |
| 133 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = { |
| 134 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}}; |
| 135 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = { |
| 136 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}}; |
| 137 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = { |
| 138 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}}; |
| 139 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = { |
| 140 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}}; |
| 141 | |
| 142 | const FeatureEntry::FeatureVariation |
| 143 | kOmniboxUIMaxAutocompleteMatchesVariations[] = { |
| 144 | {"3 matches", kOmniboxUIMaxAutocompleteMatches3, |
| 145 | base::size(kOmniboxUIMaxAutocompleteMatches3), nullptr}, |
| 146 | {"4 matches", kOmniboxUIMaxAutocompleteMatches4, |
| 147 | base::size(kOmniboxUIMaxAutocompleteMatches4), nullptr}, |
| 148 | {"5 matches", kOmniboxUIMaxAutocompleteMatches5, |
| 149 | base::size(kOmniboxUIMaxAutocompleteMatches5), nullptr}, |
| 150 | {"6 matches", kOmniboxUIMaxAutocompleteMatches6, |
| 151 | base::size(kOmniboxUIMaxAutocompleteMatches6), nullptr}, |
| 152 | {"8 matches", kOmniboxUIMaxAutocompleteMatches8, |
| 153 | base::size(kOmniboxUIMaxAutocompleteMatches8), nullptr}, |
| 154 | {"10 matches", kOmniboxUIMaxAutocompleteMatches10, |
| 155 | base::size(kOmniboxUIMaxAutocompleteMatches10), nullptr}, |
| 156 | {"12 matches", kOmniboxUIMaxAutocompleteMatches12, |
| 157 | base::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}}; |
| 158 | |
Gauthier Ambard | 2392f2a | 2018-10-24 16:33:27 | [diff] [blame] | 159 | const FeatureEntry::FeatureParam kIconForSearchButtonGrey[] = { |
| 160 | {kIconForSearchButtonFeatureParameterName, |
| 161 | kIconForSearchButtonParameterGrey}}; |
| 162 | const FeatureEntry::FeatureParam kIconForSearchButtonColorful[] = { |
| 163 | {kIconForSearchButtonFeatureParameterName, |
| 164 | kIconForSearchButtonParameterColorful}}; |
| 165 | const FeatureEntry::FeatureParam kIconForSearchButtonMagnifying[] = { |
| 166 | {kIconForSearchButtonFeatureParameterName, |
| 167 | kIconForSearchButtonParameterMagnifying}}; |
| 168 | |
| 169 | const FeatureEntry::FeatureVariation kIconForSearchButtonVariations[] = { |
| 170 | {"Grey search engine logo", kIconForSearchButtonGrey, |
| 171 | base::size(kIconForSearchButtonGrey), nullptr}, |
| 172 | {"Colorful search engine logo", kIconForSearchButtonColorful, |
| 173 | base::size(kIconForSearchButtonColorful), nullptr}, |
| 174 | {"Magnifying glass", kIconForSearchButtonMagnifying, |
| 175 | base::size(kIconForSearchButtonMagnifying), nullptr}}; |
| 176 | |
Olivier Robin | ce9386ebd | 2018-11-29 09:07:38 | [diff] [blame] | 177 | const FeatureEntry::FeatureParam kDetectMainThreadFreezeTimeout3s[] = { |
| 178 | {crash_report::kDetectMainThreadFreezeParameterName, |
| 179 | crash_report::kDetectMainThreadFreezeParameter3s}}; |
| 180 | const FeatureEntry::FeatureParam kDetectMainThreadFreezeTimeout5s[] = { |
| 181 | {crash_report::kDetectMainThreadFreezeParameterName, |
| 182 | crash_report::kDetectMainThreadFreezeParameter5s}}; |
| 183 | const FeatureEntry::FeatureParam kDetectMainThreadFreezeTimeout7s[] = { |
| 184 | {crash_report::kDetectMainThreadFreezeParameterName, |
| 185 | crash_report::kDetectMainThreadFreezeParameter7s}}; |
| 186 | const FeatureEntry::FeatureParam kDetectMainThreadFreezeTimeout9s[] = { |
| 187 | {crash_report::kDetectMainThreadFreezeParameterName, |
| 188 | crash_report::kDetectMainThreadFreezeParameter9s}}; |
| 189 | |
| 190 | const FeatureEntry::FeatureVariation kDetectMainThreadFreezeVariations[] = { |
| 191 | {"3s", kDetectMainThreadFreezeTimeout3s, |
| 192 | base::size(kDetectMainThreadFreezeTimeout3s), nullptr}, |
| 193 | {"5s", kDetectMainThreadFreezeTimeout5s, |
| 194 | base::size(kDetectMainThreadFreezeTimeout5s), nullptr}, |
| 195 | {"7s", kDetectMainThreadFreezeTimeout7s, |
| 196 | base::size(kDetectMainThreadFreezeTimeout7s), nullptr}, |
| 197 | {"9s", kDetectMainThreadFreezeTimeout9s, |
| 198 | base::size(kDetectMainThreadFreezeTimeout9s), nullptr}}; |
| 199 | |
Caitlin Fischer | 37e0123 | 2019-05-24 13:05:45 | [diff] [blame] | 200 | const FeatureEntry::FeatureParam |
| 201 | kAutofillUseMobileLabelDisambiguationShowAll[] = { |
| 202 | {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName, |
| 203 | autofill::features:: |
| 204 | kAutofillUseMobileLabelDisambiguationParameterShowAll}}; |
| 205 | const FeatureEntry::FeatureParam |
| 206 | kAutofillUseMobileLabelDisambiguationShowOne[] = { |
| 207 | {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName, |
| 208 | autofill::features:: |
| 209 | kAutofillUseMobileLabelDisambiguationParameterShowOne}}; |
| 210 | |
| 211 | const FeatureEntry::FeatureVariation |
| 212 | kAutofillUseMobileLabelDisambiguationVariations[] = { |
| 213 | {"(show all)", kAutofillUseMobileLabelDisambiguationShowAll, |
| 214 | base::size(kAutofillUseMobileLabelDisambiguationShowAll), nullptr}, |
| 215 | {"(show one)", kAutofillUseMobileLabelDisambiguationShowOne, |
| 216 | base::size(kAutofillUseMobileLabelDisambiguationShowOne), nullptr}}; |
| 217 | |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 218 | // To add a new entry, add to the end of kFeatureEntries. There are four |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 219 | // distinct types of entries: |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 220 | // . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the |
| 221 | // default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 222 | // macro for this type supplying the command line to the macro. |
| 223 | // . MULTI_VALUE: a list of choices, the first of which should correspond to a |
| 224 | // deactivated state for this lab (i.e. no command line option). To specify |
| 225 | // this type of entry use the macro MULTI_VALUE_TYPE supplying it the |
| 226 | // array of choices. |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 227 | // . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is |
| 228 | // either enabled, disabled, or uses the default value of the associated |
| 229 | // base::Feature instance. To specify this type of entry use the macro |
| 230 | // FEATURE_VALUE_TYPE supplying it the base::Feature instance. |
| 231 | // . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a |
| 232 | // base::Feature instance. Choices corresponding to the default state, a |
| 233 | // universally enabled state, and a universally disabled state are |
| 234 | // automatically included. To specify this type of entry use the macro |
| 235 | // FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and |
| 236 | // the array of choices. |
| 237 | // |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 238 | // See the documentation of FeatureEntry for details on the fields. |
| 239 | // |
| 240 | // When adding a new choice, add it to the end of the list. |
| 241 | const flags_ui::FeatureEntry kFeatureEntries[] = { |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 242 | {"enable-mark-http-as", flag_descriptions::kMarkHttpAsName, |
elawrence | 816f6790e | 2017-06-16 18:19:28 | [diff] [blame] | 243 | flag_descriptions::kMarkHttpAsDescription, flags_ui::kOsIos, |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 244 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 245 | security_state::features::kMarkHttpAsFeature, |
| 246 | kMarkHttpAsFeatureVariations, |
| 247 | "MarkHttpAs")}, |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 248 | {"in-product-help-demo-mode-choice", |
| 249 | flag_descriptions::kInProductHelpDemoModeName, |
| 250 | flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos, |
| 251 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
Tommy Nyquist | c1d6dea1 | 2017-07-26 20:37:23 | [diff] [blame] | 252 | feature_engagement::kIPHDemoMode, |
| 253 | feature_engagement::kIPHDemoModeChoiceVariations, |
Marc Treib | 2752e8b | 2017-08-04 14:12:09 | [diff] [blame] | 254 | "IPH_DemoMode")}, |
| 255 | {"use-ddljson-api", flag_descriptions::kUseDdljsonApiName, |
| 256 | flag_descriptions::kUseDdljsonApiDescription, flags_ui::kOsIos, |
Marc Treib | 5fc99e1f | 2017-11-08 12:19:18 | [diff] [blame] | 257 | MULTI_VALUE_TYPE(kUseDdljsonApiChoices)}, |
Jean-François Geyelin | 30be591 | 2017-08-25 12:05:38 | [diff] [blame] | 258 | {"drag_and_drop", flag_descriptions::kDragAndDropName, |
| 259 | flag_descriptions::kDragAndDropDescription, flags_ui::kOsIos, |
Rohit Rao | 6a3a481d | 2017-09-25 19:31:41 | [diff] [blame] | 260 | FEATURE_VALUE_TYPE(kDragAndDrop)}, |
Eugene But | 468b6d5f0 | 2018-10-18 21:17:45 | [diff] [blame] | 261 | {"ignores-viewport-scale-limits", |
| 262 | flag_descriptions::kIgnoresViewportScaleLimitsName, |
| 263 | flag_descriptions::kIgnoresViewportScaleLimitsDescription, |
| 264 | flags_ui::kOsIos, |
| 265 | FEATURE_VALUE_TYPE(web::features::kIgnoresViewportScaleLimits)}, |
Danyao Wang | 34da6ff | 2017-10-30 15:16:56 | [diff] [blame] | 266 | {"slim-navigation-manager", flag_descriptions::kSlimNavigationManagerName, |
| 267 | flag_descriptions::kSlimNavigationManagerDescription, flags_ui::kOsIos, |
| 268 | FEATURE_VALUE_TYPE(web::features::kSlimNavigationManager)}, |
mrefaat | a6501d9 | 2017-12-11 19:50:50 | [diff] [blame] | 269 | {"wk-http-system-cookie-store", |
| 270 | flag_descriptions::kWKHTTPSystemCookieStoreName, |
| 271 | flag_descriptions::kWKHTTPSystemCookieStoreName, flags_ui::kOsIos, |
Mohamad Ahmadi | c4df81f | 2017-12-20 04:41:59 | [diff] [blame] | 272 | FEATURE_VALUE_TYPE(web::features::kWKHTTPSystemCookieStore)}, |
Moe Ahmadi | c3fd7cd | 2018-05-11 21:40:22 | [diff] [blame] | 273 | {"enable-autofill-credit-card-upload", |
| 274 | flag_descriptions::kAutofillCreditCardUploadName, |
| 275 | flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos, |
Anne Lim | 579b573 | 2018-08-30 18:24:24 | [diff] [blame] | 276 | FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)}, |
Lakshmi Kumar Dabbiru | ee22004e | 2018-06-01 01:52:27 | [diff] [blame] | 277 | {"enable-autofill-credit-card-downstream-google-pay-branding", |
| 278 | flag_descriptions::kAutofillDownstreamUseGooglePayBrandingOniOSName, |
| 279 | flag_descriptions::kAutofillDownstreamUseGooglePayBrandingOniOSDescription, |
| 280 | flags_ui::kOsIos, |
| 281 | FEATURE_VALUE_TYPE( |
| 282 | autofill::features::kAutofillDownstreamUseGooglePayBrandingOniOS)}, |
Moe Ahmadi | d6d5d17 | 2018-06-20 17:20:23 | [diff] [blame] | 283 | {"use-sync-sandbox", flag_descriptions::kSyncSandboxName, |
| 284 | flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos, |
| 285 | SINGLE_VALUE_TYPE_AND_VALUE( |
| 286 | switches::kSyncServiceURL, |
| 287 | "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")}, |
| 288 | {"wallet-service-use-sandbox", |
| 289 | flag_descriptions::kWalletServiceUseSandboxName, |
| 290 | flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos, |
| 291 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE( |
| 292 | autofill::switches::kWalletServiceUseSandbox, |
| 293 | "1", |
| 294 | autofill::switches::kWalletServiceUseSandbox, |
| 295 | "0")}, |
Mohamad Ahmadi | c4df81f | 2017-12-20 04:41:59 | [diff] [blame] | 296 | {"show-autofill-type-predictions", |
| 297 | flag_descriptions::kShowAutofillTypePredictionsName, |
| 298 | flag_descriptions::kShowAutofillTypePredictionsDescription, |
| 299 | flags_ui::kOsIos, |
Gauthier Ambard | cfd8518 | 2018-01-05 10:37:46 | [diff] [blame] | 300 | FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)}, |
Olivier Robin | 3d6041162 | 2018-02-23 10:03:22 | [diff] [blame] | 301 | {"autofill-ios-delay-between-fields", |
| 302 | flag_descriptions::kAutofillIOSDelayBetweenFieldsName, |
| 303 | flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription, |
| 304 | flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)}, |
Sylvain Defresne | ae6987e | 2018-03-01 13:21:40 | [diff] [blame] | 305 | {"new-clear-browsing-data-ui", |
| 306 | flag_descriptions::kNewClearBrowsingDataUIName, |
| 307 | flag_descriptions::kNewClearBrowsingDataUIDescription, flags_ui::kOsIos, |
| 308 | FEATURE_VALUE_TYPE(kNewClearBrowsingDataUI)}, |
Jérôme Lebel | fa6c5ae | 2018-03-29 13:46:57 | [diff] [blame] | 309 | {"unified-consent", flag_descriptions::kUnifiedConsentName, |
| 310 | flag_descriptions::kUnifiedConsentDescription, flags_ui::kOsIos, |
Mihai Sardarescu | 160ec66 | 2018-07-18 21:13:51 | [diff] [blame] | 311 | FEATURE_VALUE_TYPE(unified_consent::kUnifiedConsent)}, |
Olivier Robin | d81475b0 | 2018-06-20 21:30:11 | [diff] [blame] | 312 | {"autofill-show-all-profiles-on-prefilled-forms", |
| 313 | flag_descriptions::kAutofillShowAllSuggestionsOnPrefilledFormsName, |
| 314 | flag_descriptions::kAutofillShowAllSuggestionsOnPrefilledFormsDescription, |
| 315 | flags_ui::kOsIos, |
| 316 | FEATURE_VALUE_TYPE( |
| 317 | autofill::features::kAutofillShowAllSuggestionsOnPrefilledForms)}, |
Moe Ahmadi | d3ddfcb | 2018-04-20 19:51:08 | [diff] [blame] | 318 | {"autofill-restrict-formless-form-extraction", |
| 319 | flag_descriptions::kAutofillRestrictUnownedFieldsToFormlessCheckoutName, |
| 320 | flag_descriptions:: |
| 321 | kAutofillRestrictUnownedFieldsToFormlessCheckoutDescription, |
| 322 | flags_ui::kOsIos, |
| 323 | FEATURE_VALUE_TYPE( |
| 324 | autofill::features::kAutofillRestrictUnownedFieldsToFormlessCheckout)}, |
Roger McFarlane | e193ab12 | 2018-11-22 20:55:07 | [diff] [blame] | 325 | {"autofill-rich-metadata-queries", |
| 326 | flag_descriptions::kAutofillRichMetadataQueriesName, |
| 327 | flag_descriptions::kAutofillRichMetadataQueriesDescription, |
| 328 | flags_ui::kOsIos, |
| 329 | FEATURE_VALUE_TYPE(autofill::features::kAutofillRichMetadataQueries)}, |
Kurt Horimoto | dc33af3 | 2018-05-01 01:39:14 | [diff] [blame] | 330 | {"fullscreen-viewport-adjustment-experiment", |
| 331 | flag_descriptions::kFullscreenViewportAdjustmentExperimentName, |
| 332 | flag_descriptions::kFullscreenViewportAdjustmentExperimentDescription, |
| 333 | flags_ui::kOsIos, |
| 334 | MULTI_VALUE_TYPE( |
| 335 | fullscreen::features::kViewportAdjustmentExperimentChoices)}, |
Roger McFarlane | 1a37d7b | 2018-04-20 22:45:19 | [diff] [blame] | 336 | {"autofill-enforce-min-required-fields-for-heuristics", |
| 337 | flag_descriptions::kAutofillEnforceMinRequiredFieldsForHeuristicsName, |
| 338 | flag_descriptions:: |
| 339 | kAutofillEnforceMinRequiredFieldsForHeuristicsDescription, |
| 340 | flags_ui::kOsIos, |
| 341 | FEATURE_VALUE_TYPE( |
| 342 | autofill::features::kAutofillEnforceMinRequiredFieldsForHeuristics)}, |
| 343 | {"autofill-enforce-min-required-fields-for-query", |
| 344 | flag_descriptions::kAutofillEnforceMinRequiredFieldsForQueryName, |
| 345 | flag_descriptions::kAutofillEnforceMinRequiredFieldsForQueryDescription, |
| 346 | flags_ui::kOsIos, |
| 347 | FEATURE_VALUE_TYPE( |
| 348 | autofill::features::kAutofillEnforceMinRequiredFieldsForQuery)}, |
| 349 | {"autofill-enforce-min-required-fields-for-upload", |
| 350 | flag_descriptions::kAutofillEnforceMinRequiredFieldsForUploadName, |
| 351 | flag_descriptions::kAutofillEnforceMinRequiredFieldsForUploadDescription, |
| 352 | flags_ui::kOsIos, |
| 353 | FEATURE_VALUE_TYPE( |
| 354 | autofill::features::kAutofillEnforceMinRequiredFieldsForUpload)}, |
Roger McFarlane | 2eceba98 | 2018-05-18 01:37:11 | [diff] [blame] | 355 | {"autofill-cache-query-responses", |
| 356 | flag_descriptions::kAutofillCacheQueryResponsesName, |
| 357 | flag_descriptions::kAutofillCacheQueryResponsesDescription, |
| 358 | flags_ui::kOsIos, |
| 359 | FEATURE_VALUE_TYPE(autofill::features::kAutofillCacheQueryResponses)}, |
Jeffrey Cohen | 05cdafa39 | 2018-08-15 20:49:17 | [diff] [blame] | 360 | {"autofill-enable-company-name", |
| 361 | flag_descriptions::kAutofillEnableCompanyNameName, |
| 362 | flag_descriptions::kAutofillEnableCompanyNameDescription, flags_ui::kOsIos, |
| 363 | FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableCompanyName)}, |
Yi Su | 392b303 | 2018-06-05 07:26:47 | [diff] [blame] | 364 | {"webpage-text-accessibility", |
| 365 | flag_descriptions::kWebPageTextAccessibilityName, |
| 366 | flag_descriptions::kWebPageTextAccessibilityDescription, flags_ui::kOsIos, |
| 367 | FEATURE_VALUE_TYPE(web::kWebPageTextAccessibility)}, |
Vadym Doroshenko | a9a91494 | 2018-07-19 08:23:30 | [diff] [blame] | 368 | {"new-password-form-parsing", |
| 369 | flag_descriptions::kNewPasswordFormParsingName, |
| 370 | flag_descriptions::kNewPasswordFormParsingDescription, flags_ui::kOsIos, |
| 371 | FEATURE_VALUE_TYPE(password_manager::features::kNewPasswordFormParsing)}, |
mrefaat | 4539b03 | 2018-08-02 22:25:45 | [diff] [blame] | 372 | {"app-launcher-refresh", flag_descriptions::kAppLauncherRefreshName, |
| 373 | flag_descriptions::kAppLauncherRefreshDescription, flags_ui::kOsIos, |
| 374 | FEATURE_VALUE_TYPE(kAppLauncherRefresh)}, |
Marc Treib | 4bd95e7 | 2018-08-30 06:30:58 | [diff] [blame] | 375 | {"sync-support-secondary-account", |
| 376 | flag_descriptions::kSyncSupportSecondaryAccountName, |
| 377 | flag_descriptions::kSyncSupportSecondaryAccountDescription, |
| 378 | flags_ui::kOsIos, |
| 379 | FEATURE_VALUE_TYPE(switches::kSyncSupportSecondaryAccount)}, |
Kurt Horimoto | 79d590b | 2018-09-12 19:09:28 | [diff] [blame] | 380 | {"toolbar-container", flag_descriptions::kToolbarContainerName, |
| 381 | flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos, |
| 382 | FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)}, |
[email protected] | 5b899dc | 2018-10-02 09:20:01 | [diff] [blame] | 383 | {"omnibox-popup-shortcuts", |
| 384 | flag_descriptions::kOmniboxPopupShortcutIconsInZeroStateName, |
| 385 | flag_descriptions::kOmniboxPopupShortcutIconsInZeroStateDescription, |
| 386 | flags_ui::kOsIos, |
| 387 | FEATURE_VALUE_TYPE(omnibox::kOmniboxPopupShortcutIconsInZeroState)}, |
Valeriya Sinevich | a79dc61 | 2018-09-25 14:49:09 | [diff] [blame] | 388 | {"use-multilogin-endpoint", flag_descriptions::kUseMultiloginEndpointName, |
| 389 | flag_descriptions::kUseMultiloginEndpointDescription, flags_ui::kOsIos, |
| 390 | FEATURE_VALUE_TYPE(kUseMultiloginEndpoint)}, |
edchin | 18a3e60 | 2018-10-08 23:39:35 | [diff] [blame] | 391 | {"closing-last-incognito-tab", |
| 392 | flag_descriptions::kClosingLastIncognitoTabName, |
| 393 | flag_descriptions::kClosingLastIncognitoTabDescription, flags_ui::kOsIos, |
| 394 | FEATURE_VALUE_TYPE(kClosingLastIncognitoTab)}, |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 395 | {"omnibox-ui-max-autocomplete-matches", |
| 396 | flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName, |
| 397 | flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription, |
| 398 | flags_ui::kOsIos, |
| 399 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 400 | omnibox::kUIExperimentMaxAutocompleteMatches, |
| 401 | kOmniboxUIMaxAutocompleteMatchesVariations, |
| 402 | "OmniboxUIMaxAutocompleteVariations")}, |
Tanja Gornak | b0985dd | 2018-10-11 17:24:40 | [diff] [blame] | 403 | {"fcm-invalidations", flag_descriptions::kFCMInvalidationsName, |
| 404 | flag_descriptions::kFCMInvalidationsDescription, flags_ui::kOsIos, |
| 405 | FEATURE_VALUE_TYPE(invalidation::switches::kFCMInvalidations)}, |
Gauthier Ambard | 2392f2a | 2018-10-24 16:33:27 | [diff] [blame] | 406 | {"search-icon-toggle", flag_descriptions::kSearchIconToggleName, |
| 407 | flag_descriptions::kSearchIconToggleDescription, flags_ui::kOsIos, |
| 408 | FEATURE_WITH_PARAMS_VALUE_TYPE(kIconForSearchButtonFeature, |
| 409 | kIconForSearchButtonVariations, |
| 410 | "ToggleSearchButtonIcon")}, |
Olivier Robin | 2a898dc | 2018-10-31 14:37:04 | [diff] [blame] | 411 | {"enable-breakpad-upload-no-delay", |
| 412 | flag_descriptions::kBreakpadNoDelayInitialUploadName, |
| 413 | flag_descriptions::kBreakpadNoDelayInitialUploadDescription, |
| 414 | flags_ui::kOsIos, |
| 415 | FEATURE_VALUE_TYPE(crash_report::kBreakpadNoDelayInitialUpload)}, |
Kurt Horimoto | 9165404a | 2018-11-13 23:48:12 | [diff] [blame] | 416 | {"non-modal-dialogs", flag_descriptions::kNonModalDialogsName, |
| 417 | flag_descriptions::kNonModalDialogsDescription, flags_ui::kOsIos, |
| 418 | FEATURE_VALUE_TYPE(dialogs::kNonModalDialogs)}, |
Olivier Robin | ce9386ebd | 2018-11-29 09:07:38 | [diff] [blame] | 419 | {"detect-main-thread-freeze", |
| 420 | flag_descriptions::kDetectMainThreadFreezeName, |
| 421 | flag_descriptions::kDetectMainThreadFreezeDescription, flags_ui::kOsIos, |
| 422 | FEATURE_WITH_PARAMS_VALUE_TYPE(crash_report::kDetectMainThreadFreeze, |
| 423 | kDetectMainThreadFreezeVariations, |
| 424 | "DetectMainThreadFreeze")}, |
Mohamed Amir Yosef | 9e8a1f0 | 2018-12-03 21:41:14 | [diff] [blame] | 425 | {"enable-sync-uss-bookmarks", |
| 426 | flag_descriptions::kEnableSyncUSSBookmarksName, |
| 427 | flag_descriptions::kEnableSyncUSSBookmarksDescription, flags_ui::kOsIos, |
| 428 | FEATURE_VALUE_TYPE(switches::kSyncUSSBookmarks)}, |
sczs | 80a6f46 | 2018-12-05 20:37:18 | [diff] [blame] | 429 | {"infobar-ui-reboot", flag_descriptions::kInfobarUIRebootName, |
| 430 | flag_descriptions::kInfobarUIRebootDescription, flags_ui::kOsIos, |
| 431 | FEATURE_VALUE_TYPE(kInfobarUIReboot)}, |
Chris Lu | 77905ac | 2018-12-06 20:46:51 | [diff] [blame] | 432 | {"find-in-page-iframe", flag_descriptions::kFindInPageiFrameName, |
| 433 | flag_descriptions::kFindInPageiFrameDescription, flags_ui::kOsIos, |
| 434 | FEATURE_VALUE_TYPE(kFindInPageiFrame)}, |
Robbie Gibson | 80d732e | 2019-01-10 10:42:49 | [diff] [blame] | 435 | {"enable-clipboard-provider-text-suggestions", |
| 436 | flag_descriptions::kEnableClipboardProviderTextSuggestionsName, |
| 437 | flag_descriptions::kEnableClipboardProviderTextSuggestionsDescription, |
| 438 | flags_ui::kOsIos, |
| 439 | FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProviderTextSuggestions)}, |
| 440 | {"enable-clipboard-provider-image-suggestions", |
| 441 | flag_descriptions::kEnableClipboardProviderImageSuggestionsName, |
| 442 | flag_descriptions::kEnableClipboardProviderImageSuggestionsDescription, |
| 443 | flags_ui::kOsIos, |
| 444 | FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProviderImageSuggestions)}, |
| 445 | {"copied-content-behavior", flag_descriptions::kCopiedContentBehaviorName, |
| 446 | flag_descriptions::kCopiedContentBehaviorName, flags_ui::kOsIos, |
| 447 | FEATURE_VALUE_TYPE(kCopiedContentBehavior)}, |
Vadym Doroshenko | d178ff3f | 2019-01-02 14:59:23 | [diff] [blame] | 448 | {"new-password-form-parsing-for-saving", |
| 449 | flag_descriptions::kNewPasswordFormParsingForSavingName, |
| 450 | flag_descriptions::kNewPasswordFormParsingForSavingDescription, |
| 451 | flags_ui::kOsIos, |
| 452 | FEATURE_VALUE_TYPE( |
| 453 | password_manager::features::kNewPasswordFormParsingForSaving)}, |
| 454 | {"only-new-password-form-parsing", |
| 455 | flag_descriptions::kOnlyNewPasswordFormParsingName, |
| 456 | flag_descriptions::kOnlyNewPasswordFormParsingDescription, |
| 457 | flags_ui::kOsIos, |
| 458 | FEATURE_VALUE_TYPE(password_manager::features::kOnlyNewParser)}, |
edchin | 5ae0b4c | 2019-01-06 06:52:28 | [diff] [blame] | 459 | {"snapshot-draw-view", flag_descriptions::kSnapshotDrawViewName, |
| 460 | flag_descriptions::kSnapshotDrawViewDescription, flags_ui::kOsIos, |
| 461 | FEATURE_VALUE_TYPE(kSnapshotDrawView)}, |
Justin Cohen | 20b6f07 | 2019-01-16 01:38:50 | [diff] [blame] | 462 | #if defined(DCHECK_IS_CONFIGURABLE) |
| 463 | {"dcheck-is-fatal", flag_descriptions::kDcheckIsFatalName, |
| 464 | flag_descriptions::kDcheckIsFatalDescription, flags_ui::kOsIos, |
| 465 | FEATURE_VALUE_TYPE(base::kDCheckIsFatalFeature)}, |
| 466 | #endif // defined(DCHECK_IS_CONFIGURABLE) |
Gauthier Ambard | 5f61086 | 2019-01-17 11:43:55 | [diff] [blame] | 467 | {"settings-refresh", flag_descriptions::kSettingsRefreshName, |
| 468 | flag_descriptions::kSettingsRefreshDescription, flags_ui::kOsIos, |
| 469 | FEATURE_VALUE_TYPE(kSettingsRefresh)}, |
Justin Cohen | cd633af | 2019-01-29 20:19:00 | [diff] [blame] | 470 | {"browser-container-keeps-content-view", |
| 471 | flag_descriptions::kBrowserContainerKeepsContentViewName, |
| 472 | flag_descriptions::kBrowserContainerKeepsContentViewDescription, |
| 473 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kBrowserContainerKeepsContentView)}, |
Gauthier Ambard | ef4442a | 2019-02-15 11:14:42 | [diff] [blame] | 474 | {"web-clear-browsing-data", flag_descriptions::kWebClearBrowsingDataName, |
| 475 | flag_descriptions::kWebClearBrowsingDataDescription, flags_ui::kOsIos, |
Gauthier Ambard | 33e0330 | 2019-02-21 13:28:58 | [diff] [blame] | 476 | FEATURE_VALUE_TYPE(kWebClearBrowsingData)}, |
Chris Lu | 8153e6e | 2019-03-26 16:28:21 | [diff] [blame] | 477 | {"send-uma-cellular", flag_descriptions::kSendUmaOverAnyNetwork, |
| 478 | flag_descriptions::kSendUmaOverAnyNetworkDescription, flags_ui::kOsIos, |
Chris Lu | 0683adf | 2019-02-26 15:56:45 | [diff] [blame] | 479 | FEATURE_VALUE_TYPE(kUmaCellular)}, |
Mohamed Amir Yosef | 79feb775 | 2019-03-04 09:49:37 | [diff] [blame] | 480 | {"enable-sync-uss-passwords", |
| 481 | flag_descriptions::kEnableSyncUSSPasswordsName, |
| 482 | flag_descriptions::kEnableSyncUSSPasswordsDescription, flags_ui::kOsIos, |
| 483 | FEATURE_VALUE_TYPE(switches::kSyncUSSPasswords)}, |
Olivier Robin | 091319d | 2019-03-04 10:45:34 | [diff] [blame] | 484 | {"offline-page-without-native-content", |
| 485 | flag_descriptions::kOfflineVersionWithoutNativeContentName, |
| 486 | flag_descriptions::kOfflineVersionWithoutNativeContentDescription, |
| 487 | flags_ui::kOsIos, |
| 488 | FEATURE_VALUE_TYPE(reading_list::kOfflineVersionWithoutNativeContent)}, |
Eugene But | c1aa2c2 | 2019-03-05 14:24:40 | [diff] [blame] | 489 | {"store-pending-item-in-context", |
| 490 | flag_descriptions::kStorePendingItemInContextName, |
| 491 | flag_descriptions::kStorePendingItemInContextDescription, flags_ui::kOsIos, |
| 492 | FEATURE_VALUE_TYPE(web::features::kStorePendingItemInContext)}, |
Jared Saul | 8c22493 | 2019-03-12 15:01:18 | [diff] [blame] | 493 | {"autofill-no-local-save-on-upload-success", |
| 494 | flag_descriptions::kAutofillNoLocalSaveOnUploadSuccessName, |
| 495 | flag_descriptions::kAutofillNoLocalSaveOnUploadSuccessDescription, |
| 496 | flags_ui::kOsIos, |
| 497 | FEATURE_VALUE_TYPE( |
| 498 | autofill::features::kAutofillNoLocalSaveOnUploadSuccess)}, |
Yi Su | 8b117204 | 2019-03-19 10:16:56 | [diff] [blame] | 499 | {"display-search-engine-favicon", |
| 500 | flag_descriptions::kDisplaySearchEngineFaviconName, |
| 501 | flag_descriptions::kDisplaySearchEngineFaviconDescription, |
| 502 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDisplaySearchEngineFavicon)}, |
Jared Saul | 63f598a1 | 2019-03-22 23:40:26 | [diff] [blame] | 503 | {"autofill-no-local-save-on-unmask-success", |
| 504 | flag_descriptions::kAutofillNoLocalSaveOnUnmaskSuccessName, |
| 505 | flag_descriptions::kAutofillNoLocalSaveOnUnmaskSuccessDescription, |
| 506 | flags_ui::kOsIos, |
| 507 | FEATURE_VALUE_TYPE( |
| 508 | autofill::features::kAutofillNoLocalSaveOnUnmaskSuccess)}, |
David Jean | 7d0bff1 | 2019-04-01 08:21:14 | [diff] [blame] | 509 | {"password-generation-suggestion", |
| 510 | flag_descriptions::kPasswordGenerationName, |
| 511 | flag_descriptions::kPasswordGenerationDescription, flags_ui::kOsIos, |
| 512 | FEATURE_VALUE_TYPE(features::kPasswordGeneration)}, |
Stepan Khapugin | 13b7427a | 2019-04-02 13:17:54 | [diff] [blame] | 513 | {"new-omnibox-popup-layout", flag_descriptions::kNewOmniboxPopupLayoutName, |
| 514 | flag_descriptions::kNewOmniboxPopupLayoutDescription, flags_ui::kOsIos, |
| 515 | FEATURE_VALUE_TYPE(kNewOmniboxPopupLayout)}, |
jdoerrie | b37f22c | 2019-04-02 15:50:06 | [diff] [blame] | 516 | {"fill-on-account-select-http", |
| 517 | flag_descriptions::kFillOnAccountSelectHttpName, |
| 518 | flag_descriptions::kFillOnAccountSelectHttpDescription, flags_ui::kOsIos, |
| 519 | FEATURE_VALUE_TYPE(password_manager::features::kFillOnAccountSelectHttp)}, |
Sébastien Séguin-Gagnon | dcb854b | 2019-04-10 16:36:44 | [diff] [blame] | 520 | {"enable-send-tab-to-self", flag_descriptions::kSendTabToSelfName, |
| 521 | flag_descriptions::kSendTabToSelfDescription, flags_ui::kOsIos, |
| 522 | FEATURE_VALUE_TYPE(switches::kSyncSendTabToSelf)}, |
| 523 | {"enable-send-tab-to-self-show-sending-ui", |
| 524 | flag_descriptions::kSendTabToSelfShowSendingUIName, |
| 525 | flag_descriptions::kSendTabToSelfShowSendingUIDescription, |
| 526 | flags_ui::kOsIos, |
| 527 | FEATURE_VALUE_TYPE(send_tab_to_self::kSendTabToSelfShowSendingUI)}, |
Moe Ahmadi | 3229019 | 2019-04-10 19:29:28 | [diff] [blame] | 528 | {"translate-manual-trigger", flag_descriptions::kTranslateManualTriggerName, |
| 529 | flag_descriptions::kTranslateManualTriggerDescription, flags_ui::kOsIos, |
| 530 | FEATURE_VALUE_TYPE(translate::kTranslateMobileManualTrigger)}, |
Nazerke | 4179c0e | 2019-04-11 15:43:34 | [diff] [blame] | 531 | {"omnibox-use-default-search-engine-favicon", |
| 532 | flag_descriptions::kOmniboxUseDefaultSearchEngineFaviconName, |
| 533 | flag_descriptions::kOmniboxUseDefaultSearchEngineFaviconDescription, |
| 534 | flags_ui::kOsIos, |
| 535 | FEATURE_VALUE_TYPE(kOmniboxUseDefaultSearchEngineFavicon)}, |
Hao Zhang | 1b6b9140 | 2019-04-11 20:30:37 | [diff] [blame] | 536 | {"enable-autofill-import-dynamic-forms", |
| 537 | flag_descriptions::kEnableAutofillImportDynamicFormsName, |
| 538 | flag_descriptions::kEnableAutofillImportDynamicFormsDescription, |
| 539 | flags_ui::kOsIos, |
| 540 | FEATURE_VALUE_TYPE(autofill::features::kAutofillImportDynamicForms)}, |
| 541 | {"enable-autofill-import-non-focusable-credit-card-forms", |
| 542 | flag_descriptions::kEnableAutofillImportNonFocusableCreditCardFormsName, |
| 543 | flag_descriptions:: |
| 544 | kEnableAutofillImportNonFocusableCreditCardFormsDescription, |
| 545 | flags_ui::kOsIos, |
| 546 | FEATURE_VALUE_TYPE( |
| 547 | autofill::features::kAutofillImportNonFocusableCreditCardForms)}, |
Anne Lim | b18df63 | 2019-04-15 19:07:54 | [diff] [blame] | 548 | {"enable-autofill-do-not-upload-save-unsupported-cards", |
| 549 | flag_descriptions::kEnableAutofillDoNotUploadSaveUnsupportedCardsName, |
| 550 | flag_descriptions:: |
| 551 | kEnableAutofillDoNotUploadSaveUnsupportedCardsDescription, |
| 552 | flags_ui::kOsIos, |
| 553 | FEATURE_VALUE_TYPE( |
| 554 | autofill::features::kAutofillDoNotUploadSaveUnsupportedCards)}, |
Sébastien Séguin-Gagnon | 3048192 | 2019-04-24 21:31:00 | [diff] [blame] | 555 | {"enable-send-tab-to-self-broadcast", |
| 556 | flag_descriptions::kSendTabToSelfBroadcastName, |
| 557 | flag_descriptions::kSendTabToSelfBroadcastDescription, flags_ui::kOsIos, |
| 558 | FEATURE_VALUE_TYPE(send_tab_to_self::kSendTabToSelfBroadcast)}, |
Caitlin Fischer | 43edd90a | 2019-05-01 13:24:30 | [diff] [blame] | 559 | {"autofill-use-mobile-label-disambiguation", |
| 560 | flag_descriptions::kAutofillUseMobileLabelDisambiguationName, |
| 561 | flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription, |
| 562 | flags_ui::kOsIos, |
Caitlin Fischer | 37e0123 | 2019-05-24 13:05:45 | [diff] [blame] | 563 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 564 | autofill::features::kAutofillUseMobileLabelDisambiguation, |
| 565 | kAutofillUseMobileLabelDisambiguationVariations, |
| 566 | "AutofillUseMobileLabelDisambiguation")}, |
Caitlin Fischer | 6d60954 | 2019-05-01 21:59:21 | [diff] [blame] | 567 | {"enable-autofill-prune-suggestions", |
| 568 | flag_descriptions::kAutofillPruneSuggestionsName, |
| 569 | flag_descriptions::kAutofillPruneSuggestionsDescription, flags_ui::kOsIos, |
| 570 | FEATURE_VALUE_TYPE(autofill::features::kAutofillPruneSuggestions)}, |
Moe Ahmadi | eb43874 | 2019-05-08 20:17:56 | [diff] [blame] | 571 | {"language-settings", flag_descriptions::kLanguageSettingsName, |
| 572 | flag_descriptions::kLanguageSettingsDescription, flags_ui::kOsIos, |
| 573 | FEATURE_VALUE_TYPE(kLanguageSettings)}, |
Kurt Horimoto | 1bdd925 | 2019-05-09 22:05:23 | [diff] [blame] | 574 | {"lock-bottom-toolbar", flag_descriptions::kLockBottomToolbarName, |
| 575 | flag_descriptions::kLockBottomToolbarDescription, flags_ui::kOsIos, |
| 576 | FEATURE_VALUE_TYPE(fullscreen::features::kLockBottomToolbar)}, |
Peter K. Lee | 34e1cea | 2019-05-10 17:40:33 | [diff] [blame] | 577 | {"identity-disc", flag_descriptions::kIdentityDiscName, |
| 578 | flag_descriptions::kIdentityDiscDescription, flags_ui::kOsIos, |
| 579 | FEATURE_VALUE_TYPE(kIdentityDisc)}, |
Jeffrey Cohen | dacbc2a | 2019-05-14 16:15:49 | [diff] [blame] | 580 | {"enable-send-tab-to-self-history", |
| 581 | flag_descriptions::kSendTabToSelfHistoryName, |
| 582 | flag_descriptions::kSendTabToSelfHistoryDescription, flags_ui::kOsIos, |
| 583 | FEATURE_VALUE_TYPE(send_tab_to_self::kSendTabToSelfHistory)}, |
Gauthier Ambard | 4d42f39d | 2019-06-24 13:05:33 | [diff] [blame] | 584 | {"toolbar-new-tab-button", flag_descriptions::kToolbarNewTabButtonName, |
| 585 | flag_descriptions::kToolbarNewTabButtonDescription, flags_ui::kOsIos, |
| 586 | FEATURE_VALUE_TYPE(kToolbarNewTabButton)}, |
Gauthier Ambard | cfd8518 | 2018-01-05 10:37:46 | [diff] [blame] | 587 | }; |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 588 | |
| 589 | // Add all switches from experimental flags to |command_line|. |
| 590 | void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) { |
| 591 | NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
| 592 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 593 | // Set the UA flag if UseMobileSafariUA is enabled. |
| 594 | if ([defaults boolForKey:@"UseMobileSafariUA"]) { |
| 595 | // Safari uses "Vesion/", followed by the OS version excluding bugfix, where |
| 596 | // Chrome puts its product token. |
avi | 57194367 | 2015-12-22 02:12:49 | [diff] [blame] | 597 | int32_t major = 0; |
| 598 | int32_t minor = 0; |
| 599 | int32_t bugfix = 0; |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 600 | base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); |
| 601 | std::string product = base::StringPrintf("Version/%d.%d", major, minor); |
| 602 | |
| 603 | command_line->AppendSwitchASCII(switches::kUserAgent, |
| 604 | web::BuildUserAgentFromProduct(product)); |
| 605 | } |
| 606 | |
| 607 | // Freeform commandline flags. These are added last, so that any flags added |
| 608 | // earlier in this function take precedence. |
| 609 | if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) { |
| 610 | base::CommandLine::StringVector flags; |
| 611 | // Append an empty "program" argument. |
| 612 | flags.push_back(""); |
| 613 | |
| 614 | // The number of flags corresponds to the number of text fields in |
| 615 | // Experimental.plist. |
| 616 | const int kNumFreeformFlags = 5; |
| 617 | for (int i = 1; i <= kNumFreeformFlags; ++i) { |
| 618 | NSString* key = |
| 619 | [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i]; |
| 620 | NSString* flag = [defaults stringForKey:key]; |
| 621 | if ([flag length]) { |
Robbie Gibson | c91ce62 | 2019-05-20 14:44:33 | [diff] [blame] | 622 | // iOS keyboard replaces -- with —, so undo that. |
| 623 | flag = [flag stringByReplacingOccurrencesOfString:@"—" |
| 624 | withString:@"--" |
| 625 | options:0 |
| 626 | range:NSMakeRange(0, 1)]; |
| 627 | // To make things easier, allow flags with no dashes by prepending them |
| 628 | // here. This also allows for flags that just have one dash if they |
| 629 | // exist. |
| 630 | if (![flag hasPrefix:@"-"]) { |
| 631 | flag = [@"--" stringByAppendingString:flag]; |
| 632 | } |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 633 | flags.push_back(base::SysNSStringToUTF8(flag)); |
| 634 | } |
| 635 | } |
| 636 | |
| 637 | base::CommandLine temp_command_line(flags); |
| 638 | command_line->AppendArguments(temp_command_line, false); |
| 639 | } |
msarda | fc76f66 | 2017-02-24 12:46:28 | [diff] [blame] | 640 | |
justincohen | dacc85d | 2017-06-28 23:34:10 | [diff] [blame] | 641 | // Populate command line flag for 3rd party keyboard omnibox workaround. |
| 642 | NSString* enableThirdPartyKeyboardWorkaround = |
| 643 | [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"]; |
| 644 | if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) { |
| 645 | command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround); |
| 646 | } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) { |
| 647 | command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround); |
| 648 | } |
| 649 | |
msarda | fc76f66 | 2017-02-24 12:46:28 | [diff] [blame] | 650 | ios::GetChromeBrowserProvider()->AppendSwitchesFromExperimentalSettings( |
| 651 | defaults, command_line); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 652 | } |
| 653 | |
| 654 | bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) { |
| 655 | return false; |
| 656 | } |
| 657 | |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 658 | flags_ui::FlagsState& GetGlobalFlagsState() { |
| 659 | static base::NoDestructor<flags_ui::FlagsState> flags_state( |
| 660 | kFeatureEntries, base::size(kFeatureEntries)); |
| 661 | return *flags_state; |
| 662 | } |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 663 | } // namespace |
| 664 | |
| 665 | void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage, |
| 666 | base::CommandLine* command_line) { |
Gregory Chatzinoff | 3130511 | 2017-12-20 21:56:02 | [diff] [blame] | 667 | AppendSwitchesFromExperimentalSettings(command_line); |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 668 | GetGlobalFlagsState().ConvertFlagsToSwitches( |
sdefresne | c976390 | 2015-12-02 10:30:11 | [diff] [blame] | 669 | flags_storage, command_line, flags_ui::kAddSentinels, |
Gregory Chatzinoff | f652372 | 2017-11-21 01:33:53 | [diff] [blame] | 670 | switches::kEnableFeatures, switches::kDisableFeatures); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 671 | } |
| 672 | |
jkrcal | bf07337 | 2016-07-29 07:21:31 | [diff] [blame] | 673 | std::vector<std::string> RegisterAllFeatureVariationParameters( |
| 674 | flags_ui::FlagsStorage* flags_storage, |
| 675 | base::FeatureList* feature_list) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 676 | return GetGlobalFlagsState().RegisterAllFeatureVariationParameters( |
| 677 | flags_storage, feature_list); |
jkrcal | bf07337 | 2016-07-29 07:21:31 | [diff] [blame] | 678 | } |
| 679 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 680 | void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage, |
| 681 | flags_ui::FlagAccess access, |
| 682 | base::ListValue* supported_entries, |
| 683 | base::ListValue* unsupported_entries) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 684 | GetGlobalFlagsState().GetFlagFeatureEntries( |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 685 | flags_storage, access, supported_entries, unsupported_entries, |
| 686 | base::Bind(&SkipConditionalFeatureEntry)); |
| 687 | } |
| 688 | |
| 689 | void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage, |
| 690 | const std::string& internal_name, |
| 691 | bool enable) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 692 | GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name, |
| 693 | enable); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 694 | } |
| 695 | |
| 696 | void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 697 | GetGlobalFlagsState().ResetAllFlags(flags_storage); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 698 | } |
| 699 | |
| 700 | namespace testing { |
| 701 | |
| 702 | const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) { |
kokihoon | 189a402 | 2018-10-13 02:43:44 | [diff] [blame] | 703 | *count = base::size(kFeatureEntries); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 704 | return kFeatureEntries; |
| 705 | } |
| 706 | |
| 707 | } // namespace testing |