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 | |
| 8 | #include "ios/chrome/browser/about_flags.h" |
| 9 | |
avi | 57194367 | 2015-12-22 02:12:49 | [diff] [blame] | 10 | #include <stddef.h> |
| 11 | #include <stdint.h> |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 12 | #import <UIKit/UIKit.h> |
| 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" |
avi | 57194367 | 2015-12-22 02:12:49 | [diff] [blame] | 18 | #include "base/macros.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 19 | #include "base/memory/singleton.h" |
| 20 | #include "base/strings/stringprintf.h" |
| 21 | #include "base/strings/sys_string_conversions.h" |
| 22 | #include "base/sys_info.h" |
Mohamad Ahmadi | c4df81f | 2017-12-20 04:41:59 | [diff] [blame] | 23 | #include "components/autofill/core/common/autofill_features.h" |
Moe Ahmadi | d6d5d17 | 2018-06-20 17:20:23 | [diff] [blame] | 24 | #include "components/autofill/core/common/autofill_switches.h" |
Olivier Robin | 3d6041162 | 2018-02-23 10:03:22 | [diff] [blame] | 25 | #include "components/autofill/ios/browser/autofill_switches.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 26 | #include "components/dom_distiller/core/dom_distiller_switches.h" |
Tommy Nyquist | c1d6dea1 | 2017-07-26 20:37:23 | [diff] [blame] | 27 | #include "components/feature_engagement/public/feature_constants.h" |
| 28 | #include "components/feature_engagement/public/feature_list.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 29 | #include "components/flags_ui/feature_entry.h" |
| 30 | #include "components/flags_ui/feature_entry_macros.h" |
| 31 | #include "components/flags_ui/flags_storage.h" |
| 32 | #include "components/flags_ui/flags_ui_switches.h" |
noyau | 4cfb133 | 2016-10-25 17:05:42 | [diff] [blame] | 33 | #include "components/ntp_tiles/switches.h" |
Justin Donnelly | 33d712e | 2017-08-23 21:32:51 | [diff] [blame] | 34 | #include "components/omnibox/browser/omnibox_field_trial.h" |
Ioana Pandele | d14ce9e | 2017-11-28 14:41:46 | [diff] [blame] | 35 | #include "components/password_manager/core/common/password_manager_features.h" |
mathp | 9b4c11d | 2017-07-06 20:24:13 | [diff] [blame] | 36 | #include "components/payments/core/features.h" |
Marc Treib | 5fc99e1f | 2017-11-08 12:19:18 | [diff] [blame] | 37 | #include "components/search_provider_logos/switches.h" |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 38 | #include "components/security_state/core/features.h" |
David Roger | a6c8812 | 2017-10-25 13:02:46 | [diff] [blame] | 39 | #include "components/signin/core/browser/signin_switches.h" |
sdefresne | 3657978 | 2016-02-05 11:08:25 | [diff] [blame] | 40 | #include "components/strings/grit/components_strings.h" |
Moe Ahmadi | d6d5d17 | 2018-06-20 17:20:23 | [diff] [blame] | 41 | #include "components/sync/driver/sync_driver_switches.h" |
Mihai Sardarescu | 160ec66 | 2018-07-18 21:13:51 | [diff] [blame] | 42 | #include "components/unified_consent/feature.h" |
mrefaat | 4539b03 | 2018-08-02 22:25:45 | [diff] [blame] | 43 | #include "ios/chrome/browser/app_launcher/app_launcher_flags.h" |
Sylvain Defresne | ae6987e | 2018-03-01 13:21:40 | [diff] [blame] | 44 | #include "ios/chrome/browser/browsing_data/browsing_data_features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 45 | #include "ios/chrome/browser/chrome_switches.h" |
Jean-François Geyelin | 30be591 | 2017-08-25 12:05:38 | [diff] [blame] | 46 | #include "ios/chrome/browser/drag_and_drop/drag_and_drop_flag.h" |
vabr | 0215a8e | 2017-03-28 12:47:34 | [diff] [blame] | 47 | #include "ios/chrome/browser/ios_chrome_flag_descriptions.h" |
mrefaat | 390f99c0d | 2018-05-10 19:44:24 | [diff] [blame] | 48 | #include "ios/chrome/browser/itunes_urls/itunes_urls_flag.h" |
Daniel Blakemore | 72387d3 | 2018-02-13 23:45:55 | [diff] [blame] | 49 | #include "ios/chrome/browser/mailto/features.h" |
Mike Dougherty | a5e5ad5 | 2017-08-05 00:11:58 | [diff] [blame] | 50 | #include "ios/chrome/browser/ssl/captive_portal_features.h" |
Louis Romero | d11747a | 2017-10-20 20:10:35 | [diff] [blame] | 51 | #include "ios/chrome/browser/ui/external_search/features.h" |
Kurt Horimoto | 4da682b02 | 2018-04-12 07:43:35 | [diff] [blame] | 52 | #import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h" |
Mark Cogan | 02ed6c77 | 2018-05-31 17:00:51 | [diff] [blame] | 53 | #import "ios/chrome/browser/ui/history/features.h" |
Rohit Rao | 6a3a481d | 2017-09-25 19:31:41 | [diff] [blame] | 54 | #include "ios/chrome/browser/ui/main/main_feature_flags.h" |
Mark Cogan | 02ed6c77 | 2018-05-31 17:00:51 | [diff] [blame] | 55 | #import "ios/chrome/browser/ui/toolbar/public/features.h" |
Kurt Horimoto | 79d590b | 2018-09-12 19:09:28 | [diff] [blame^] | 56 | #import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h" |
Justin Cohen | 2d81c58 | 2018-01-22 14:46:44 | [diff] [blame] | 57 | #include "ios/chrome/browser/ui/ui_feature_flags.h" |
Yi Su | 392b303 | 2018-06-05 07:26:47 | [diff] [blame] | 58 | #include "ios/chrome/browser/web/features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 59 | #include "ios/chrome/grit/ios_strings.h" |
msarda | fc76f66 | 2017-02-24 12:46:28 | [diff] [blame] | 60 | #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
Danyao Wang | 34da6ff | 2017-10-30 15:16:56 | [diff] [blame] | 61 | #include "ios/web/public/features.h" |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 62 | #include "ios/web/public/user_agent.h" |
| 63 | #include "ios/web/public/web_view_creation_util.h" |
| 64 | |
| 65 | #if !defined(OFFICIAL_BUILD) |
| 66 | #include "components/variations/variations_switches.h" |
vitaliii | 489217aa | 2017-01-30 14:50:22 | [diff] [blame] | 67 | #endif |
stkhapugin | c1be179 | 2016-12-13 14:30:53 | [diff] [blame] | 68 | |
| 69 | #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 70 | #error "This file requires ARC support." |
| 71 | #endif |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 72 | |
elawrence | 816f6790e | 2017-06-16 18:19:28 | [diff] [blame] | 73 | using flags_ui::FeatureEntry; |
| 74 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 75 | namespace { |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 76 | |
| 77 | const FeatureEntry::FeatureParam kMarkHttpAsDangerous[] = { |
| 78 | {security_state::features::kMarkHttpAsFeatureParameterName, |
| 79 | security_state::features::kMarkHttpAsParameterDangerous}}; |
| 80 | const FeatureEntry::FeatureParam kMarkHttpAsWarning[] = { |
| 81 | {security_state::features::kMarkHttpAsFeatureParameterName, |
| 82 | security_state::features::kMarkHttpAsParameterWarning}}; |
| 83 | const FeatureEntry::FeatureParam kMarkHttpAsWarningAndDangerousOnFormEdits[] = { |
| 84 | {security_state::features::kMarkHttpAsFeatureParameterName, |
| 85 | security_state::features:: |
| 86 | kMarkHttpAsParameterWarningAndDangerousOnFormEdits}}; |
| 87 | const FeatureEntry::FeatureParam |
| 88 | kMarkHttpAsWarningAndDangerousOnPasswordsAndCreditCards[] = { |
| 89 | {security_state::features::kMarkHttpAsFeatureParameterName, |
| 90 | security_state::features:: |
| 91 | kMarkHttpAsParameterWarningAndDangerousOnPasswordsAndCreditCards}}; |
| 92 | |
| 93 | const FeatureEntry::FeatureVariation kMarkHttpAsFeatureVariations[] = { |
| 94 | {"(mark as actively dangerous)", kMarkHttpAsDangerous, |
| 95 | arraysize(kMarkHttpAsDangerous), nullptr}, |
| 96 | {"(mark with a Not Secure warning)", kMarkHttpAsWarning, |
| 97 | arraysize(kMarkHttpAsWarning), nullptr}, |
| 98 | {"(mark with a Not Secure warning and dangerous on form edits)", |
| 99 | kMarkHttpAsWarningAndDangerousOnFormEdits, |
| 100 | arraysize(kMarkHttpAsWarningAndDangerousOnFormEdits), nullptr}, |
| 101 | {"(mark with a Not Secure warning and dangerous on passwords and credit " |
| 102 | "card fields)", |
| 103 | kMarkHttpAsWarningAndDangerousOnPasswordsAndCreditCards, |
| 104 | arraysize(kMarkHttpAsWarningAndDangerousOnPasswordsAndCreditCards), |
| 105 | nullptr}}; |
elawrence | 816f6790e | 2017-06-16 18:19:28 | [diff] [blame] | 106 | |
Marc Treib | 5fc99e1f | 2017-11-08 12:19:18 | [diff] [blame] | 107 | const FeatureEntry::Choice kUseDdljsonApiChoices[] = { |
| 108 | {flags_ui::kGenericExperimentChoiceDefault, "", ""}, |
| 109 | {"(force test doodle 0)", search_provider_logos::switches::kGoogleDoodleUrl, |
| 110 | "https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios0.json"}, |
| 111 | {"(force test doodle 1)", search_provider_logos::switches::kGoogleDoodleUrl, |
| 112 | "https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios1.json"}, |
| 113 | {"(force test doodle 2)", search_provider_logos::switches::kGoogleDoodleUrl, |
| 114 | "https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios2.json"}, |
| 115 | {"(force test doodle 3)", search_provider_logos::switches::kGoogleDoodleUrl, |
| 116 | "https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios3.json"}, |
| 117 | {"(force test doodle 4)", search_provider_logos::switches::kGoogleDoodleUrl, |
| 118 | "https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios4.json"}, |
| 119 | }; |
Marc Treib | 2752e8b | 2017-08-04 14:12:09 | [diff] [blame] | 120 | |
Olivier Robin | 3d6041162 | 2018-02-23 10:03:22 | [diff] [blame] | 121 | const FeatureEntry::Choice kAutofillIOSDelayBetweenFieldsChoices[] = { |
| 122 | {flags_ui::kGenericExperimentChoiceDefault, "", ""}, |
| 123 | {"0", autofill::switches::kAutofillIOSDelayBetweenFields, "0"}, |
| 124 | {"10", autofill::switches::kAutofillIOSDelayBetweenFields, "10"}, |
| 125 | {"20", autofill::switches::kAutofillIOSDelayBetweenFields, "20"}, |
| 126 | {"50", autofill::switches::kAutofillIOSDelayBetweenFields, "50"}, |
| 127 | {"100", autofill::switches::kAutofillIOSDelayBetweenFields, "100"}, |
| 128 | {"200", autofill::switches::kAutofillIOSDelayBetweenFields, "200"}, |
| 129 | {"500", autofill::switches::kAutofillIOSDelayBetweenFields, "500"}, |
| 130 | {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"}, |
| 131 | }; |
| 132 | |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 133 | // To add a new entry, add to the end of kFeatureEntries. There are four |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 134 | // distinct types of entries: |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 135 | // . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the |
| 136 | // default value for this feature. Use the ENABLE_DISABLE_VALUE_TYPE |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 137 | // macro for this type supplying the command line to the macro. |
| 138 | // . MULTI_VALUE: a list of choices, the first of which should correspond to a |
| 139 | // deactivated state for this lab (i.e. no command line option). To specify |
| 140 | // this type of entry use the macro MULTI_VALUE_TYPE supplying it the |
| 141 | // array of choices. |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 142 | // . FEATURE_VALUE: entry is associated with a base::Feature instance. Entry is |
| 143 | // either enabled, disabled, or uses the default value of the associated |
| 144 | // base::Feature instance. To specify this type of entry use the macro |
| 145 | // FEATURE_VALUE_TYPE supplying it the base::Feature instance. |
| 146 | // . FEATURE_WITH_PARAM_VALUES: a list of choices associated with a |
| 147 | // base::Feature instance. Choices corresponding to the default state, a |
| 148 | // universally enabled state, and a universally disabled state are |
| 149 | // automatically included. To specify this type of entry use the macro |
| 150 | // FEATURE_WITH_PARAMS_VALUE_TYPE supplying it the base::Feature instance and |
| 151 | // the array of choices. |
| 152 | // |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 153 | // See the documentation of FeatureEntry for details on the fields. |
| 154 | // |
| 155 | // When adding a new choice, add it to the end of the list. |
| 156 | const flags_ui::FeatureEntry kFeatureEntries[] = { |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 157 | {"enable-mark-http-as", flag_descriptions::kMarkHttpAsName, |
elawrence | 816f6790e | 2017-06-16 18:19:28 | [diff] [blame] | 158 | flag_descriptions::kMarkHttpAsDescription, flags_ui::kOsIos, |
Emily Stark | bafa906 | 2017-12-27 15:22:46 | [diff] [blame] | 159 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
| 160 | security_state::features::kMarkHttpAsFeature, |
| 161 | kMarkHttpAsFeatureVariations, |
| 162 | "MarkHttpAs")}, |
mathp | 9b4c11d | 2017-07-06 20:24:13 | [diff] [blame] | 163 | {"web-payments", flag_descriptions::kWebPaymentsName, |
| 164 | flag_descriptions::kWebPaymentsDescription, flags_ui::kOsIos, |
| 165 | FEATURE_VALUE_TYPE(payments::features::kWebPayments)}, |
Randall Raymond | 59766ac | 2017-08-09 16:28:58 | [diff] [blame] | 166 | {"web-payments-native-apps", flag_descriptions::kWebPaymentsNativeAppsName, |
| 167 | flag_descriptions::kWebPaymentsNativeAppsDescription, flags_ui::kOsIos, |
| 168 | FEATURE_VALUE_TYPE(payments::features::kWebPaymentsNativeApps)}, |
Mike Dougherty | c20eefa | 2018-02-20 19:20:33 | [diff] [blame] | 169 | {"ios-captive-portal-metrics", flag_descriptions::kCaptivePortalMetricsName, |
| 170 | flag_descriptions::kCaptivePortalMetricsDescription, flags_ui::kOsIos, |
| 171 | FEATURE_VALUE_TYPE(kCaptivePortalMetrics)}, |
Cooper Knaak | 1e02656 | 2017-07-26 05:22:28 | [diff] [blame] | 172 | {"in-product-help-demo-mode-choice", |
| 173 | flag_descriptions::kInProductHelpDemoModeName, |
| 174 | flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos, |
| 175 | FEATURE_WITH_PARAMS_VALUE_TYPE( |
Tommy Nyquist | c1d6dea1 | 2017-07-26 20:37:23 | [diff] [blame] | 176 | feature_engagement::kIPHDemoMode, |
| 177 | feature_engagement::kIPHDemoModeChoiceVariations, |
Marc Treib | 2752e8b | 2017-08-04 14:12:09 | [diff] [blame] | 178 | "IPH_DemoMode")}, |
| 179 | {"use-ddljson-api", flag_descriptions::kUseDdljsonApiName, |
| 180 | flag_descriptions::kUseDdljsonApiDescription, flags_ui::kOsIos, |
Marc Treib | 5fc99e1f | 2017-11-08 12:19:18 | [diff] [blame] | 181 | MULTI_VALUE_TYPE(kUseDdljsonApiChoices)}, |
Justin Donnelly | 33d712e | 2017-08-23 21:32:51 | [diff] [blame] | 182 | {"omnibox-ui-elide-suggestion-url-after-host", |
| 183 | flag_descriptions::kOmniboxUIElideSuggestionUrlAfterHostName, |
| 184 | flag_descriptions::kOmniboxUIElideSuggestionUrlAfterHostDescription, |
| 185 | flags_ui::kOsIos, |
| 186 | FEATURE_VALUE_TYPE(omnibox::kUIExperimentElideSuggestionUrlAfterHost)}, |
Jean-François Geyelin | 30be591 | 2017-08-25 12:05:38 | [diff] [blame] | 187 | #if defined(__IPHONE_11_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0) |
| 188 | {"drag_and_drop", flag_descriptions::kDragAndDropName, |
| 189 | flag_descriptions::kDragAndDropDescription, flags_ui::kOsIos, |
Rohit Rao | 6a3a481d | 2017-09-25 19:31:41 | [diff] [blame] | 190 | FEATURE_VALUE_TYPE(kDragAndDrop)}, |
Jean-François Geyelin | 30be591 | 2017-08-25 12:05:38 | [diff] [blame] | 191 | #endif |
Rohit Rao | 6a3a481d | 2017-09-25 19:31:41 | [diff] [blame] | 192 | {"tab_switcher_presents_bvc", |
| 193 | flag_descriptions::kTabSwitcherPresentsBVCName, |
| 194 | flag_descriptions::kTabSwitcherPresentsBVCDescription, flags_ui::kOsIos, |
Jean-François Geyelin | ed4cde7 | 2017-10-11 11:34:50 | [diff] [blame] | 195 | FEATURE_VALUE_TYPE(kTabSwitcherPresentsBVC)}, |
Louis Romero | d11747a | 2017-10-20 20:10:35 | [diff] [blame] | 196 | {"external-search", flag_descriptions::kExternalSearchName, |
| 197 | flag_descriptions::kExternalSearchDescription, flags_ui::kOsIos, |
| 198 | FEATURE_VALUE_TYPE(kExternalSearch)}, |
sczs | a0c9194 | 2017-10-26 18:39:59 | [diff] [blame] | 199 | {"history-batch-updates-filter", |
| 200 | flag_descriptions::kHistoryBatchUpdatesFilterName, |
| 201 | flag_descriptions::kHistoryBatchUpdatesFilterDescription, flags_ui::kOsIos, |
| 202 | FEATURE_VALUE_TYPE(kHistoryBatchUpdatesFilter)}, |
Danyao Wang | 34da6ff | 2017-10-30 15:16:56 | [diff] [blame] | 203 | {"slim-navigation-manager", flag_descriptions::kSlimNavigationManagerName, |
| 204 | flag_descriptions::kSlimNavigationManagerDescription, flags_ui::kOsIos, |
| 205 | FEATURE_VALUE_TYPE(web::features::kSlimNavigationManager)}, |
Eugene But | a23c8fb | 2018-05-14 20:40:23 | [diff] [blame] | 206 | {"web-error-pages", flag_descriptions::kWebErrorPagesName, |
| 207 | flag_descriptions::kWebErrorPagesDescription, flags_ui::kOsIos, |
| 208 | FEATURE_VALUE_TYPE(web::features::kWebErrorPages)}, |
sczs | dc2e8e0 | 2018-01-09 18:39:32 | [diff] [blame] | 209 | {"memex-tab-switcher", flag_descriptions::kMemexTabSwitcherName, |
| 210 | flag_descriptions::kMemexTabSwitcherDescription, flags_ui::kOsIos, |
| 211 | FEATURE_VALUE_TYPE(kMemexTabSwitcher)}, |
mrefaat | a6501d9 | 2017-12-11 19:50:50 | [diff] [blame] | 212 | {"wk-http-system-cookie-store", |
| 213 | flag_descriptions::kWKHTTPSystemCookieStoreName, |
| 214 | flag_descriptions::kWKHTTPSystemCookieStoreName, flags_ui::kOsIos, |
Mohamad Ahmadi | c4df81f | 2017-12-20 04:41:59 | [diff] [blame] | 215 | FEATURE_VALUE_TYPE(web::features::kWKHTTPSystemCookieStore)}, |
Moe Ahmadi | c3fd7cd | 2018-05-11 21:40:22 | [diff] [blame] | 216 | {"enable-autofill-credit-card-upload", |
| 217 | flag_descriptions::kAutofillCreditCardUploadName, |
| 218 | flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos, |
Anne Lim | 579b573 | 2018-08-30 18:24:24 | [diff] [blame] | 219 | FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)}, |
Lakshmi Kumar Dabbiru | ee22004e | 2018-06-01 01:52:27 | [diff] [blame] | 220 | {"enable-autofill-credit-card-downstream-google-pay-branding", |
| 221 | flag_descriptions::kAutofillDownstreamUseGooglePayBrandingOniOSName, |
| 222 | flag_descriptions::kAutofillDownstreamUseGooglePayBrandingOniOSDescription, |
| 223 | flags_ui::kOsIos, |
| 224 | FEATURE_VALUE_TYPE( |
| 225 | autofill::features::kAutofillDownstreamUseGooglePayBrandingOniOS)}, |
Moe Ahmadi | 3fd9f20 | 2018-05-10 17:39:24 | [diff] [blame] | 226 | {"enable-autofill-credit-card-upload-google-pay-branding", |
| 227 | flag_descriptions::kAutofillUpstreamUseGooglePayBrandingOnMobileName, |
| 228 | flag_descriptions:: |
| 229 | kAutofillUpstreamUseGooglePayBrandingOnMobileDescription, |
| 230 | flags_ui::kOsIos, |
| 231 | FEATURE_VALUE_TYPE( |
| 232 | autofill::features::kAutofillUpstreamUseGooglePayBrandingOnMobile)}, |
Moe Ahmadi | f5e2fe6 | 2018-06-13 16:04:56 | [diff] [blame] | 233 | {"enable-autofill-credit-card-upload-update-prompt-explanation", |
| 234 | flag_descriptions:: |
| 235 | kEnableAutofillCreditCardUploadUpdatePromptExplanationName, |
| 236 | flag_descriptions:: |
| 237 | kEnableAutofillCreditCardUploadUpdatePromptExplanationDescription, |
| 238 | flags_ui::kOsIos, |
Anne Lim | 579b573 | 2018-08-30 18:24:24 | [diff] [blame] | 239 | FEATURE_VALUE_TYPE( |
| 240 | autofill::features::kAutofillUpstreamUpdatePromptExplanation)}, |
Moe Ahmadi | d6d5d17 | 2018-06-20 17:20:23 | [diff] [blame] | 241 | {"use-sync-sandbox", flag_descriptions::kSyncSandboxName, |
| 242 | flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos, |
| 243 | SINGLE_VALUE_TYPE_AND_VALUE( |
| 244 | switches::kSyncServiceURL, |
| 245 | "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")}, |
| 246 | {"wallet-service-use-sandbox", |
| 247 | flag_descriptions::kWalletServiceUseSandboxName, |
| 248 | flag_descriptions::kWalletServiceUseSandboxDescription, flags_ui::kOsIos, |
| 249 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE( |
| 250 | autofill::switches::kWalletServiceUseSandbox, |
| 251 | "1", |
| 252 | autofill::switches::kWalletServiceUseSandbox, |
| 253 | "0")}, |
Mohamad Ahmadi | c4df81f | 2017-12-20 04:41:59 | [diff] [blame] | 254 | {"show-autofill-type-predictions", |
| 255 | flag_descriptions::kShowAutofillTypePredictionsName, |
| 256 | flag_descriptions::kShowAutofillTypePredictionsDescription, |
| 257 | flags_ui::kOsIos, |
Gauthier Ambard | cfd8518 | 2018-01-05 10:37:46 | [diff] [blame] | 258 | FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)}, |
Olivier Robin | 3d6041162 | 2018-02-23 10:03:22 | [diff] [blame] | 259 | {"autofill-ios-delay-between-fields", |
| 260 | flag_descriptions::kAutofillIOSDelayBetweenFieldsName, |
| 261 | flag_descriptions::kAutofillIOSDelayBetweenFieldsDescription, |
| 262 | flags_ui::kOsIos, MULTI_VALUE_TYPE(kAutofillIOSDelayBetweenFieldsChoices)}, |
Olivier Robin | cba46aa | 2018-09-12 07:48:39 | [diff] [blame] | 263 | {"autofill-ios-iframe-support", |
| 264 | flag_descriptions::kAutofillEnableIFrameSupportOniOSName, |
| 265 | flag_descriptions::kAutofillEnableIFrameSupportOniOSDescription, |
| 266 | flags_ui::kOsIos, |
| 267 | FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableIFrameSupportOniOS)}, |
Justin Cohen | 2d81c58 | 2018-01-22 14:46:44 | [diff] [blame] | 268 | {"ui-refresh-phase-1", flag_descriptions::kUIRefreshPhase1Name, |
| 269 | flag_descriptions::kUIRefreshPhase1Description, flags_ui::kOsIos, |
| 270 | FEATURE_VALUE_TYPE(kUIRefreshPhase1)}, |
Peter K. Lee | 1e17675 | 2018-05-04 20:48:09 | [diff] [blame] | 271 | {"infobars-ui-reboot", flag_descriptions::kInfobarsUIRebootName, |
| 272 | flag_descriptions::kInfobarsUIRebootDescription, flags_ui::kOsIos, |
| 273 | FEATURE_VALUE_TYPE(kInfobarsUIReboot)}, |
Daniel Blakemore | 72387d3 | 2018-02-13 23:45:55 | [diff] [blame] | 274 | {"mailto-handling-google-ui", |
| 275 | flag_descriptions::kMailtoHandlingWithGoogleUIName, |
| 276 | flag_descriptions::kMailtoHandlingWithGoogleUIDescription, |
| 277 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kMailtoHandledWithGoogleUI)}, |
Sylvain Defresne | ae6987e | 2018-03-01 13:21:40 | [diff] [blame] | 278 | {"new-clear-browsing-data-ui", |
| 279 | flag_descriptions::kNewClearBrowsingDataUIName, |
| 280 | flag_descriptions::kNewClearBrowsingDataUIDescription, flags_ui::kOsIos, |
| 281 | FEATURE_VALUE_TYPE(kNewClearBrowsingDataUI)}, |
mrefaat | 390f99c0d | 2018-05-10 19:44:24 | [diff] [blame] | 282 | {"itunes-urls-store-kit-handling", |
| 283 | flag_descriptions::kITunesUrlsStoreKitHandlingName, |
| 284 | flag_descriptions::kITunesUrlsStoreKitHandlingDescription, |
| 285 | flags_ui::kOsIos, FEATURE_VALUE_TYPE(kITunesUrlsStoreKitHandling)}, |
Jérôme Lebel | fa6c5ae | 2018-03-29 13:46:57 | [diff] [blame] | 286 | {"unified-consent", flag_descriptions::kUnifiedConsentName, |
| 287 | flag_descriptions::kUnifiedConsentDescription, flags_ui::kOsIos, |
Mihai Sardarescu | 160ec66 | 2018-07-18 21:13:51 | [diff] [blame] | 288 | FEATURE_VALUE_TYPE(unified_consent::kUnifiedConsent)}, |
Jérôme Lebel | fe1b2e0 | 2018-08-03 12:26:20 | [diff] [blame] | 289 | {"force-unified-consent-bump", |
| 290 | flag_descriptions::kForceUnifiedConsentBumpName, |
| 291 | flag_descriptions::kForceUnifiedConsentBumpDescription, flags_ui::kOsIos, |
| 292 | FEATURE_VALUE_TYPE(unified_consent::kForceUnifiedConsentBump)}, |
sebsg | 93dc01c | 2018-04-05 16:42:48 | [diff] [blame] | 293 | {"autofill-dynamic-forms", flag_descriptions::kAutofillDynamicFormsName, |
| 294 | flag_descriptions::kAutofillDynamicFormsDescription, flags_ui::kOsIos, |
| 295 | FEATURE_VALUE_TYPE(autofill::features::kAutofillDynamicForms)}, |
Olivier Robin | 081912dd | 2018-06-11 09:14:26 | [diff] [blame] | 296 | {"autofill-prefilled-fields", |
| 297 | flag_descriptions::kAutofillPrefilledFieldsName, |
| 298 | flag_descriptions::kAutofillPrefilledFieldsDescription, flags_ui::kOsIos, |
| 299 | FEATURE_VALUE_TYPE(autofill::features::kAutofillPrefilledFields)}, |
Olivier Robin | d81475b0 | 2018-06-20 21:30:11 | [diff] [blame] | 300 | {"autofill-show-all-profiles-on-prefilled-forms", |
| 301 | flag_descriptions::kAutofillShowAllSuggestionsOnPrefilledFormsName, |
| 302 | flag_descriptions::kAutofillShowAllSuggestionsOnPrefilledFormsDescription, |
| 303 | flags_ui::kOsIos, |
| 304 | FEATURE_VALUE_TYPE( |
| 305 | autofill::features::kAutofillShowAllSuggestionsOnPrefilledForms)}, |
Moe Ahmadi | d3ddfcb | 2018-04-20 19:51:08 | [diff] [blame] | 306 | {"autofill-restrict-formless-form-extraction", |
| 307 | flag_descriptions::kAutofillRestrictUnownedFieldsToFormlessCheckoutName, |
| 308 | flag_descriptions:: |
| 309 | kAutofillRestrictUnownedFieldsToFormlessCheckoutDescription, |
| 310 | flags_ui::kOsIos, |
| 311 | FEATURE_VALUE_TYPE( |
| 312 | autofill::features::kAutofillRestrictUnownedFieldsToFormlessCheckout)}, |
[email protected] | dbcd4d5 | 2018-04-10 09:17:58 | [diff] [blame] | 313 | {"ui-refresh-location-bar", flag_descriptions::kUIRefreshLocationBarName, |
| 314 | flag_descriptions::kUIRefreshLocationBarDescription, flags_ui::kOsIos, |
| 315 | FEATURE_VALUE_TYPE(kUIRefreshLocationBar)}, |
Kurt Horimoto | dc33af3 | 2018-05-01 01:39:14 | [diff] [blame] | 316 | {"fullscreen-viewport-adjustment-experiment", |
| 317 | flag_descriptions::kFullscreenViewportAdjustmentExperimentName, |
| 318 | flag_descriptions::kFullscreenViewportAdjustmentExperimentDescription, |
| 319 | flags_ui::kOsIos, |
| 320 | MULTI_VALUE_TYPE( |
| 321 | fullscreen::features::kViewportAdjustmentExperimentChoices)}, |
Roger McFarlane | 1a37d7b | 2018-04-20 22:45:19 | [diff] [blame] | 322 | {"autofill-enforce-min-required-fields-for-heuristics", |
| 323 | flag_descriptions::kAutofillEnforceMinRequiredFieldsForHeuristicsName, |
| 324 | flag_descriptions:: |
| 325 | kAutofillEnforceMinRequiredFieldsForHeuristicsDescription, |
| 326 | flags_ui::kOsIos, |
| 327 | FEATURE_VALUE_TYPE( |
| 328 | autofill::features::kAutofillEnforceMinRequiredFieldsForHeuristics)}, |
| 329 | {"autofill-enforce-min-required-fields-for-query", |
| 330 | flag_descriptions::kAutofillEnforceMinRequiredFieldsForQueryName, |
| 331 | flag_descriptions::kAutofillEnforceMinRequiredFieldsForQueryDescription, |
| 332 | flags_ui::kOsIos, |
| 333 | FEATURE_VALUE_TYPE( |
| 334 | autofill::features::kAutofillEnforceMinRequiredFieldsForQuery)}, |
| 335 | {"autofill-enforce-min-required-fields-for-upload", |
| 336 | flag_descriptions::kAutofillEnforceMinRequiredFieldsForUploadName, |
| 337 | flag_descriptions::kAutofillEnforceMinRequiredFieldsForUploadDescription, |
| 338 | flags_ui::kOsIos, |
| 339 | FEATURE_VALUE_TYPE( |
| 340 | autofill::features::kAutofillEnforceMinRequiredFieldsForUpload)}, |
Gauthier Ambard | 4417f85 | 2018-04-26 14:24:32 | [diff] [blame] | 341 | {"browser-container-fullscreen", |
| 342 | flag_descriptions::kBrowserContainerFullscreenName, |
| 343 | flag_descriptions::kBrowserContainerFullscreenDescription, |
Gauthier Ambard | 5d762728 | 2018-05-18 08:20:07 | [diff] [blame] | 344 | flags_ui::kOsIos, |
| 345 | FEATURE_VALUE_TYPE(web::features::kBrowserContainerFullscreen)}, |
Roger McFarlane | 2eceba98 | 2018-05-18 01:37:11 | [diff] [blame] | 346 | {"autofill-cache-query-responses", |
| 347 | flag_descriptions::kAutofillCacheQueryResponsesName, |
| 348 | flag_descriptions::kAutofillCacheQueryResponsesDescription, |
| 349 | flags_ui::kOsIos, |
| 350 | FEATURE_VALUE_TYPE(autofill::features::kAutofillCacheQueryResponses)}, |
Jeffrey Cohen | 05cdafa39 | 2018-08-15 20:49:17 | [diff] [blame] | 351 | {"autofill-enable-company-name", |
| 352 | flag_descriptions::kAutofillEnableCompanyNameName, |
| 353 | flag_descriptions::kAutofillEnableCompanyNameDescription, flags_ui::kOsIos, |
| 354 | FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableCompanyName)}, |
Javier Ernesto Flores Robles | 23c71a7d | 2018-06-01 09:51:17 | [diff] [blame] | 355 | {"autofill-manual-fallback", flag_descriptions::kAutofillManualFallbackName, |
| 356 | flag_descriptions::kAutofillManualFallbackDescription, flags_ui::kOsIos, |
| 357 | FEATURE_VALUE_TYPE(autofill::features::kAutofillManualFallback)}, |
Yi Su | 392b303 | 2018-06-05 07:26:47 | [diff] [blame] | 358 | {"webpage-text-accessibility", |
| 359 | flag_descriptions::kWebPageTextAccessibilityName, |
| 360 | flag_descriptions::kWebPageTextAccessibilityDescription, flags_ui::kOsIos, |
| 361 | FEATURE_VALUE_TYPE(web::kWebPageTextAccessibility)}, |
Mike Dougherty | 39d36b0 | 2018-06-19 19:21:40 | [diff] [blame] | 362 | {"web-frame-messaging", flag_descriptions::kWebFrameMessagingName, |
| 363 | flag_descriptions::kWebFrameMessagingDescription, flags_ui::kOsIos, |
| 364 | FEATURE_VALUE_TYPE(web::features::kWebFrameMessaging)}, |
Yi Su | f63219e | 2018-06-25 17:41:01 | [diff] [blame] | 365 | {"copy-image", flag_descriptions::kCopyImageName, |
| 366 | flag_descriptions::kCopyImageDescription, flags_ui::kOsIos, |
| 367 | FEATURE_VALUE_TYPE(kCopyImage)}, |
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 | 6f0bbd2 | 2018-08-28 10:07:19 | [diff] [blame] | 375 | {"sync-standalone-transport", |
| 376 | flag_descriptions::kSyncStandaloneTransportName, |
| 377 | flag_descriptions::kSyncStandaloneTransportDescription, flags_ui::kOsIos, |
| 378 | FEATURE_VALUE_TYPE(switches::kSyncStandaloneTransport)}, |
Marc Treib | 4bd95e7 | 2018-08-30 06:30:58 | [diff] [blame] | 379 | {"sync-support-secondary-account", |
| 380 | flag_descriptions::kSyncSupportSecondaryAccountName, |
| 381 | flag_descriptions::kSyncSupportSecondaryAccountDescription, |
| 382 | flags_ui::kOsIos, |
| 383 | FEATURE_VALUE_TYPE(switches::kSyncSupportSecondaryAccount)}, |
Gauthier Ambard | 66de93d | 2018-08-30 15:58:19 | [diff] [blame] | 384 | {"out-of-web-fullscreen", flag_descriptions::kOutOfWebFullscreenName, |
| 385 | flag_descriptions::kOutOfWebFullscreenDescription, flags_ui::kOsIos, |
| 386 | FEATURE_VALUE_TYPE(web::features::kOutOfWebFullscreen)}, |
Javier Ernesto Flores Robles | 8e66f73 | 2018-09-12 15:41:15 | [diff] [blame] | 387 | {"autofill-manual-fallback-phase-two", |
| 388 | flag_descriptions::kAutofillManualFallbackPhaseTwoName, |
| 389 | flag_descriptions::kAutofillManualFallbackPhaseTwoDescription, |
| 390 | flags_ui::kOsIos, |
| 391 | FEATURE_VALUE_TYPE(autofill::features::kAutofillManualFallbackPhaseTwo)}, |
Kurt Horimoto | 79d590b | 2018-09-12 19:09:28 | [diff] [blame^] | 392 | {"toolbar-container", flag_descriptions::kToolbarContainerName, |
| 393 | flag_descriptions::kToolbarContainerDescription, flags_ui::kOsIos, |
| 394 | FEATURE_VALUE_TYPE(toolbar_container::kToolbarContainerEnabled)}, |
Gauthier Ambard | cfd8518 | 2018-01-05 10:37:46 | [diff] [blame] | 395 | }; |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 396 | |
| 397 | // Add all switches from experimental flags to |command_line|. |
| 398 | void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) { |
| 399 | NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
| 400 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 401 | // Set the UA flag if UseMobileSafariUA is enabled. |
| 402 | if ([defaults boolForKey:@"UseMobileSafariUA"]) { |
| 403 | // Safari uses "Vesion/", followed by the OS version excluding bugfix, where |
| 404 | // Chrome puts its product token. |
avi | 57194367 | 2015-12-22 02:12:49 | [diff] [blame] | 405 | int32_t major = 0; |
| 406 | int32_t minor = 0; |
| 407 | int32_t bugfix = 0; |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 408 | base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); |
| 409 | std::string product = base::StringPrintf("Version/%d.%d", major, minor); |
| 410 | |
| 411 | command_line->AppendSwitchASCII(switches::kUserAgent, |
| 412 | web::BuildUserAgentFromProduct(product)); |
| 413 | } |
| 414 | |
| 415 | // Freeform commandline flags. These are added last, so that any flags added |
| 416 | // earlier in this function take precedence. |
| 417 | if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) { |
| 418 | base::CommandLine::StringVector flags; |
| 419 | // Append an empty "program" argument. |
| 420 | flags.push_back(""); |
| 421 | |
| 422 | // The number of flags corresponds to the number of text fields in |
| 423 | // Experimental.plist. |
| 424 | const int kNumFreeformFlags = 5; |
| 425 | for (int i = 1; i <= kNumFreeformFlags; ++i) { |
| 426 | NSString* key = |
| 427 | [NSString stringWithFormat:@"FreeformCommandLineFlag%d", i]; |
| 428 | NSString* flag = [defaults stringForKey:key]; |
| 429 | if ([flag length]) { |
| 430 | flags.push_back(base::SysNSStringToUTF8(flag)); |
| 431 | } |
| 432 | } |
| 433 | |
| 434 | base::CommandLine temp_command_line(flags); |
| 435 | command_line->AppendArguments(temp_command_line, false); |
| 436 | } |
msarda | fc76f66 | 2017-02-24 12:46:28 | [diff] [blame] | 437 | |
justincohen | dacc85d | 2017-06-28 23:34:10 | [diff] [blame] | 438 | // Populate command line flag for 3rd party keyboard omnibox workaround. |
| 439 | NSString* enableThirdPartyKeyboardWorkaround = |
| 440 | [defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"]; |
| 441 | if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Enabled"]) { |
| 442 | command_line->AppendSwitch(switches::kEnableThirdPartyKeyboardWorkaround); |
| 443 | } else if ([enableThirdPartyKeyboardWorkaround isEqualToString:@"Disabled"]) { |
| 444 | command_line->AppendSwitch(switches::kDisableThirdPartyKeyboardWorkaround); |
| 445 | } |
| 446 | |
msarda | fc76f66 | 2017-02-24 12:46:28 | [diff] [blame] | 447 | ios::GetChromeBrowserProvider()->AppendSwitchesFromExperimentalSettings( |
| 448 | defaults, command_line); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 449 | } |
| 450 | |
| 451 | bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) { |
| 452 | return false; |
| 453 | } |
| 454 | |
| 455 | class FlagsStateSingleton { |
| 456 | public: |
| 457 | FlagsStateSingleton() |
| 458 | : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} |
| 459 | ~FlagsStateSingleton() {} |
| 460 | |
| 461 | static FlagsStateSingleton* GetInstance() { |
| 462 | return base::Singleton<FlagsStateSingleton>::get(); |
| 463 | } |
| 464 | |
| 465 | static flags_ui::FlagsState* GetFlagsState() { |
| 466 | return &GetInstance()->flags_state_; |
| 467 | } |
| 468 | |
| 469 | private: |
| 470 | flags_ui::FlagsState flags_state_; |
| 471 | |
| 472 | DISALLOW_COPY_AND_ASSIGN(FlagsStateSingleton); |
| 473 | }; |
| 474 | } // namespace |
| 475 | |
| 476 | void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage, |
| 477 | base::CommandLine* command_line) { |
Gregory Chatzinoff | 3130511 | 2017-12-20 21:56:02 | [diff] [blame] | 478 | AppendSwitchesFromExperimentalSettings(command_line); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 479 | FlagsStateSingleton::GetFlagsState()->ConvertFlagsToSwitches( |
sdefresne | c976390 | 2015-12-02 10:30:11 | [diff] [blame] | 480 | flags_storage, command_line, flags_ui::kAddSentinels, |
Gregory Chatzinoff | f652372 | 2017-11-21 01:33:53 | [diff] [blame] | 481 | switches::kEnableFeatures, switches::kDisableFeatures); |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 482 | } |
| 483 | |
jkrcal | bf07337 | 2016-07-29 07:21:31 | [diff] [blame] | 484 | std::vector<std::string> RegisterAllFeatureVariationParameters( |
| 485 | flags_ui::FlagsStorage* flags_storage, |
| 486 | base::FeatureList* feature_list) { |
| 487 | return FlagsStateSingleton::GetFlagsState() |
| 488 | ->RegisterAllFeatureVariationParameters(flags_storage, feature_list); |
| 489 | } |
| 490 | |
sdefresne | 14900ee | 2015-11-27 14:43:21 | [diff] [blame] | 491 | void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage, |
| 492 | flags_ui::FlagAccess access, |
| 493 | base::ListValue* supported_entries, |
| 494 | base::ListValue* unsupported_entries) { |
| 495 | FlagsStateSingleton::GetFlagsState()->GetFlagFeatureEntries( |
| 496 | flags_storage, access, supported_entries, unsupported_entries, |
| 497 | base::Bind(&SkipConditionalFeatureEntry)); |
| 498 | } |
| 499 | |
| 500 | void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage, |
| 501 | const std::string& internal_name, |
| 502 | bool enable) { |
| 503 | FlagsStateSingleton::GetFlagsState()->SetFeatureEntryEnabled( |
| 504 | flags_storage, internal_name, enable); |
| 505 | } |
| 506 | |
| 507 | void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) { |
| 508 | FlagsStateSingleton::GetFlagsState()->ResetAllFlags(flags_storage); |
| 509 | } |
| 510 | |
| 511 | namespace testing { |
| 512 | |
| 513 | const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) { |
| 514 | *count = arraysize(kFeatureEntries); |
| 515 | return kFeatureEntries; |
| 516 | } |
| 517 | |
| 518 | } // namespace testing |