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" |
Elly Fong-Jones | c3e9aea | 2019-10-24 19:44:19 | [diff] [blame] | 16 | #include "base/bind_helpers.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 17 | #include "base/command_line.h" |
| 18 | #include "base/logging.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" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 28 | #include "components/dom_distiller/core/dom_distiller_switches.h" |
Tommy Nyquist | c1d6dea1 | 2017-07-26 20:37:23 | [diff] [blame] | 29 | #include "components/feature_engagement/public/feature_constants.h" |
| 30 | #include "components/feature_engagement/public/feature_list.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 31 | #include "components/flags_ui/feature_entry.h" |
| 32 | #include "components/flags_ui/feature_entry_macros.h" |
| 33 | #include "components/flags_ui/flags_storage.h" |
| 34 | #include "components/flags_ui/flags_ui_switches.h" |
sczs | 27e389e | 2020-01-15 15:19:18 | [diff] [blame] | 35 | #include "components/infobars/core/infobar_feature.h" |
Tanja Gornak | b0985dd | 2018-10-11 17:24:40 | [diff] [blame] | 36 | #include "components/invalidation/impl/invalidation_switches.h" |
noyau | 4cfb133 | 2016-10-25 17:05:42 | [diff] [blame] | 37 | #include "components/ntp_tiles/switches.h" |
Justin Donnelly | 33d712e | 2017-08-23 21:32:51 | [diff] [blame] | 38 | #include "components/omnibox/browser/omnibox_field_trial.h" |
Tomasz Wiszkowski | d938a111 | 2019-03-06 18:01:57 | [diff] [blame] | 39 | #include "components/omnibox/common/omnibox_features.h" |
Ioana Pandele | d14ce9e | 2017-11-28 14:41:46 | [diff] [blame] | 40 | #include "components/password_manager/core/common/password_manager_features.h" |
mathp | 9b4c11d | 2017-07-06 20:24:13 | [diff] [blame] | 41 | #include "components/payments/core/features.h" |
Ali Juma | 01ca4ff | 2020-03-19 15:53:11 | [diff] [blame] | 42 | #include "components/safe_browsing/core/features.h" |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 43 | #include "components/security_state/core/features.h" |
Sébastien Séguin-Gagnon | dcb854b | 2019-04-10 16:36:44 | [diff] [blame] | 44 | #include "components/send_tab_to_self/features.h" |
Valeriya Sinevich | a79dc61 | 2018-09-25 14:49:09 | [diff] [blame] | 45 | #include "components/signin/core/browser/account_reconcilor.h" |
Jérôme Lebel | c374fdd | 2019-09-27 10:36:48 | [diff] [blame] | 46 | #include "components/signin/ios/browser/features.h" |
Colin Blundell | 3517170e | 2019-07-11 08:16:34 | [diff] [blame] | 47 | #include "components/signin/public/base/signin_switches.h" |
sdefresne | 3657978 | 2016-02-05 11:08:25 | [diff] [blame] | 48 | #include "components/strings/grit/components_strings.h" |
Moe Ahmadi | d6d5d17 | 2018-06-20 17:20:23 | [diff] [blame] | 49 | #include "components/sync/driver/sync_driver_switches.h" |
Mikel Astiz | e2678da2 | 2020-04-02 20:55:04 | [diff] [blame] | 50 | #include "components/sync/engine/sync_engine_switches.h" |
Moe Ahmadi | e4cce1f | 2018-12-18 23:48:01 | [diff] [blame] | 51 | #include "components/translate/core/browser/translate_prefs.h" |
Chris Lu | 0683adf | 2019-02-26 15:56:45 | [diff] [blame] | 52 | #include "components/ukm/ios/features.h" |
Sylvain Defresne | ae6987e | 2018-03-01 13:21:40 | [diff] [blame] | 53 | #include "ios/chrome/browser/browsing_data/browsing_data_features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 54 | #include "ios/chrome/browser/chrome_switches.h" |
Mike Dougherty | b6c770d | 2019-09-13 22:56:46 | [diff] [blame] | 55 | #include "ios/chrome/browser/crash_report/breadcrumbs/features.h" |
Jean-François Geyelin | 30be591 | 2017-08-25 12:05:38 | [diff] [blame] | 56 | #include "ios/chrome/browser/drag_and_drop/drag_and_drop_flag.h" |
Chris Lu | 77905ac | 2018-12-06 20:46:51 | [diff] [blame] | 57 | #include "ios/chrome/browser/find_in_page/features.h" |
Nazerke | 21bdc45a | 2019-07-11 09:02:05 | [diff] [blame] | 58 | #include "ios/chrome/browser/flags/ios_chrome_flag_descriptions.h" |
David Jean | 7d0bff1 | 2019-04-01 08:21:14 | [diff] [blame] | 59 | #include "ios/chrome/browser/passwords/password_manager_features.h" |
edchin | 6869684 | 2020-04-09 17:19:31 | [diff] [blame] | 60 | #include "ios/chrome/browser/policy/policy_features.h" |
Gauthier Ambard | 33e0330 | 2019-02-21 13:28:58 | [diff] [blame] | 61 | #include "ios/chrome/browser/system_flags.h" |
Ewann | 93ce65c | 2020-03-05 16:47:13 | [diff] [blame] | 62 | #import "ios/chrome/browser/ui/download/features.h" |
Kurt Horimoto | 4da682b02 | 2018-04-12 07:43:35 | [diff] [blame] | 63 | #import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h" |
sczs | 80a6f46 | 2018-12-05 20:37:18 | [diff] [blame] | 64 | #import "ios/chrome/browser/ui/infobars/infobar_feature.h" |
Gauthier Ambard | f2247baa | 2020-01-06 19:16:34 | [diff] [blame] | 65 | #import "ios/chrome/browser/ui/page_info/features.h" |
Tanisha Mandre | 549612ea | 2019-07-17 11:36:15 | [diff] [blame] | 66 | #include "ios/chrome/browser/ui/settings/autofill/features.h" |
sczs | 76b9ba0 | 2019-07-23 23:34:30 | [diff] [blame] | 67 | #import "ios/chrome/browser/ui/table_view/feature_flags.h" |
Mark Cogan | 02ed6c77 | 2018-05-31 17:00:51 | [diff] [blame] | 68 | #import "ios/chrome/browser/ui/toolbar/public/features.h" |
Kurt Horimoto | 79d590b | 2018-09-12 19:09:28 | [diff] [blame] | 69 | #import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h" |
Justin Cohen | 2d81c58 | 2018-01-22 14:46:44 | [diff] [blame] | 70 | #include "ios/chrome/browser/ui/ui_feature_flags.h" |
Yi Su | 392b303 | 2018-06-05 07:26:47 | [diff] [blame] | 71 | #include "ios/chrome/browser/web/features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 72 | #include "ios/chrome/grit/ios_strings.h" |
msarda | fc76f66 | 2017-02-24 12:46:28 | [diff] [blame] | 73 | #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
Eugene But | 61818bc | 2019-04-15 21:04:07 | [diff] [blame] | 74 | #include "ios/web/common/features.h" |
Eugene But | e79f274 | 2019-07-26 17:07:22 | [diff] [blame] | 75 | #include "ios/web/common/user_agent.h" |
Eugene But | b141623 | 2019-07-22 17:31:58 | [diff] [blame] | 76 | #include "ios/web/common/web_view_creation_util.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 77 | |
| 78 | #if !defined(OFFICIAL_BUILD) |
| 79 | #include "components/variations/variations_switches.h" |
vitaliii | 489217aa | 2017-01-30 14:50:22 | [diff] [blame] | 80 | #endif |
stkhapugin | c1be179 | 2016-12-13 14:30:53 | [diff] [blame] | 81 | |
| 82 | #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 83 | #error "This file requires ARC support." |
| 84 | #endif |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 85 | |
elawrence | 816f6790e | 2017-06-16 18:19:28 | [diff] [blame] | 86 | using flags_ui::FeatureEntry; |
| 87 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 88 | namespace { |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 89 | |
| 90 | const FeatureEntry::FeatureParam kMarkHttpAsDangerous[] = { |
| 91 | {security_state::features::kMarkHttpAsFeatureParameterName, |
| 92 | security_state::features::kMarkHttpAsParameterDangerous}}; |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 93 | const FeatureEntry::FeatureParam kMarkHttpAsWarningAndDangerousOnFormEdits[] = { |
| 94 | {security_state::features::kMarkHttpAsFeatureParameterName, |
| 95 | security_state::features:: |
| 96 | kMarkHttpAsParameterWarningAndDangerousOnFormEdits}}; |
Livvie Lin | c8a9ed46 | 2019-10-29 01:06:50 | [diff] [blame] | 97 | const FeatureEntry::FeatureParam kMarkHttpAsDangerWarning[] = { |
| 98 | {security_state::features::kMarkHttpAsFeatureParameterName, |
| 99 | security_state::features::kMarkHttpAsParameterDangerWarning}}; |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 100 | |
| 101 | const FeatureEntry::FeatureVariation kMarkHttpAsFeatureVariations[] = { |
| 102 | {"(mark as actively dangerous)", kMarkHttpAsDangerous, |
kokihoon | 189a402 | 2018-10-13 02:43:44 | [diff] [blame] | 103 | base::size(kMarkHttpAsDangerous), nullptr}, |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 104 | {"(mark with a Not Secure warning and dangerous on form edits)", |
| 105 | kMarkHttpAsWarningAndDangerousOnFormEdits, |
Livvie Lin | c8a9ed46 | 2019-10-29 01:06:50 | [diff] [blame] | 106 | base::size(kMarkHttpAsWarningAndDangerousOnFormEdits), nullptr}, |
| 107 | {"(mark with a grey triangle icon)", kMarkHttpAsDangerWarning, |
| 108 | base::size(kMarkHttpAsDangerWarning), nullptr}}; |
elawrence | 816f6790e | 2017-06-16 18:19:28 | [diff] [blame] | 109 | |
Olivier Robin | 3d6041162 | 2018-02-23 10:03:22 | [diff] [blame] | 110 | const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = { |
| 111 | {flags_ui::kGenericExperimentChoiceDefault, "", ""}, |
| 112 | {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"}, |
| 113 | {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"}, |
| 114 | {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"}, |
| 115 | {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"}, |
| 116 | {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"}, |
| 117 | {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"}, |
| 118 | {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"}, |
| 119 | {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"}, |
| 120 | }; |
| 121 | |
Ce Chen | 104a538 | 2019-12-10 01:09:05 | [diff] [blame] | 122 | const FeatureEntry::FeatureParam kOmniboxOnDeviceHeadSuggestAlwaysServe[] = { |
| 123 | {OmniboxFieldTrial::kOnDeviceHeadSuggestIncognitoServeMode, |
| 124 | "always-serve"}}; |
| 125 | const FeatureEntry::FeatureParam kOmniboxOnDeviceHeadSuggestIncognitoOnly[] = { |
| 126 | {OmniboxFieldTrial::kOnDeviceHeadSuggestIncognitoServeMode, |
| 127 | "incognito-only"}}; |
Ce Chen | a30d230 | 2020-02-08 02:22:19 | [diff] [blame] | 128 | const FeatureEntry::FeatureParam kOmniboxOnDeviceHeadSuggestRelevance1000[] = { |
| 129 | {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput, "1000"}, |
| 130 | {OmniboxFieldTrial::kOnDeviceHeadSuggestDemoteMode, "decrease-relevances"}}; |
| 131 | const FeatureEntry::FeatureParam |
| 132 | kOmniboxOnDeviceHeadSuggestIncognitoOnlyRelevance1000[] = { |
| 133 | {OmniboxFieldTrial::kOnDeviceHeadSuggestIncognitoServeMode, |
| 134 | "incognito-only"}, |
| 135 | {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput, |
| 136 | "1000"}}; |
| 137 | const FeatureEntry::FeatureParam kOmniboxOnDeviceHeadSuggestDelay200Ms[] = { |
| 138 | {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs, "200"}}; |
| 139 | const FeatureEntry::FeatureParam kOmniboxOnDeviceHeadSuggestDelay350Ms[] = { |
| 140 | {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs, "350"}}; |
| 141 | const FeatureEntry::FeatureParam |
| 142 | kOmniboxOnDeviceHeadSuggestDelay200MsAndRelevance1000[] = { |
| 143 | {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs, "200"}, |
| 144 | {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput, "1000"}, |
| 145 | {OmniboxFieldTrial::kOnDeviceHeadSuggestDemoteMode, |
| 146 | "decrease-relevances"}}; |
| 147 | const FeatureEntry::FeatureParam |
| 148 | kOmniboxOnDeviceHeadSuggestDelay350MsAndRelevance1000[] = { |
| 149 | {OmniboxFieldTrial::kOnDeviceHeadSuggestDelaySuggestRequestMs, "350"}, |
| 150 | {OmniboxFieldTrial::kOnDeviceHeadSuggestMaxScoreForNonUrlInput, "1000"}, |
| 151 | {OmniboxFieldTrial::kOnDeviceHeadSuggestDemoteMode, |
| 152 | "decrease-relevances"}}; |
| 153 | |
Ce Chen | 104a538 | 2019-12-10 01:09:05 | [diff] [blame] | 154 | const FeatureEntry::FeatureVariation |
Ce Chen | a30d230 | 2020-02-08 02:22:19 | [diff] [blame] | 155 | kOmniboxOnDeviceHeadSuggestExperimentVariations[] = { |
Ce Chen | 104a538 | 2019-12-10 01:09:05 | [diff] [blame] | 156 | {"both-normal-and-incognito", kOmniboxOnDeviceHeadSuggestAlwaysServe, |
| 157 | base::size(kOmniboxOnDeviceHeadSuggestAlwaysServe), nullptr}, |
| 158 | {"incognito-only", kOmniboxOnDeviceHeadSuggestIncognitoOnly, |
Ce Chen | a30d230 | 2020-02-08 02:22:19 | [diff] [blame] | 159 | base::size(kOmniboxOnDeviceHeadSuggestIncognitoOnly), nullptr}, |
| 160 | {"relevance-1000", kOmniboxOnDeviceHeadSuggestRelevance1000, |
| 161 | base::size(kOmniboxOnDeviceHeadSuggestRelevance1000), nullptr}, |
| 162 | {"incognito-only-relevance-1000", |
| 163 | kOmniboxOnDeviceHeadSuggestIncognitoOnlyRelevance1000, |
| 164 | base::size(kOmniboxOnDeviceHeadSuggestIncognitoOnlyRelevance1000), |
| 165 | nullptr}, |
| 166 | {"request-delay-200ms", kOmniboxOnDeviceHeadSuggestDelay200Ms, |
| 167 | base::size(kOmniboxOnDeviceHeadSuggestDelay200Ms), nullptr}, |
| 168 | {"request-delay-350ms", kOmniboxOnDeviceHeadSuggestDelay350Ms, |
| 169 | base::size(kOmniboxOnDeviceHeadSuggestDelay350Ms), nullptr}, |
| 170 | {"delay-200ms-relevance-1000", |
| 171 | kOmniboxOnDeviceHeadSuggestDelay200MsAndRelevance1000, |
| 172 | base::size(kOmniboxOnDeviceHeadSuggestDelay200MsAndRelevance1000), |
| 173 | nullptr}, |
| 174 | {"delay-350ms-relevance-1000", |
| 175 | kOmniboxOnDeviceHeadSuggestDelay350MsAndRelevance1000, |
| 176 | base::size(kOmniboxOnDeviceHeadSuggestDelay350MsAndRelevance1000), |
| 177 | nullptr}}; |
Ce Chen | 104a538 | 2019-12-10 01:09:05 | [diff] [blame] | 178 | |
Robbie Gibson | 6436fc4 | 2020-02-19 10:58:19 | [diff] [blame] | 179 | const FeatureEntry::FeatureParam kOmniboxNTPZPSRemote[] = { |
| 180 | {"ZeroSuggestVariant:1:*", "RemoteNoUrl"}, |
| 181 | {"ZeroSuggestVariant:7:*", "RemoteNoUrl"}, |
| 182 | {"ZeroSuggestVariant:8:*", "RemoteNoUrl"}}; |
| 183 | |
| 184 | const FeatureEntry::FeatureVariation kOmniboxOnFocusSuggestionsVariations[] = { |
| 185 | {"ZPS on NTP: Remote History", kOmniboxNTPZPSRemote, |
| 186 | base::size(kOmniboxNTPZPSRemote), "t3316653" /* variation_id */}, |
| 187 | }; |
| 188 | |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 189 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches3[] = { |
| 190 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "3"}}; |
| 191 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches4[] = { |
| 192 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "4"}}; |
| 193 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches5[] = { |
| 194 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "5"}}; |
| 195 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches6[] = { |
| 196 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "6"}}; |
| 197 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches8[] = { |
| 198 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "8"}}; |
| 199 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches10[] = { |
| 200 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "10"}}; |
| 201 | const FeatureEntry::FeatureParam kOmniboxUIMaxAutocompleteMatches12[] = { |
| 202 | {OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam, "12"}}; |
| 203 | |
| 204 | const FeatureEntry::FeatureVariation |
| 205 | kOmniboxUIMaxAutocompleteMatchesVariations[] = { |
| 206 | {"3 matches", kOmniboxUIMaxAutocompleteMatches3, |
| 207 | base::size(kOmniboxUIMaxAutocompleteMatches3), nullptr}, |
| 208 | {"4 matches", kOmniboxUIMaxAutocompleteMatches4, |
| 209 | base::size(kOmniboxUIMaxAutocompleteMatches4), nullptr}, |
| 210 | {"5 matches", kOmniboxUIMaxAutocompleteMatches5, |
| 211 | base::size(kOmniboxUIMaxAutocompleteMatches5), nullptr}, |
| 212 | {"6 matches", kOmniboxUIMaxAutocompleteMatches6, |
| 213 | base::size(kOmniboxUIMaxAutocompleteMatches6), nullptr}, |
| 214 | {"8 matches", kOmniboxUIMaxAutocompleteMatches8, |
| 215 | base::size(kOmniboxUIMaxAutocompleteMatches8), nullptr}, |
| 216 | {"10 matches", kOmniboxUIMaxAutocompleteMatches10, |
| 217 | base::size(kOmniboxUIMaxAutocompleteMatches10), nullptr}, |
| 218 | {"12 matches", kOmniboxUIMaxAutocompleteMatches12, |
| 219 | base::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}}; |
| 220 | |
Caitlin Fischer | 37e0123 | 2019-05-24 13:05:45 | [diff] [blame] | 221 | const FeatureEntry::FeatureParam |
| 222 | kAutofillUseMobileLabelDisambiguationShowAll[] = { |
| 223 | {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName, |
| 224 | autofill::features:: |
| 225 | kAutofillUseMobileLabelDisambiguationParameterShowAll}}; |
| 226 | const FeatureEntry::FeatureParam |
| 227 | kAutofillUseMobileLabelDisambiguationShowOne[] = { |
| 228 | {autofill::features::kAutofillUseMobileLabelDisambiguationParameterName, |
| 229 | autofill::features:: |
| 230 | kAutofillUseMobileLabelDisambiguationParameterShowOne}}; |
| 231 | |
| 232 | const FeatureEntry::FeatureVariation |
| 233 | kAutofillUseMobileLabelDisambiguationVariations[] = { |
| 234 | {"(show all)", kAutofillUseMobileLabelDisambiguationShowAll, |
| 235 | base::size(kAutofillUseMobileLabelDisambiguationShowAll), nullptr}, |
| 236 | {"(show one)", kAutofillUseMobileLabelDisambiguationShowOne, |
| 237 | base::size(kAutofillUseMobileLabelDisambiguationShowOne), nullptr}}; |
| 238 | |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 239 | // To add a new entry, add to the end of kFeatureEntries. There are four |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 240 | // distinct types of entries: |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 241 | // . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the |
| 242 | // default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 243 | // macro for this type supplying the command line to the macro. |
| 244 | // . MULTI_VALUE: a list of choices, the first of which should correspond to a |
| 245 | // deactivated state for this lab (i.e. no command line option). To specify |
| 246 | // this type of entry use the macro MULTI_VALUE_TYPE supplying it the |
| 247 | // array of choices. |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 248 | // . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is |
| 249 | // either enabled, disabled, or uses the default value of the associated |
| 250 | // base::Feature instance. To specify this type of entry use the macro |
| 251 | // FEATURE_VALUE_TYPE supplying it the base::Feature instance. |
| 252 | // . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a |
| 253 | // base::Feature instance. Choices corresponding to the default state, a |
| 254 | // universally enabled state, and a universally disabled state are |
| 255 | // automatically included. To specify this type of entry use the macro |
| 256 | // FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and |
| 257 | // the array of choices. |
| 258 | // |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 259 | // See the documentation of FeatureEntry for details on the fields. |
| 260 | // |
| 261 | // When adding a new choice, add it to the end of the list. |
| 262 | const flags_ui::FeatureEntry kFeatureEntries[] = { |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 263 | {"enable-mark-http-as", flag_descriptions::kMarkHttpAsName, |
elawrence | 816f6790e | 2017-06-16 18:19:28 | [diff] [blame] | 264 | flag_descriptions::kMarkHttpAsDescription, flags_ui::kOsIos, |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 265 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 266 | security_state::features::kMarkHttpAsFeature, |
| 267 | kMarkHttpAsFeatureVariations, |
| 268 | "MarkHttpAs")}, |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 269 | {"in-product-help-demo-mode-choice", |
| 270 | flag_descriptions::kInProductHelpDemoModeName, |
| 271 | flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos, |
| 272 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
Tommy Nyquist | c1d6dea1 | 2017-07-26 20:37:23 | [diff] [blame] | 273 | feature_engagement::kIPHDemoMode, |
| 274 | feature_engagement::kIPHDemoModeChoiceVariations, |
Marc Treib | 2752e8b | 2017-08-04 14:12:09 | [diff] [blame] | 275 | "IPH_DemoMode")}, |
Jean-François Geyelin | 30be591 | 2017-08-25 12:05:38 | [diff] [blame] | 276 | {"drag_and_drop", flag_descriptions::kDragAndDropName, |
| 277 | flag_descriptions::kDragAndDropDescription, flags_ui::kOsIos, |
Rohit Rao | 6a3a481d | 2017-09-25 19:31:41 | [diff] [blame] | 278 | FEATURE_VALUE_TYPE(kDragAndDrop)}, |
Eugene But | 468b6d5f0 | 2018-10-18 21:17:45 | [diff] [blame] | 279 | {"ignores-viewport-scale-limits", |
| 280 | flag_descriptions::kIgnoresViewportScaleLimitsName, |
| 281 | flag_descriptions::kIgnoresViewportScaleLimitsDescription, |
| 282 | flags_ui::kOsIos, |
| 283 | FEATURE_VALUE_TYPE(web::features::kIgnoresViewportScaleLimits)}, |
Moe Ahmadi | c3fd7cd | 2018-05-11 21:40:22 | [diff] [blame] | 284 | {"enable-autofill-credit-card-upload", |
| 285 | flag_descriptions::kAutofillCreditCardUploadName, |
| 286 | flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos, |
Anne Lim | 579b573 | 2018-08-30 18:24:24 | [diff] [blame] | 287 | FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)}, |
Himanshu Jaju | e760efb | 2019-10-17 11:07:53 | [diff] [blame] | 288 | {"enable-sync-device-info-in-transport-mode", |
| 289 | flag_descriptions::kSyncDeviceInfoInTransportModeName, |
| 290 | flag_descriptions::kSyncDeviceInfoInTransportModeDescription, |
| 291 | flags_ui::kOsIos, |
| 292 | FEATURE_VALUE_TYPE(switches::kSyncDeviceInfoInTransportMode)}, |
Moe Ahmadi | d6d5d17 | 2018-06-20 17:20:23 | [diff] [blame] | 293 | {"use-sync-sandbox", flag_descriptions::kSyncSandboxName, |
| 294 | flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos, |
| 295 | SINGLE_VALUE_TYPE_AND_VALUE( |
| 296 | switches::kSyncServiceURL, |
| 297 | "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")}, |
| 298 | {"wallet-service-use-sandbox", |
| 299 | flag_descriptions::kWalletServiceUseSandboxName, |
| 300 | flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos, |
| 301 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE( |
| 302 | autofill::switches::kWalletServiceUseSandbox, |
| 303 | "1", |
| 304 | autofill::switches::kWalletServiceUseSandbox, |
| 305 | "0")}, |
Mohamad Ahmadi | c4df81f | 2017-12-20 04:41:59 | [diff] [blame] | 306 | {"show-autofill-type-predictions", |
| 307 | flag_descriptions::kShowAutofillTypePredictionsName, |
| 308 | flag_descriptions::kShowAutofillTypePredictionsDescription, |
| 309 | flags_ui::kOsIos, |
Gauthier Ambard | cfd8518 | 2018-01-05 10:37:46 | [diff] [blame] | 310 | FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)}, |
Olivier Robin | 3d6041162 | 2018-02-23 10:03:22 | [diff] [blame] | 311 | {"autofill-ios-delay-between-fields", |
| 312 | flag_descriptions::kAutofillIOSDelayBetweenFieldsName, |
| 313 | flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription, |
| 314 | flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)}, |
Olivier Robin | d81475b0 | 2018-06-20 21:30:11 | [diff] [blame] | 315 | {"autofill-show-all-profiles-on-prefilled-forms", |
| 316 | flag_descriptions::kAutofillShowAllSuggestionsOnPrefilledFormsName, |
| 317 | flag_descriptions::kAutofillShowAllSuggestionsOnPrefilledFormsDescription, |
| 318 | flags_ui::kOsIos, |
| 319 | FEATURE_VALUE_TYPE( |
| 320 | autofill::features::kAutofillShowAllSuggestionsOnPrefilledForms)}, |
Moe Ahmadi | d3ddfcb | 2018-04-20 19:51:08 | [diff] [blame] | 321 | {"autofill-restrict-formless-form-extraction", |
| 322 | flag_descriptions::kAutofillRestrictUnownedFieldsToFormlessCheckoutName, |
| 323 | flag_descriptions:: |
| 324 | kAutofillRestrictUnownedFieldsToFormlessCheckoutDescription, |
| 325 | flags_ui::kOsIos, |
| 326 | FEATURE_VALUE_TYPE( |
| 327 | autofill::features::kAutofillRestrictUnownedFieldsToFormlessCheckout)}, |
Roger McFarlane | e193ab12 | 2018-11-22 20:55:07 | [diff] [blame] | 328 | {"autofill-rich-metadata-queries", |
| 329 | flag_descriptions::kAutofillRichMetadataQueriesName, |
| 330 | flag_descriptions::kAutofillRichMetadataQueriesDescription, |
| 331 | flags_ui::kOsIos, |
| 332 | FEATURE_VALUE_TYPE(autofill::features::kAutofillRichMetadataQueries)}, |
Kurt Horimoto | dc33af3 | 2018-05-01 01:39:14 | [diff] [blame] | 333 | {"fullscreen-viewport-adjustment-experiment", |
Chris Lu | 481a932 | 2019-09-25 22:16:53 | [diff] [blame] | 334 | flag_descriptions::kFullscreenSmoothScrollingName, |
| 335 | flag_descriptions::kFullscreenSmoothScrollingDescription, flags_ui::kOsIos, |
| 336 | FEATURE_VALUE_TYPE(fullscreen::features::kSmoothScrollingDefault)}, |
Roger McFarlane | 1a37d7b | 2018-04-20 22:45:19 | [diff] [blame] | 337 | {"autofill-enforce-min-required-fields-for-heuristics", |
| 338 | flag_descriptions::kAutofillEnforceMinRequiredFieldsForHeuristicsName, |
| 339 | flag_descriptions:: |
| 340 | kAutofillEnforceMinRequiredFieldsForHeuristicsDescription, |
| 341 | flags_ui::kOsIos, |
| 342 | FEATURE_VALUE_TYPE( |
| 343 | autofill::features::kAutofillEnforceMinRequiredFieldsForHeuristics)}, |
| 344 | {"autofill-enforce-min-required-fields-for-query", |
| 345 | flag_descriptions::kAutofillEnforceMinRequiredFieldsForQueryName, |
| 346 | flag_descriptions::kAutofillEnforceMinRequiredFieldsForQueryDescription, |
| 347 | flags_ui::kOsIos, |
| 348 | FEATURE_VALUE_TYPE( |
| 349 | autofill::features::kAutofillEnforceMinRequiredFieldsForQuery)}, |
| 350 | {"autofill-enforce-min-required-fields-for-upload", |
| 351 | flag_descriptions::kAutofillEnforceMinRequiredFieldsForUploadName, |
| 352 | flag_descriptions::kAutofillEnforceMinRequiredFieldsForUploadDescription, |
| 353 | flags_ui::kOsIos, |
| 354 | FEATURE_VALUE_TYPE( |
| 355 | autofill::features::kAutofillEnforceMinRequiredFieldsForUpload)}, |
Roger McFarlane | 2eceba98 | 2018-05-18 01:37:11 | [diff] [blame] | 356 | {"autofill-cache-query-responses", |
| 357 | flag_descriptions::kAutofillCacheQueryResponsesName, |
| 358 | flag_descriptions::kAutofillCacheQueryResponsesDescription, |
| 359 | flags_ui::kOsIos, |
| 360 | FEATURE_VALUE_TYPE(autofill::features::kAutofillCacheQueryResponses)}, |
Jeffrey Cohen | 05cdafa39 | 2018-08-15 20:49:17 | [diff] [blame] | 361 | {"autofill-enable-company-name", |
| 362 | flag_descriptions::kAutofillEnableCompanyNameName, |
| 363 | flag_descriptions::kAutofillEnableCompanyNameDescription, flags_ui::kOsIos, |
| 364 | FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableCompanyName)}, |
Yi Su | 392b303 | 2018-06-05 07:26:47 | [diff] [blame] | 365 | {"webpage-text-accessibility", |
| 366 | flag_descriptions::kWebPageTextAccessibilityName, |
| 367 | flag_descriptions::kWebPageTextAccessibilityDescription, flags_ui::kOsIos, |
| 368 | FEATURE_VALUE_TYPE(web::kWebPageTextAccessibility)}, |
Kurt Horimoto | 79d590b | 2018-09-12 19:09:28 | [diff] [blame] | 369 | {"toolbar-container", flag_descriptions::kToolbarContainerName, |
| 370 | flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos, |
| 371 | FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)}, |
Ce Chen | 20af01c | 2019-07-02 19:16:36 | [diff] [blame] | 372 | {"omnibox-on-device-head-suggestions", |
| 373 | flag_descriptions::kOmniboxOnDeviceHeadSuggestionsName, |
| 374 | flag_descriptions::kOmniboxOnDeviceHeadSuggestionsDescription, |
Ce Chen | 104a538 | 2019-12-10 01:09:05 | [diff] [blame] | 375 | flags_ui::kOsIos, |
| 376 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 377 | omnibox::kOnDeviceHeadProvider, |
Ce Chen | a30d230 | 2020-02-08 02:22:19 | [diff] [blame] | 378 | kOmniboxOnDeviceHeadSuggestExperimentVariations, |
Ce Chen | 104a538 | 2019-12-10 01:09:05 | [diff] [blame] | 379 | "OmniboxOnDeviceHeadSuggestIOS")}, |
Robbie Gibson | 6436fc4 | 2020-02-19 10:58:19 | [diff] [blame] | 380 | {"omnibox-on-focus-suggestions", |
| 381 | flag_descriptions::kOmniboxOnFocusSuggestionsName, |
| 382 | flag_descriptions::kOmniboxOnFocusSuggestionsDescription, flags_ui::kOsIos, |
| 383 | FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kOnFocusSuggestions, |
| 384 | kOmniboxOnFocusSuggestionsVariations, |
Robbie Gibson | 58a3877 | 2020-04-21 13:51:51 | [diff] [blame] | 385 | "OmniboxBundledExperimentV1")}, |
Stepan Khapugin | cc4e984 | 2019-01-23 13:38:13 | [diff] [blame] | 386 | {"omnibox-ui-max-autocomplete-matches", |
| 387 | flag_descriptions::kOmniboxUIMaxAutocompleteMatchesName, |
| 388 | flag_descriptions::kOmniboxUIMaxAutocompleteMatchesDescription, |
| 389 | flags_ui::kOsIos, |
| 390 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 391 | omnibox::kUIExperimentMaxAutocompleteMatches, |
| 392 | kOmniboxUIMaxAutocompleteMatchesVariations, |
| 393 | "OmniboxUIMaxAutocompleteVariations")}, |
sczs | 80a6f46 | 2018-12-05 20:37:18 | [diff] [blame] | 394 | {"infobar-ui-reboot", flag_descriptions::kInfobarUIRebootName, |
| 395 | flag_descriptions::kInfobarUIRebootDescription, flags_ui::kOsIos, |
sczs | 27e389e | 2020-01-15 15:19:18 | [diff] [blame] | 396 | FEATURE_VALUE_TYPE(kIOSInfobarUIReboot)}, |
Chris Lu | 77905ac | 2018-12-06 20:46:51 | [diff] [blame] | 397 | {"find-in-page-iframe", flag_descriptions::kFindInPageiFrameName, |
| 398 | flag_descriptions::kFindInPageiFrameDescription, flags_ui::kOsIos, |
| 399 | FEATURE_VALUE_TYPE(kFindInPageiFrame)}, |
Robbie Gibson | 80d732e | 2019-01-10 10:42:49 | [diff] [blame] | 400 | {"enable-clipboard-provider-image-suggestions", |
| 401 | flag_descriptions::kEnableClipboardProviderImageSuggestionsName, |
| 402 | flag_descriptions::kEnableClipboardProviderImageSuggestionsDescription, |
| 403 | flags_ui::kOsIos, |
| 404 | FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProviderImageSuggestions)}, |
edchin | 5ae0b4c | 2019-01-06 06:52:28 | [diff] [blame] | 405 | {"snapshot-draw-view", flag_descriptions::kSnapshotDrawViewName, |
| 406 | flag_descriptions::kSnapshotDrawViewDescription, flags_ui::kOsIos, |
| 407 | FEATURE_VALUE_TYPE(kSnapshotDrawView)}, |
Justin Cohen | 20b6f07 | 2019-01-16 01:38:50 | [diff] [blame] | 408 | #if defined(DCHECK_IS_CONFIGURABLE) |
| 409 | {"dcheck-is-fatal", flag_descriptions::kDcheckIsFatalName, |
| 410 | flag_descriptions::kDcheckIsFatalDescription, flags_ui::kOsIos, |
| 411 | FEATURE_VALUE_TYPE(base::kDCheckIsFatalFeature)}, |
| 412 | #endif // defined(DCHECK_IS_CONFIGURABLE) |
Gauthier Ambard | 5f61086 | 2019-01-17 11:43:55 | [diff] [blame] | 413 | {"settings-refresh", flag_descriptions::kSettingsRefreshName, |
| 414 | flag_descriptions::kSettingsRefreshDescription, flags_ui::kOsIos, |
| 415 | FEATURE_VALUE_TYPE(kSettingsRefresh)}, |
Chris Lu | 8153e6e | 2019-03-26 16:28:21 | [diff] [blame] | 416 | {"send-uma-cellular", flag_descriptions::kSendUmaOverAnyNetwork, |
| 417 | flag_descriptions::kSendUmaOverAnyNetworkDescription, flags_ui::kOsIos, |
Chris Lu | 0683adf | 2019-02-26 15:56:45 | [diff] [blame] | 418 | FEATURE_VALUE_TYPE(kUmaCellular)}, |
Jared Saul | 8c22493 | 2019-03-12 15:01:18 | [diff] [blame] | 419 | {"autofill-no-local-save-on-upload-success", |
| 420 | flag_descriptions::kAutofillNoLocalSaveOnUploadSuccessName, |
| 421 | flag_descriptions::kAutofillNoLocalSaveOnUploadSuccessDescription, |
| 422 | flags_ui::kOsIos, |
| 423 | FEATURE_VALUE_TYPE( |
| 424 | autofill::features::kAutofillNoLocalSaveOnUploadSuccess)}, |
Jared Saul | 63f598a1 | 2019-03-22 23:40:26 | [diff] [blame] | 425 | {"autofill-no-local-save-on-unmask-success", |
| 426 | flag_descriptions::kAutofillNoLocalSaveOnUnmaskSuccessName, |
| 427 | flag_descriptions::kAutofillNoLocalSaveOnUnmaskSuccessDescription, |
| 428 | flags_ui::kOsIos, |
| 429 | FEATURE_VALUE_TYPE( |
| 430 | autofill::features::kAutofillNoLocalSaveOnUnmaskSuccess)}, |
Robbie Gibson | 5cf28c6a | 2019-11-22 18:26:37 | [diff] [blame] | 431 | {"omnibox-preserve-default-match-against-async-update", |
| 432 | flag_descriptions::kOmniboxPreserveDefaultMatchAgainstAsyncUpdateName, |
| 433 | flag_descriptions:: |
| 434 | kOmniboxPreserveDefaultMatchAgainstAsyncUpdateDescription, |
| 435 | flags_ui::kOsIos, |
| 436 | FEATURE_VALUE_TYPE( |
| 437 | omnibox::kOmniboxPreserveDefaultMatchAgainstAsyncUpdate)}, |
Sébastien Séguin-Gagnon | 3048192 | 2019-04-24 21:31:00 | [diff] [blame] | 438 | {"enable-send-tab-to-self-broadcast", |
| 439 | flag_descriptions::kSendTabToSelfBroadcastName, |
| 440 | flag_descriptions::kSendTabToSelfBroadcastDescription, flags_ui::kOsIos, |
| 441 | FEATURE_VALUE_TYPE(send_tab_to_self::kSendTabToSelfBroadcast)}, |
Caitlin Fischer | 43edd90a | 2019-05-01 13:24:30 | [diff] [blame] | 442 | {"autofill-use-mobile-label-disambiguation", |
| 443 | flag_descriptions::kAutofillUseMobileLabelDisambiguationName, |
| 444 | flag_descriptions::kAutofillUseMobileLabelDisambiguationDescription, |
| 445 | flags_ui::kOsIos, |
Caitlin Fischer | 37e0123 | 2019-05-24 13:05:45 | [diff] [blame] | 446 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 447 | autofill::features::kAutofillUseMobileLabelDisambiguation, |
| 448 | kAutofillUseMobileLabelDisambiguationVariations, |
| 449 | "AutofillUseMobileLabelDisambiguation")}, |
edchin | b5d9258 | 2020-03-11 15:26:11 | [diff] [blame] | 450 | {"autofill-prune-suggestions", |
Caitlin Fischer | 6d60954 | 2019-05-01 21:59:21 | [diff] [blame] | 451 | flag_descriptions::kAutofillPruneSuggestionsName, |
| 452 | flag_descriptions::kAutofillPruneSuggestionsDescription, flags_ui::kOsIos, |
| 453 | FEATURE_VALUE_TYPE(autofill::features::kAutofillPruneSuggestions)}, |
Mikel Astiz | e2678da2 | 2020-04-02 20:55:04 | [diff] [blame] | 454 | {"enable-sync-trusted-vault", |
| 455 | flag_descriptions::kEnableSyncTrustedVaultName, |
| 456 | flag_descriptions::kEnableSyncTrustedVaultDescription, flags_ui::kOsIos, |
| 457 | FEATURE_VALUE_TYPE(switches::kSyncSupportTrustedVaultPassphrase)}, |
Maksim Moskvitin | 35b09c1bf | 2019-06-28 17:29:48 | [diff] [blame] | 458 | {"enable-sync-uss-nigori", flag_descriptions::kEnableSyncUSSNigoriName, |
| 459 | flag_descriptions::kEnableSyncUSSNigoriDescription, flags_ui::kOsIos, |
| 460 | FEATURE_VALUE_TYPE(switches::kSyncUSSNigori)}, |
sczs | 76b9ba0 | 2019-07-23 23:34:30 | [diff] [blame] | 461 | {"collections-card-presentation-style", |
| 462 | flag_descriptions::kCollectionsCardPresentationStyleName, |
| 463 | flag_descriptions::kCollectionsCardPresentationStyleDescription, |
| 464 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kCollectionsCardPresentationStyle)}, |
Jared Saul | 3f520c6 | 2019-09-03 23:58:12 | [diff] [blame] | 465 | {"enable-autofill-credit-card-upload-editable-expiration-date", |
| 466 | flag_descriptions:: |
| 467 | kEnableAutofillCreditCardUploadEditableExpirationDateName, |
| 468 | flag_descriptions:: |
| 469 | kEnableAutofillCreditCardUploadEditableExpirationDateDescription, |
| 470 | flags_ui::kOsIos, |
| 471 | FEATURE_VALUE_TYPE( |
| 472 | autofill::features::kAutofillUpstreamEditableExpirationDate)}, |
Tanisha Mandre | 3a14d38 | 2019-09-05 17:33:44 | [diff] [blame] | 473 | {"credit-card-scanner", flag_descriptions::kCreditCardScannerName, |
| 474 | flag_descriptions::kCreditCardScannerDescription, flags_ui::kOsIos, |
| 475 | FEATURE_VALUE_TYPE(kCreditCardScanner)}, |
Mike Dougherty | b6c770d | 2019-09-13 22:56:46 | [diff] [blame] | 476 | {"ios-breadcrumbs", flag_descriptions::kLogBreadcrumbsName, |
| 477 | flag_descriptions::kLogBreadcrumbsDescription, flags_ui::kOsIos, |
| 478 | FEATURE_VALUE_TYPE(kLogBreadcrumbs)}, |
Jérôme Lebel | c374fdd | 2019-09-27 10:36:48 | [diff] [blame] | 479 | {"force-startup-signin-promo", |
| 480 | flag_descriptions::kForceStartupSigninPromoName, |
| 481 | flag_descriptions::kForceStartupSigninPromoDescription, flags_ui::kOsIos, |
| 482 | FEATURE_VALUE_TYPE(signin::kForceStartupSigninPromo)}, |
Justin Cohen | c57413a | 2019-09-30 19:42:29 | [diff] [blame] | 483 | {"embedder-block-restore-url", |
| 484 | flag_descriptions::kEmbedderBlockRestoreUrlName, |
| 485 | flag_descriptions::kEmbedderBlockRestoreUrlDescription, flags_ui::kOsIos, |
| 486 | FEATURE_VALUE_TYPE(kEmbedderBlockRestoreUrl)}, |
sczs | 6c3202e | 2019-10-01 00:22:46 | [diff] [blame] | 487 | {"messages-confirm-infobars", |
| 488 | flag_descriptions::kConfirmInfobarMessagesUIName, |
| 489 | flag_descriptions::kConfirmInfobarMessagesUIDescription, flags_ui::kOsIos, |
| 490 | FEATURE_VALUE_TYPE(kConfirmInfobarMessagesUI)}, |
David Jean | a9bf62b | 2019-10-04 11:53:36 | [diff] [blame] | 491 | {"disable-animation-on-low-battery", |
| 492 | flag_descriptions::kDisableAnimationOnLowBatteryName, |
| 493 | flag_descriptions::kDisableAnimationOnLowBatteryDescription, |
| 494 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDisableAnimationOnLowBattery)}, |
sczs | 004fa6c | 2019-10-18 17:22:52 | [diff] [blame] | 495 | {"messages-save-card-infobar", |
| 496 | flag_descriptions::kSaveCardInfobarMessagesUIName, |
| 497 | flag_descriptions::kSaveCardInfobarMessagesUIDescription, flags_ui::kOsIos, |
| 498 | FEATURE_VALUE_TYPE(kSaveCardInfobarMessagesUI)}, |
Chris Lu | 4cc111b45 | 2019-10-18 22:18:48 | [diff] [blame] | 499 | {"messages-translate-infobar", |
| 500 | flag_descriptions::kTranslateInfobarMessagesUIName, |
| 501 | flag_descriptions::kTranslateInfobarMessagesUIDescription, |
| 502 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kTranslateInfobarMessagesUI)}, |
sczs | 4622e6e | 2019-11-06 01:17:59 | [diff] [blame] | 503 | {"autofill-save-card-dismiss-on-navigation", |
| 504 | flag_descriptions::kAutofillSaveCardDismissOnNavigationName, |
| 505 | flag_descriptions::kAutofillSaveCardDismissOnNavigationDescription, |
| 506 | flags_ui::kOsIos, |
| 507 | FEATURE_VALUE_TYPE( |
| 508 | autofill::features::kAutofillSaveCardDismissOnNavigation)}, |
Ewann | 6674c13 | 2019-11-06 11:20:41 | [diff] [blame] | 509 | {"enable-persistent-downloads", |
| 510 | flag_descriptions::kEnablePersistentDownloadsName, |
| 511 | flag_descriptions::kEnablePersistentDownloadsDescription, flags_ui::kOsIos, |
| 512 | FEATURE_VALUE_TYPE(web::features::kEnablePersistentDownloads)}, |
Rohit Rao | e7b48931 | 2019-11-12 12:28:55 | [diff] [blame] | 513 | {"force-unstacked-tabstrip", flag_descriptions::kForceUnstackedTabstripName, |
| 514 | flag_descriptions::kForceUnstackedTabstripDescription, flags_ui::kOsIos, |
| 515 | FEATURE_VALUE_TYPE(kForceUnstackedTabstrip)}, |
Gauthier Ambard | 9391400 | 2019-11-14 12:56:12 | [diff] [blame] | 516 | {"use-js-error-page", flag_descriptions::kUseJSForErrorPageName, |
| 517 | flag_descriptions::kUseJSForErrorPageDescription, flags_ui::kOsIos, |
| 518 | FEATURE_VALUE_TYPE(web::features::kUseJSForErrorPage)}, |
Javier Ernesto Flores Robles | 73cf70ab | 2019-11-15 14:34:07 | [diff] [blame] | 519 | {"messages-download-infobar", |
| 520 | flag_descriptions::kDownloadInfobarMessagesUIName, |
| 521 | flag_descriptions::kDownloadInfobarMessagesUIDescription, flags_ui::kOsIos, |
| 522 | FEATURE_VALUE_TYPE(kDownloadInfobarMessagesUI)}, |
Gauthier Ambard | bde9def | 2019-11-19 18:04:33 | [diff] [blame] | 523 | {"desktop-version-default", flag_descriptions::kDefaultToDesktopOnIPadName, |
| 524 | flag_descriptions::kDefaultToDesktopOnIPadDescription, flags_ui::kOsIos, |
Gauthier Ambard | 054175f | 2019-12-16 11:54:09 | [diff] [blame] | 525 | FEATURE_VALUE_TYPE(web::features::kUseDefaultUserAgentInWebClient)}, |
Gauthier Ambard | bde9def | 2019-11-19 18:04:33 | [diff] [blame] | 526 | {"mobile-google-srp", flag_descriptions::kMobileGoogleSRPName, |
| 527 | flag_descriptions::kMobileGoogleSRPDescription, flags_ui::kOsIos, |
| 528 | FEATURE_VALUE_TYPE(web::kMobileGoogleSRP)}, |
sczs | 3bede828 | 2019-11-27 14:16:54 | [diff] [blame] | 529 | {"messages-crash-restore-infobars", |
| 530 | flag_descriptions::kCrashRestoreInfobarMessagesUIName, |
| 531 | flag_descriptions::kCrashRestoreInfobarMessagesUIDescription, |
| 532 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kCrashRestoreInfobarMessagesUI)}, |
Kurt Horimoto | d754e8ec | 2019-12-03 20:54:02 | [diff] [blame] | 533 | {"infobar-overlay-ui", flag_descriptions::kInfobarOverlayUIName, |
| 534 | flag_descriptions::kInfobarOverlayUIDescription, flags_ui::kOsIos, |
| 535 | FEATURE_VALUE_TYPE(kInfobarOverlayUI)}, |
sczs | 391ebba | 2019-12-05 06:59:30 | [diff] [blame] | 536 | {"autofill-save-card-infobar-edit-support", |
| 537 | flag_descriptions::kAutofillSaveCardInfobarEditSupportName, |
| 538 | flag_descriptions::kAutofillSaveCardInfobarEditSupportDescription, |
| 539 | flags_ui::kOsIos, |
| 540 | FEATURE_VALUE_TYPE( |
| 541 | autofill::features::kAutofillSaveCardInfobarEditSupport)}, |
Gauthier Ambard | cd302c4 | 2019-12-11 09:56:50 | [diff] [blame] | 542 | {"reload-sad-tab", flag_descriptions::kReloadSadTabName, |
| 543 | flag_descriptions::kReloadSadTabDescription, flags_ui::kOsIos, |
| 544 | FEATURE_VALUE_TYPE(web::kReloadSadTab)}, |
Ewann | 9b6b8a2 | 2020-03-24 08:59:36 | [diff] [blame] | 545 | {"page-info-chrome-guard", flag_descriptions::kPageInfoChromeGuardName, |
| 546 | flag_descriptions::kPageInfoChromeGuardDescription, flags_ui::kOsIos, |
| 547 | FEATURE_VALUE_TYPE(kPageInfoChromeGuard)}, |
Gauthier Ambard | f2247baa | 2020-01-06 19:16:34 | [diff] [blame] | 548 | {"page-info-refactoring", flag_descriptions::kPageInfoRefactoringName, |
| 549 | flag_descriptions::kPageInfoRefactoringDescription, flags_ui::kOsIos, |
Gauthier Ambard | e813c07f | 2020-01-09 10:18:49 | [diff] [blame] | 550 | FEATURE_VALUE_TYPE(kPageInfoRefactoring)}, |
| 551 | {"contained-browser-bvc", flag_descriptions::kContainedBVCName, |
| 552 | flag_descriptions::kContainedBVCDescription, flags_ui::kOsIos, |
| 553 | FEATURE_VALUE_TYPE(kContainedBVC)}, |
Nohemi Fernandez | 6b6260a | 2020-01-17 16:53:45 | [diff] [blame] | 554 | {"clear-synced-data", flag_descriptions::kClearSyncedDataName, |
| 555 | flag_descriptions::kClearSyncedDataDescription, flags_ui::kOsIos, |
| 556 | FEATURE_VALUE_TYPE(kClearSyncedData)}, |
Livvie Lin | b861cba | 2020-01-22 01:54:47 | [diff] [blame] | 557 | {"ssl-committed-interstitials", |
| 558 | flag_descriptions::kSSLCommittedInterstitialsName, |
| 559 | flag_descriptions::kSSLCommittedInterstitialsDescription, flags_ui::kOsIos, |
| 560 | FEATURE_VALUE_TYPE(web::features::kSSLCommittedInterstitials)}, |
Ewann | 62d2d9c | 2020-01-22 13:47:19 | [diff] [blame] | 561 | {"change-tab-switcher-position", |
| 562 | flag_descriptions::kChangeTabSwitcherPositionName, |
| 563 | flag_descriptions::kChangeTabSwitcherPositionDescription, flags_ui::kOsIos, |
| 564 | FEATURE_VALUE_TYPE(kChangeTabSwitcherPosition)}, |
Chris Lu | f7c9b07 | 2020-01-23 17:57:32 | [diff] [blame] | 565 | {"fullscreen-controller-browser-scoped", |
| 566 | flag_descriptions::kFullscreenControllerBrowserScopedName, |
| 567 | flag_descriptions::kFullscreenControllerBrowserScopedDescription, |
| 568 | flags_ui::kOsIos, |
| 569 | FEATURE_VALUE_TYPE( |
| 570 | fullscreen::features::kFullscreenControllerBrowserScoped)}, |
Ewann | 93ce65c | 2020-03-05 16:47:13 | [diff] [blame] | 571 | {"open-downloads-in-files.app", |
| 572 | flag_descriptions::kOpenDownloadsInFilesAppName, |
| 573 | flag_descriptions::kOpenDownloadsInFilesAppDescription, flags_ui::kOsIos, |
| 574 | FEATURE_VALUE_TYPE(kOpenDownloadsInFilesApp)}, |
Livvie Lin | 5e09591 | 2020-03-18 18:16:28 | [diff] [blame] | 575 | {"ios-lookalike-url-navigation-suggestions-ui", |
| 576 | flag_descriptions::kIOSLookalikeUrlNavigationSuggestionsUIName, |
| 577 | flag_descriptions::kIOSLookalikeUrlNavigationSuggestionsUIDescription, |
| 578 | flags_ui::kOsIos, |
| 579 | FEATURE_VALUE_TYPE( |
| 580 | web::features::kIOSLookalikeUrlNavigationSuggestionsUI)}, |
Ali Juma | 01ca4ff | 2020-03-19 15:53:11 | [diff] [blame] | 581 | {"safe-browsing-available", flag_descriptions::kSafeBrowsingAvailableName, |
| 582 | flag_descriptions::kSafeBrowsingAvailableDescription, flags_ui::kOsIos, |
| 583 | FEATURE_VALUE_TYPE(safe_browsing::kSafeBrowsingAvailableOnIOS)}, |
Nohemi Fernandez | 41e256e | 2020-03-25 11:52:11 | [diff] [blame] | 584 | {"new-signin-architecture", flag_descriptions::kNewSigninArchitectureName, |
| 585 | flag_descriptions::kNewSigninArchitectureDescription, flags_ui::kOsIos, |
| 586 | FEATURE_VALUE_TYPE(kNewSigninArchitecture)}, |
Sebastien Lalancette | 8b011b3 | 2020-03-27 13:31:24 | [diff] [blame] | 587 | {"qr-code-generation", flag_descriptions::kQRCodeGenerationName, |
| 588 | flag_descriptions::kQRCodeGenerationDescription, flags_ui::kOsIos, |
| 589 | FEATURE_VALUE_TYPE(kQRCodeGeneration)}, |
Sujie Zhu | 2b17c00a | 2020-04-08 21:09:41 | [diff] [blame] | 590 | {"autofill-enable-surfacing-server-card-nickname", |
| 591 | flag_descriptions::kAutofillEnableSurfacingServerCardNicknameName, |
| 592 | flag_descriptions::kAutofillEnableSurfacingServerCardNicknameDescription, |
| 593 | flags_ui::kOsIos, |
| 594 | FEATURE_VALUE_TYPE( |
| 595 | autofill::features::kAutofillEnableSurfacingServerCardNickname)}, |
edchin | 6869684 | 2020-04-09 17:19:31 | [diff] [blame] | 596 | {"managed-bookmarks-ios", flag_descriptions::kManagedBookmarksIOSName, |
| 597 | flag_descriptions::kManagedBookmarksIOSDescription, flags_ui::kOsIos, |
| 598 | FEATURE_VALUE_TYPE(kManagedBookmarksIOS)}, |
Anne Lim | e49c5cb | 2020-04-15 03:20:59 | [diff] [blame] | 599 | {"enable-autofill-cache-server-card-info", |
| 600 | flag_descriptions::kEnableAutofillCacheServerCardInfoName, |
| 601 | flag_descriptions::kEnableAutofillCacheServerCardInfoDescription, |
| 602 | flags_ui::kOsIos, |
| 603 | FEATURE_VALUE_TYPE(autofill::features::kAutofillCacheServerCardInfo)}, |
sczs | 5b8ac5f | 2020-04-17 16:23:20 | [diff] [blame] | 604 | {"infobar-ui-reboot-only-ios13", |
| 605 | flag_descriptions::kInfobarUIRebootOnlyiOS13Name, |
| 606 | flag_descriptions::kInfobarUIRebootOnlyiOS13Description, flags_ui::kOsIos, |
| 607 | FEATURE_VALUE_TYPE(kInfobarUIRebootOnlyiOS13)}, |
edchin | 39d08d6 | 2020-04-20 13:11:24 | [diff] [blame] | 608 | {"edit-bookmarks-ios", flag_descriptions::kEditBookmarksIOSName, |
| 609 | flag_descriptions::kEditBookmarksIOSDescription, flags_ui::kOsIos, |
| 610 | FEATURE_VALUE_TYPE(kEditBookmarksIOS)}, |
Mike Dougherty | 76838950 | 2020-04-21 08:28:35 | [diff] [blame] | 611 | {"url-blocklist-ios", flag_descriptions::kURLBlocklistIOSName, |
| 612 | flag_descriptions::kURLBlocklistIOSDescription, flags_ui::kOsIos, |
| 613 | FEATURE_VALUE_TYPE(kURLBlocklistIOS)}, |
Gauthier Ambard | e813c07f | 2020-01-09 10:18:49 | [diff] [blame] | 614 | }; |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 615 | |
| 616 | // Add all switches from experimental flags to |command_line|. |
| 617 | void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) { |
| 618 | NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
| 619 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 620 | // Set the UA flag if UseMobileSafariUA is enabled. |
| 621 | if ([defaults boolForKey:@"UseMobileSafariUA"]) { |
| 622 | // Safari uses "Vesion/", followed by the OS version excluding bugfix, where |
| 623 | // Chrome puts its product token. |
avi | 57194367 | 2015-12-22 02:12:49 | [diff] [blame] | 624 | int32_t major = 0; |
| 625 | int32_t minor = 0; |
| 626 | int32_t bugfix = 0; |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 627 | base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); |
| 628 | std::string product = base::StringPrintf("Version/%d.%d", major, minor); |
| 629 | |
Gauthier Ambard | 2294548 | 2019-11-29 14:02:21 | [diff] [blame] | 630 | command_line->AppendSwitchASCII( |
| 631 | switches::kUserAgent, |
| 632 | web::BuildUserAgentFromProduct(web::UserAgentType::MOBILE, product)); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 633 | } |
| 634 | |
| 635 | // Freeform commandline flags. These are added last, so that any flags added |
| 636 | // earlier in this function take precedence. |
| 637 | if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) { |
| 638 | base::CommandLine::StringVector flags; |
| 639 | // Append an empty "program" argument. |
| 640 | flags.push_back(""); |
| 641 | |
| 642 | // The number of flags corresponds to the number of text fields in |
| 643 | // Experimental.plist. |
| 644 | const int kNumFreeformFlags = 5; |
| 645 | for (int i = 1; i <= kNumFreeformFlags; ++i) { |
| 646 | NSString* key = |
| 647 | [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i]; |
| 648 | NSString* flag = [defaults stringForKey:key]; |
| 649 | if ([flag length]) { |
Robbie Gibson | c91ce62 | 2019-05-20 14:44:33 | [diff] [blame] | 650 | // iOS keyboard replaces -- with —, so undo that. |
| 651 | flag = [flag stringByReplacingOccurrencesOfString:@"—" |
| 652 | withString:@"--" |
| 653 | options:0 |
| 654 | range:NSMakeRange(0, 1)]; |
| 655 | // To make things easier, allow flags with no dashes by prepending them |
| 656 | // here. This also allows for flags that just have one dash if they |
| 657 | // exist. |
| 658 | if (![flag hasPrefix:@"-"]) { |
| 659 | flag = [@"--" stringByAppendingString:flag]; |
| 660 | } |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 661 | flags.push_back(base::SysNSStringToUTF8(flag)); |
| 662 | } |
| 663 | } |
| 664 | |
| 665 | base::CommandLine temp_command_line(flags); |
| 666 | command_line->AppendArguments(temp_command_line, false); |
| 667 | } |
msarda | fc76f66 | 2017-02-24 12:46:28 | [diff] [blame] | 668 | |
justincohen | dacc85d | 2017-06-28 23:34:10 | [diff] [blame] | 669 | // Populate command line flag for 3rd party keyboard omnibox workaround. |
| 670 | NSString* enableThirdPartyKeyboardWorkaround = |
| 671 | [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"]; |
| 672 | if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) { |
| 673 | command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround); |
| 674 | } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) { |
| 675 | command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround); |
| 676 | } |
| 677 | |
msarda | fc76f66 | 2017-02-24 12:46:28 | [diff] [blame] | 678 | ios::GetChromeBrowserProvider()->AppendSwitchesFromExperimentalSettings( |
| 679 | defaults, command_line); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 680 | } |
| 681 | |
| 682 | bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) { |
| 683 | return false; |
| 684 | } |
| 685 | |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 686 | flags_ui::FlagsState& GetGlobalFlagsState() { |
Elly Fong-Jones | 3cd7528 | 2019-11-12 20:26:50 | [diff] [blame] | 687 | static base::NoDestructor<flags_ui::FlagsState> flags_state(kFeatureEntries, |
| 688 | nullptr); |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 689 | return *flags_state; |
| 690 | } |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 691 | } // namespace |
| 692 | |
| 693 | void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage, |
| 694 | base::CommandLine* command_line) { |
Gregory Chatzinoff | 3130511 | 2017-12-20 21:56:02 | [diff] [blame] | 695 | AppendSwitchesFromExperimentalSettings(command_line); |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 696 | GetGlobalFlagsState().ConvertFlagsToSwitches( |
sdefresne | c976390 | 2015-12-02 10:30:11 | [diff] [blame] | 697 | flags_storage, command_line, flags_ui::kAddSentinels, |
Gregory Chatzinoff | f652372 | 2017-11-21 01:33:53 | [diff] [blame] | 698 | switches::kEnableFeatures, switches::kDisableFeatures); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 699 | } |
| 700 | |
jkrcal | bf07337 | 2016-07-29 07:21:31 | [diff] [blame] | 701 | std::vector<std::string> RegisterAllFeatureVariationParameters( |
| 702 | flags_ui::FlagsStorage* flags_storage, |
| 703 | base::FeatureList* feature_list) { |
Justin Cohen | 2e2adb5 | 2019-10-25 17:00:02 | [diff] [blame] | 704 | // Occasionally DCHECK crashes on canary can be very distuptive. An |
| 705 | // experimental flag was added to aid in temporarily disabling this for |
| 706 | // canary testers. |
| 707 | #if defined(DCHECK_IS_CONFIGURABLE) |
| 708 | if (experimental_flags::AreDCHECKCrashesDisabled()) { |
| 709 | std::vector<base::FeatureList::FeatureOverrideInfo> overrides; |
| 710 | overrides.push_back( |
| 711 | {std::cref(base::kDCheckIsFatalFeature), |
| 712 | base::FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE}); |
| 713 | feature_list->RegisterExtraFeatureOverrides(std::move(overrides)); |
| 714 | } |
| 715 | #endif // defined(DCHECK_IS_CONFIGURABLE) |
| 716 | |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 717 | return GetGlobalFlagsState().RegisterAllFeatureVariationParameters( |
| 718 | flags_storage, feature_list); |
jkrcal | bf07337 | 2016-07-29 07:21:31 | [diff] [blame] | 719 | } |
| 720 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 721 | void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage, |
| 722 | flags_ui::FlagAccess access, |
| 723 | base::ListValue* supported_entries, |
| 724 | base::ListValue* unsupported_entries) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 725 | GetGlobalFlagsState().GetFlagFeatureEntries( |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 726 | flags_storage, access, supported_entries, unsupported_entries, |
| 727 | base::Bind(&SkipConditionalFeatureEntry)); |
| 728 | } |
| 729 | |
| 730 | void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage, |
| 731 | const std::string& internal_name, |
| 732 | bool enable) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 733 | GetGlobalFlagsState().SetFeatureEntryEnabled(flags_storage, internal_name, |
| 734 | enable); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 735 | } |
| 736 | |
| 737 | void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) { |
Sylvain Defresne | 8327a2f | 2019-01-17 14:19:18 | [diff] [blame] | 738 | GetGlobalFlagsState().ResetAllFlags(flags_storage); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 739 | } |
| 740 | |
| 741 | namespace testing { |
| 742 | |
| 743 | const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) { |
kokihoon | 189a402 | 2018-10-13 02:43:44 | [diff] [blame] | 744 | *count = base::size(kFeatureEntries); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 745 | return kFeatureEntries; |
| 746 | } |
| 747 | |
| 748 | } // namespace testing |