[email protected] | 9c66adc | 2012-01-05 02:10:16 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 5 | #include "chrome/browser/about_flags.h" |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 6 | |
| 7 | #include <algorithm> |
| 8 | #include <iterator> |
| 9 | #include <map> |
| 10 | #include <set> |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 11 | #include <utility> |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 12 | |
[email protected] | 7d1d209 | 2013-03-04 04:12:43 | [diff] [blame] | 13 | #include "apps/switches.h" |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 14 | #include "base/command_line.h" |
[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame] | 15 | #include "base/memory/singleton.h" |
[email protected] | 3853a4c | 2013-02-11 17:15:57 | [diff] [blame] | 16 | #include "base/prefs/pref_service.h" |
[email protected] | 3ea1b18 | 2013-02-08 22:38:41 | [diff] [blame] | 17 | #include "base/strings/string_number_conversions.h" |
[email protected] | d208f4d8 | 2011-05-23 21:52:03 | [diff] [blame] | 18 | #include "base/utf_string_conversions.h" |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 19 | #include "base/values.h" |
[email protected] | 65bfd997 | 2012-10-19 03:39:37 | [diff] [blame] | 20 | #include "cc/switches.h" |
[email protected] | 1bc7842 | 2011-03-31 08:41:38 | [diff] [blame] | 21 | #include "chrome/browser/prefs/scoped_user_pref_update.h" |
[email protected] | d208f4d8 | 2011-05-23 21:52:03 | [diff] [blame] | 22 | #include "chrome/common/chrome_content_client.h" |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 23 | #include "chrome/common/chrome_switches.h" |
| 24 | #include "chrome/common/pref_names.h" |
[email protected] | 7f6f44c | 2011-12-14 13:23:38 | [diff] [blame] | 25 | #include "content/public/browser/user_metrics.h" |
[email protected] | d96aef2 | 2012-10-30 11:47:02 | [diff] [blame] | 26 | #include "grit/chromium_strings.h" |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 27 | #include "grit/generated_resources.h" |
[email protected] | d96aef2 | 2012-10-30 11:47:02 | [diff] [blame] | 28 | #include "grit/google_chrome_strings.h" |
[email protected] | e2e8e32 | 2012-09-12 04:37:02 | [diff] [blame] | 29 | #include "media/base/media_switches.h" |
[email protected] | 0bc6c27 | 2012-07-17 03:32:03 | [diff] [blame] | 30 | #include "ui/app_list/app_list_switches.h" |
[email protected] | c051a1b | 2011-01-21 23:30:17 | [diff] [blame] | 31 | #include "ui/base/l10n/l10n_util.h" |
[email protected] | c9c73ad4 | 2012-04-18 03:35:59 | [diff] [blame] | 32 | #include "ui/base/ui_base_switches.h" |
[email protected] | 0d3b9dd | 2012-11-14 04:14:48 | [diff] [blame] | 33 | #include "ui/gfx/switches.h" |
[email protected] | c9e2cbbb | 2012-05-12 21:17:27 | [diff] [blame] | 34 | #include "ui/gl/gl_switches.h" |
[email protected] | 8b1c3c7 | 2013-01-25 01:48:43 | [diff] [blame] | 35 | #include "ui/surface/surface_switches.h" |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 36 | |
[email protected] | f1c3924 | 2013-01-29 16:13:01 | [diff] [blame] | 37 | #if defined(ENABLE_MESSAGE_CENTER) |
| 38 | #include "ui/message_center/message_center_switches.h" |
| 39 | #endif |
| 40 | |
[email protected] | dc04be7c | 2012-03-15 23:57:49 | [diff] [blame] | 41 | #if defined(USE_ASH) |
[email protected] | b65bdda | 2011-12-23 23:35:31 | [diff] [blame] | 42 | #include "ash/ash_switches.h" |
[email protected] | dc04be7c | 2012-03-15 23:57:49 | [diff] [blame] | 43 | #endif |
| 44 | |
[email protected] | badba1ad | 2012-11-16 17:21:46 | [diff] [blame] | 45 | #if defined(OS_CHROMEOS) |
[email protected] | 4967396 | 2013-03-08 01:18:02 | [diff] [blame] | 46 | #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 47 | #include "chrome/browser/chromeos/settings/cros_settings_names.h" |
[email protected] | badba1ad | 2012-11-16 17:21:46 | [diff] [blame] | 48 | #include "chromeos/chromeos_switches.h" |
| 49 | #endif |
| 50 | |
[email protected] | 7f6f44c | 2011-12-14 13:23:38 | [diff] [blame] | 51 | using content::UserMetricsAction; |
| 52 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 53 | namespace about_flags { |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 54 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 55 | // Macros to simplify specifying the type. |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 56 | #define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \ |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 57 | Experiment::SINGLE_VALUE, \ |
| 58 | command_line_switch, switch_value, NULL, NULL, NULL, 0 |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 59 | #define SINGLE_VALUE_TYPE(command_line_switch) \ |
| 60 | SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "") |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 61 | #define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \ |
| 62 | disable_switch, disable_value) \ |
| 63 | Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \ |
| 64 | disable_switch, disable_value, NULL, 3 |
| 65 | #define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \ |
| 66 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "") |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 67 | #define MULTI_VALUE_TYPE(choices) \ |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 68 | Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices) |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 69 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 70 | namespace { |
| 71 | |
[email protected] | 9c7453d | 2012-01-21 00:45:40 | [diff] [blame] | 72 | const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid; |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 73 | const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS; |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 74 | |
[email protected] | cc3e205 | 2011-12-20 01:01:40 | [diff] [blame] | 75 | // Adds a |StringValue| to |list| for each platform where |bitmask| indicates |
| 76 | // whether the experiment is available on that platform. |
| 77 | void AddOsStrings(unsigned bitmask, ListValue* list) { |
| 78 | struct { |
| 79 | unsigned bit; |
| 80 | const char* const name; |
| 81 | } kBitsToOs[] = { |
| 82 | {kOsMac, "Mac"}, |
| 83 | {kOsWin, "Windows"}, |
| 84 | {kOsLinux, "Linux"}, |
| 85 | {kOsCrOS, "Chrome OS"}, |
[email protected] | 4052d83 | 2013-01-16 05:31:01 | [diff] [blame] | 86 | {kOsAndroid, "Android"}, |
[email protected] | cc3e205 | 2011-12-20 01:01:40 | [diff] [blame] | 87 | }; |
| 88 | for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i) |
| 89 | if (bitmask & kBitsToOs[i].bit) |
| 90 | list->Append(new StringValue(kBitsToOs[i].name)); |
| 91 | } |
| 92 | |
[email protected] | 6831780 | 2012-06-07 19:13:23 | [diff] [blame] | 93 | const Experiment::Choice kOmniboxHistoryQuickProviderNewScoringChoices[] = { |
| 94 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_AUTOMATIC, "", "" }, |
| 95 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_ENABLED, |
| 96 | switches::kOmniboxHistoryQuickProviderNewScoring, |
| 97 | switches::kOmniboxHistoryQuickProviderNewScoringEnabled }, |
| 98 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DISABLED, |
| 99 | switches::kOmniboxHistoryQuickProviderNewScoring, |
| 100 | switches::kOmniboxHistoryQuickProviderNewScoringDisabled } |
| 101 | }; |
| 102 | |
[email protected] | 128dc6c | 2012-06-22 20:30:35 | [diff] [blame] | 103 | const Experiment::Choice |
| 104 | kOmniboxHistoryQuickProviderReorderForInliningChoices[] = { |
| 105 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC, |
| 106 | "", |
| 107 | "" }, |
| 108 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED, |
| 109 | switches::kOmniboxHistoryQuickProviderReorderForInlining, |
| 110 | switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled }, |
| 111 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED, |
| 112 | switches::kOmniboxHistoryQuickProviderReorderForInlining, |
| 113 | switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled } |
| 114 | }; |
| 115 | |
[email protected] | 032d5e6c | 2012-02-17 17:53:55 | [diff] [blame] | 116 | const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = { |
| 117 | { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" }, |
| 118 | { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED, |
| 119 | switches::kOmniboxInlineHistoryQuickProvider, |
| 120 | switches::kOmniboxInlineHistoryQuickProviderAllowed }, |
| 121 | { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED, |
| 122 | switches::kOmniboxInlineHistoryQuickProvider, |
| 123 | switches::kOmniboxInlineHistoryQuickProviderProhibited } |
| 124 | }; |
| 125 | |
[email protected] | fb85419 | 2013-02-06 01:30:04 | [diff] [blame] | 126 | const Experiment::Choice kEnableCompositingForFixedPositionChoices[] = { |
| 127 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 128 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 129 | switches::kEnableCompositingForFixedPosition, ""}, |
| 130 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 131 | switches::kDisableCompositingForFixedPosition, ""}, |
| 132 | { IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI, |
| 133 | switches::kEnableHighDpiCompositingForFixedPosition, ""} |
| 134 | }; |
| 135 | |
[email protected] | 8b1c3c7 | 2013-01-25 01:48:43 | [diff] [blame] | 136 | const Experiment::Choice kGDIPresentChoices[] = { |
| 137 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 138 | { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW, |
| 139 | switches::kDoFirstShowPresentWithGDI, ""}, |
| 140 | { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW, |
| 141 | switches::kDoAllShowPresentWithGDI, ""} |
| 142 | }; |
| 143 | |
[email protected] | d793253 | 2012-11-21 21:10:31 | [diff] [blame] | 144 | const Experiment::Choice kTouchEventsChoices[] = { |
| 145 | { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" }, |
| 146 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 147 | switches::kTouchEvents, |
| 148 | switches::kTouchEventsEnabled }, |
| 149 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 150 | switches::kTouchEvents, |
| 151 | switches::kTouchEventsDisabled } |
| 152 | }; |
| 153 | |
[email protected] | 347a0c7 | 2012-05-14 20:28:06 | [diff] [blame] | 154 | const Experiment::Choice kTouchOptimizedUIChoices[] = { |
[email protected] | d793253 | 2012-11-21 21:10:31 | [diff] [blame] | 155 | { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" }, |
[email protected] | a45c6940 | 2012-06-24 16:32:20 | [diff] [blame] | 156 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
[email protected] | 347a0c7 | 2012-05-14 20:28:06 | [diff] [blame] | 157 | switches::kTouchOptimizedUI, |
| 158 | switches::kTouchOptimizedUIEnabled }, |
[email protected] | a45c6940 | 2012-06-24 16:32:20 | [diff] [blame] | 159 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
[email protected] | 347a0c7 | 2012-05-14 20:28:06 | [diff] [blame] | 160 | switches::kTouchOptimizedUI, |
| 161 | switches::kTouchOptimizedUIDisabled } |
| 162 | }; |
| 163 | |
[email protected] | 66f409c | 2012-10-04 20:59:04 | [diff] [blame] | 164 | const Experiment::Choice kNaClDebugMaskChoices[] = { |
| 165 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 166 | // Secure shell can be used on ChromeOS for forwarding the TCP port opened by |
| 167 | // debug stub to a remote machine. Since secure shell uses NaCl, we provide |
| 168 | // an option to switch off its debugging. |
| 169 | { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS, |
| 170 | switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" }, |
| 171 | { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG, |
| 172 | switches::kNaClDebugMask, "*://*/*debug.nmf" } |
| 173 | }; |
| 174 | |
[email protected] | ea2f334 | 2012-09-21 21:13:36 | [diff] [blame] | 175 | #if defined(OS_CHROMEOS) |
| 176 | const Experiment::Choice kAshBootAnimationFunction[] = { |
| 177 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 178 | { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2, |
| 179 | ash::switches::kAshBootAnimationFunction2, ""}, |
| 180 | { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3, |
| 181 | ash::switches::kAshBootAnimationFunction3, ""} |
| 182 | }; |
[email protected] | d96aef2 | 2012-10-30 11:47:02 | [diff] [blame] | 183 | |
| 184 | const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = { |
[email protected] | ad2fe9f | 2012-11-15 11:03:19 | [diff] [blame] | 185 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""}, |
[email protected] | d96aef2 | 2012-10-30 11:47:02 | [diff] [blame] | 186 | { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR, |
[email protected] | ad2fe9f | 2012-11-15 11:03:19 | [diff] [blame] | 187 | switches::kEnableChromeCaptivePortalDetector, ""}, |
| 188 | { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR, |
| 189 | switches::kDisableChromeCaptivePortalDetector, ""} |
[email protected] | d96aef2 | 2012-10-30 11:47:02 | [diff] [blame] | 190 | }; |
[email protected] | ea2f334 | 2012-09-21 21:13:36 | [diff] [blame] | 191 | #endif |
| 192 | |
[email protected] | 9323fdd1 | 2013-02-23 00:31:36 | [diff] [blame] | 193 | const Experiment::Choice kImplSidePaintingChoices[] = { |
| 194 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 195 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 196 | cc::switches::kEnableImplSidePainting, ""}, |
| 197 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 198 | cc::switches::kDisableImplSidePainting, ""} |
| 199 | }; |
| 200 | |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 201 | // RECORDING USER METRICS FOR FLAGS: |
| 202 | // ----------------------------------------------------------------------------- |
| 203 | // The first line of the experiment is the internal name. If you'd like to |
| 204 | // gather statistics about the usage of your flag, you should append a marker |
| 205 | // comment to the end of the feature name, like so: |
| 206 | // "my-special-feature", // FLAGS:RECORD_UMA |
| 207 | // |
| 208 | // After doing that, run //chrome/tools/extract_actions.py (see instructions at |
| 209 | // the top of that file for details) to update the chromeactions.txt file, which |
| 210 | // will enable UMA to record your feature flag. |
| 211 | // |
[email protected] | 783d5bb | 2012-10-24 03:47:14 | [diff] [blame] | 212 | // After your feature has shipped under a flag, you can locate the metrics under |
| 213 | // the action name AboutFlags_internal-action-name. Actions are recorded once |
| 214 | // per startup, so you should divide this number by AboutFlags_StartupTick to |
| 215 | // get a sense of usage. Note that this will not be the same as number of users |
| 216 | // with a given feature enabled because users can quit and relaunch the |
| 217 | // application multiple times over a given time interval. The dashboard also |
| 218 | // shows you how many (metrics reporting) users have enabled the flag over the |
| 219 | // last seven days. However, note that this is not the same as the number of |
| 220 | // users who have the flag enabled, since enabling the flag happens once, |
| 221 | // whereas running with the flag enabled happens until the user flips the flag |
| 222 | // again. |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 223 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 224 | // To add a new experiment add to the end of kExperiments. There are two |
| 225 | // distinct types of experiments: |
| 226 | // . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE |
| 227 | // macro for this type supplying the command line to the macro. |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 228 | // . MULTI_VALUE: a list of choices, the first of which should correspond to a |
| 229 | // deactivated state for this lab (i.e. no command line option). To specify |
| 230 | // this type of experiment use the macro MULTI_VALUE_TYPE supplying it the |
| 231 | // array of choices. |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 232 | // See the documentation of Experiment for details on the fields. |
| 233 | // |
| 234 | // When adding a new choice, add it to the end of the list. |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 235 | const Experiment kExperiments[] = { |
[email protected] | 270f034 | 2013-02-20 01:19:44 | [diff] [blame] | 236 | #if defined(OS_ANDROID) |
| 237 | { |
[email protected] | 199def2 | 2013-02-21 17:52:29 | [diff] [blame] | 238 | "enable-spdy-proxy-auth", |
| 239 | IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_NAME, |
| 240 | IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_DESCRIPTION, |
[email protected] | 270f034 | 2013-02-20 01:19:44 | [diff] [blame] | 241 | kOsAndroid, |
[email protected] | 199def2 | 2013-02-21 17:52:29 | [diff] [blame] | 242 | SINGLE_VALUE_TYPE(switches::kEnableSpdyProxyAuth) |
[email protected] | 270f034 | 2013-02-20 01:19:44 | [diff] [blame] | 243 | }, |
| 244 | #endif |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 245 | { |
[email protected] | aac169d | 2011-03-18 19:53:03 | [diff] [blame] | 246 | "expose-for-tabs", // FLAGS:RECORD_UMA |
| 247 | IDS_FLAGS_TABPOSE_NAME, |
| 248 | IDS_FLAGS_TABPOSE_DESCRIPTION, |
| 249 | kOsMac, |
| 250 | #if defined(OS_MACOSX) |
| 251 | // The switch exists only on OS X. |
| 252 | SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs) |
| 253 | #else |
| 254 | SINGLE_VALUE_TYPE("") |
| 255 | #endif |
| 256 | }, |
| 257 | { |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 258 | "conflicting-modules-check", // FLAGS:RECORD_UMA |
[email protected] | c1bbaa8 | 2010-11-08 11:17:05 | [diff] [blame] | 259 | IDS_FLAGS_CONFLICTS_CHECK_NAME, |
| 260 | IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION, |
| 261 | kOsWin, |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 262 | SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck) |
[email protected] | c1bbaa8 | 2010-11-08 11:17:05 | [diff] [blame] | 263 | }, |
| 264 | { |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 265 | "cloud-print-proxy", // FLAGS:RECORD_UMA |
[email protected] | dae7325b | 2011-12-21 20:56:54 | [diff] [blame] | 266 | IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME, |
| 267 | IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION, |
[email protected] | 9f8872b3 | 2011-03-04 19:44:45 | [diff] [blame] | 268 | // For a Chrome build, we know we have a PDF plug-in on Windows, so it's |
[email protected] | 4fa24bf | 2011-08-20 02:15:22 | [diff] [blame] | 269 | // fully enabled. |
[email protected] | 5d10d57d | 2011-07-22 22:16:31 | [diff] [blame] | 270 | // Otherwise, where we know Windows could be working if a viable PDF |
[email protected] | 4fa24bf | 2011-08-20 02:15:22 | [diff] [blame] | 271 | // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux |
| 272 | // always have PDF rasterization available, so no flag needed there. |
| 273 | #if !defined(GOOGLE_CHROME_BUILD) |
| 274 | kOsWin, |
| 275 | #else |
| 276 | 0, |
[email protected] | fa6d2a2f | 2010-11-30 21:47:19 | [diff] [blame] | 277 | #endif |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 278 | SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy) |
[email protected] | 8b6588a | 2010-10-12 02:39:42 | [diff] [blame] | 279 | }, |
[email protected] | 60d77bd | 2012-08-22 00:10:07 | [diff] [blame] | 280 | #if defined(OS_WIN) |
| 281 | { |
| 282 | "print-raster", |
| 283 | IDS_FLAGS_PRINT_RASTER_NAME, |
| 284 | IDS_FLAGS_PRINT_RASTER_DESCRIPTION, |
| 285 | kOsWin, |
| 286 | SINGLE_VALUE_TYPE(switches::kPrintRaster) |
| 287 | }, |
| 288 | #endif // OS_WIN |
[email protected] | 0209b44 | 2012-07-18 00:38:05 | [diff] [blame] | 289 | { |
[email protected] | bb46153 | 2010-11-26 21:50:23 | [diff] [blame] | 290 | "crxless-web-apps", |
| 291 | IDS_FLAGS_CRXLESS_WEB_APPS_NAME, |
| 292 | IDS_FLAGS_CRXLESS_WEB_APPS_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 293 | kOsDesktop, |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 294 | SINGLE_VALUE_TYPE(switches::kEnableCrxlessWebApps) |
[email protected] | bb46153 | 2010-11-26 21:50:23 | [diff] [blame] | 295 | }, |
| 296 | { |
[email protected] | 96c6f4c | 2011-05-18 19:36:22 | [diff] [blame] | 297 | "ignore-gpu-blacklist", |
| 298 | IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME, |
| 299 | IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION, |
| 300 | kOsAll, |
| 301 | SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist) |
| 302 | }, |
| 303 | { |
[email protected] | 0110cf11 | 2011-07-02 00:39:43 | [diff] [blame] | 304 | "force-compositing-mode-2", |
[email protected] | 96c6f4c | 2011-05-18 19:36:22 | [diff] [blame] | 305 | IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME, |
| 306 | IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION, |
[email protected] | 9b19cf8 | 2012-06-13 06:23:23 | [diff] [blame] | 307 | kOsMac | kOsWin | kOsLinux, |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 308 | ENABLE_DISABLE_VALUE_TYPE(switches::kForceCompositingMode, |
| 309 | switches::kDisableForceCompositingMode) |
[email protected] | 96c6f4c | 2011-05-18 19:36:22 | [diff] [blame] | 310 | }, |
| 311 | { |
[email protected] | 72787e39 | 2012-03-23 05:55:43 | [diff] [blame] | 312 | "threaded-compositing-mode", |
| 313 | IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME, |
| 314 | IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 315 | kOsDesktop & ~kOsCrOS, |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 316 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableThreadedCompositing, |
| 317 | switches::kDisableThreadedCompositing) |
[email protected] | 644a107 | 2012-03-16 09:29:59 | [diff] [blame] | 318 | }, |
| 319 | { |
[email protected] | 17e2769 | 2013-02-06 17:02:09 | [diff] [blame] | 320 | "force-accelerated-composited-scrolling", |
| 321 | IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME, |
| 322 | IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION, |
| 323 | kOsAll, |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 324 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedOverflowScroll, |
| 325 | switches::kDisableAcceleratedOverflowScroll) |
[email protected] | 17e2769 | 2013-02-06 17:02:09 | [diff] [blame] | 326 | }, |
| 327 | { |
[email protected] | 8b1c3c7 | 2013-01-25 01:48:43 | [diff] [blame] | 328 | "present-with-GDI", |
| 329 | IDS_FLAGS_PRESENT_WITH_GDI_NAME, |
| 330 | IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION, |
| 331 | kOsWin, |
| 332 | MULTI_VALUE_TYPE(kGDIPresentChoices) |
| 333 | }, |
| 334 | { |
[email protected] | 81c64af6 | 2012-06-06 20:15:52 | [diff] [blame] | 335 | "disable-accelerated-2d-canvas", |
| 336 | IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME, |
| 337 | IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION, |
| 338 | kOsAll, |
| 339 | SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas) |
| 340 | }, |
| 341 | { |
[email protected] | 69cffc8 | 2012-08-10 13:27:27 | [diff] [blame] | 342 | "disable-deferred-2d-canvas", |
| 343 | IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_NAME, |
| 344 | IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_DESCRIPTION, |
| 345 | kOsAll, |
| 346 | SINGLE_VALUE_TYPE(switches::kDisableDeferred2dCanvas) |
| 347 | }, |
| 348 | { |
[email protected] | efcde13 | 2012-05-30 01:05:18 | [diff] [blame] | 349 | "disable-threaded-animation", |
| 350 | IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME, |
| 351 | IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION, |
[email protected] | 644a107 | 2012-03-16 09:29:59 | [diff] [blame] | 352 | kOsAll, |
[email protected] | 65bfd997 | 2012-10-19 03:39:37 | [diff] [blame] | 353 | SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation) |
[email protected] | 644a107 | 2012-03-16 09:29:59 | [diff] [blame] | 354 | }, |
| 355 | { |
[email protected] | 5963b77 | 2011-02-09 22:55:38 | [diff] [blame] | 356 | "composited-layer-borders", |
| 357 | IDS_FLAGS_COMPOSITED_LAYER_BORDERS, |
| 358 | IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION, |
| 359 | kOsAll, |
| 360 | SINGLE_VALUE_TYPE(switches::kShowCompositedLayerBorders) |
| 361 | }, |
| 362 | { |
[email protected] | a8f1eaa | 2011-03-07 19:00:58 | [diff] [blame] | 363 | "show-fps-counter", |
| 364 | IDS_FLAGS_SHOW_FPS_COUNTER, |
| 365 | IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION, |
| 366 | kOsAll, |
| 367 | SINGLE_VALUE_TYPE(switches::kShowFPSCounter) |
| 368 | }, |
[email protected] | 8ff7f34 | 2011-05-25 01:49:47 | [diff] [blame] | 369 | { |
[email protected] | 70c98a33 | 2011-12-21 20:51:52 | [diff] [blame] | 370 | "accelerated-filters", |
| 371 | IDS_FLAGS_ACCELERATED_FILTERS, |
| 372 | IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION, |
| 373 | kOsAll, |
| 374 | SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters) |
| 375 | }, |
| 376 | { |
[email protected] | 8ff7f34 | 2011-05-25 01:49:47 | [diff] [blame] | 377 | "disable-gpu-vsync", |
| 378 | IDS_FLAGS_DISABLE_GPU_VSYNC_NAME, |
| 379 | IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 380 | kOsDesktop, |
[email protected] | 8ff7f34 | 2011-05-25 01:49:47 | [diff] [blame] | 381 | SINGLE_VALUE_TYPE(switches::kDisableGpuVsync) |
| 382 | }, |
[email protected] | deaba6d5 | 2011-09-23 14:47:12 | [diff] [blame] | 383 | { |
[email protected] | 4052d83 | 2013-01-16 05:31:01 | [diff] [blame] | 384 | "enable-webgl", |
| 385 | IDS_FLAGS_ENABLE_WEBGL_NAME, |
| 386 | IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION, |
| 387 | kOsAndroid, |
| 388 | #if defined(OS_ANDROID) |
| 389 | SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL) |
| 390 | #else |
| 391 | SINGLE_VALUE_TYPE("") |
| 392 | #endif |
| 393 | }, |
| 394 | { |
[email protected] | deaba6d5 | 2011-09-23 14:47:12 | [diff] [blame] | 395 | "disable-webgl", |
| 396 | IDS_FLAGS_DISABLE_WEBGL_NAME, |
| 397 | IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 398 | kOsDesktop, |
[email protected] | 4052d83 | 2013-01-16 05:31:01 | [diff] [blame] | 399 | #if defined(OS_ANDROID) |
| 400 | SINGLE_VALUE_TYPE("") |
| 401 | #else |
[email protected] | deaba6d5 | 2011-09-23 14:47:12 | [diff] [blame] | 402 | SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL) |
[email protected] | 4052d83 | 2013-01-16 05:31:01 | [diff] [blame] | 403 | #endif |
[email protected] | deaba6d5 | 2011-09-23 14:47:12 | [diff] [blame] | 404 | }, |
[email protected] | 09096e0 | 2012-05-24 11:12:04 | [diff] [blame] | 405 | { |
[email protected] | d9da958 | 2013-01-31 04:59:05 | [diff] [blame] | 406 | "enable-webrtc", |
| 407 | IDS_FLAGS_ENABLE_WEBRTC_NAME, |
| 408 | IDS_FLAGS_ENABLE_WEBRTC_DESCRIPTION, |
| 409 | kOsAndroid, |
| 410 | #if defined(OS_ANDROID) |
| 411 | SINGLE_VALUE_TYPE(switches::kEnableWebRTC) |
| 412 | #else |
| 413 | SINGLE_VALUE_TYPE("") |
| 414 | #endif |
| 415 | }, |
| 416 | { |
[email protected] | 96bcdc10 | 2012-05-24 23:42:10 | [diff] [blame] | 417 | "fixed-position-creates-stacking-context", |
| 418 | IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME, |
| 419 | IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION, |
| 420 | kOsAll, |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 421 | ENABLE_DISABLE_VALUE_TYPE( |
| 422 | switches::kEnableFixedPositionCreatesStackingContext, |
| 423 | switches::kDisableFixedPositionCreatesStackingContext) |
[email protected] | 96bcdc10 | 2012-05-24 23:42:10 | [diff] [blame] | 424 | }, |
[email protected] | fb85419 | 2013-02-06 01:30:04 | [diff] [blame] | 425 | { |
| 426 | "enable-compositing-for-fixed-position", |
| 427 | IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME, |
| 428 | IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION, |
| 429 | kOsAll, |
| 430 | MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices) |
| 431 | }, |
[email protected] | a7640ef2 | 2012-10-06 00:52:08 | [diff] [blame] | 432 | // TODO(bbudge): When NaCl is on by default, remove this flag entry. |
[email protected] | 2fe15fcb | 2010-10-21 20:39:53 | [diff] [blame] | 433 | { |
[email protected] | e3791ce9 | 2011-08-09 01:03:32 | [diff] [blame] | 434 | "enable-nacl", // FLAGS:RECORD_UMA |
[email protected] | 4ff87d20 | 2010-11-06 01:28:40 | [diff] [blame] | 435 | IDS_FLAGS_ENABLE_NACL_NAME, |
| 436 | IDS_FLAGS_ENABLE_NACL_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 437 | kOsDesktop, |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 438 | SINGLE_VALUE_TYPE(switches::kEnableNaCl) |
[email protected] | 4ff87d20 | 2010-11-06 01:28:40 | [diff] [blame] | 439 | }, |
[email protected] | b39c6d9 | 2012-01-31 16:38:41 | [diff] [blame] | 440 | // TODO(halyavin): When exception handling is on by default, replace this |
| 441 | // flag with disable-nacl-exception-handling. |
| 442 | { |
| 443 | "enable-nacl-exception-handling", // FLAGS:RECORD_UMA |
| 444 | IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_NAME, |
| 445 | IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 446 | kOsDesktop, |
[email protected] | b39c6d9 | 2012-01-31 16:38:41 | [diff] [blame] | 447 | SINGLE_VALUE_TYPE(switches::kEnableNaClExceptionHandling) |
| 448 | }, |
[email protected] | 4ff87d20 | 2010-11-06 01:28:40 | [diff] [blame] | 449 | { |
[email protected] | 9addd1c | 2012-09-15 14:28:24 | [diff] [blame] | 450 | "enable-nacl-debug", // FLAGS:RECORD_UMA |
| 451 | IDS_FLAGS_ENABLE_NACL_DEBUG_NAME, |
| 452 | IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 453 | kOsDesktop, |
[email protected] | 9addd1c | 2012-09-15 14:28:24 | [diff] [blame] | 454 | SINGLE_VALUE_TYPE(switches::kEnableNaClDebug) |
[email protected] | 401b9079 | 2012-05-30 11:41:13 | [diff] [blame] | 455 | }, |
| 456 | { |
[email protected] | 66f409c | 2012-10-04 20:59:04 | [diff] [blame] | 457 | "nacl-debug-mask", // FLAGS:RECORD_UMA |
| 458 | IDS_FLAGS_NACL_DEBUG_MASK_NAME, |
| 459 | IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 460 | kOsDesktop, |
[email protected] | 66f409c | 2012-10-04 20:59:04 | [diff] [blame] | 461 | MULTI_VALUE_TYPE(kNaClDebugMaskChoices) |
| 462 | }, |
| 463 | { |
[email protected] | 7babd1c | 2012-08-08 20:35:29 | [diff] [blame] | 464 | "enable-pnacl", // FLAGS:RECORD_UMA |
| 465 | IDS_FLAGS_ENABLE_PNACL_NAME, |
| 466 | IDS_FLAGS_ENABLE_PNACL_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 467 | kOsDesktop, |
[email protected] | 7babd1c | 2012-08-08 20:35:29 | [diff] [blame] | 468 | SINGLE_VALUE_TYPE(switches::kEnablePnacl) |
| 469 | }, |
| 470 | { |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 471 | "extension-apis", // FLAGS:RECORD_UMA |
[email protected] | 11dd68cd5 | 2010-11-12 01:15:32 | [diff] [blame] | 472 | IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME, |
| 473 | IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 474 | kOsDesktop, |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 475 | SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis) |
[email protected] | 11dd68cd5 | 2010-11-12 01:15:32 | [diff] [blame] | 476 | }, |
[email protected] | 3627b06d | 2010-11-12 16:36:16 | [diff] [blame] | 477 | { |
[email protected] | 544471a | 2012-10-13 05:27:09 | [diff] [blame] | 478 | "action-box", |
[email protected] | cab18ef | 2012-04-27 07:22:03 | [diff] [blame] | 479 | IDS_FLAGS_ACTION_BOX_NAME, |
| 480 | IDS_FLAGS_ACTION_BOX_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 481 | kOsDesktop, |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 482 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kActionBox, "1", |
| 483 | switches::kActionBox, "0") |
[email protected] | cab18ef | 2012-04-27 07:22:03 | [diff] [blame] | 484 | }, |
| 485 | { |
[email protected] | 3a36243 | 2012-06-18 20:39:51 | [diff] [blame] | 486 | "script-badges", |
| 487 | IDS_FLAGS_SCRIPT_BADGES_NAME, |
| 488 | IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 489 | kOsDesktop, |
[email protected] | 544471a | 2012-10-13 05:27:09 | [diff] [blame] | 490 | SINGLE_VALUE_TYPE(switches::kScriptBadges) |
| 491 | }, |
| 492 | { |
| 493 | "script-bubble", |
| 494 | IDS_FLAGS_SCRIPT_BUBBLE_NAME, |
| 495 | IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 496 | kOsDesktop, |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 497 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kScriptBubble, "1", |
| 498 | switches::kScriptBubble, "0") |
[email protected] | 3a36243 | 2012-06-18 20:39:51 | [diff] [blame] | 499 | }, |
| 500 | { |
[email protected] | cbe224d | 2011-08-04 22:12:49 | [diff] [blame] | 501 | "apps-new-install-bubble", |
| 502 | IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME, |
| 503 | IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 504 | kOsDesktop, |
[email protected] | cbe224d | 2011-08-04 22:12:49 | [diff] [blame] | 505 | SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble) |
| 506 | }, |
| 507 | { |
[email protected] | 80bd24e | 2010-11-30 09:34:38 | [diff] [blame] | 508 | "disable-hyperlink-auditing", |
| 509 | IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME, |
| 510 | IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION, |
| 511 | kOsAll, |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 512 | SINGLE_VALUE_TYPE(switches::kNoPings) |
[email protected] | feb28fef | 2010-12-01 10:52:51 | [diff] [blame] | 513 | }, |
| 514 | { |
| 515 | "experimental-location-features", // FLAGS:RECORD_UMA |
| 516 | IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME, |
| 517 | IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION, |
| 518 | kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS. |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 519 | SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures) |
| 520 | }, |
| 521 | { |
[email protected] | 5aea186 | 2011-03-23 23:55:39 | [diff] [blame] | 522 | "tab-groups-context-menu", |
| 523 | IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME, |
| 524 | IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION, |
| 525 | kOsWin, |
| 526 | SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu) |
| 527 | }, |
[email protected] | c94cebd | 2012-06-21 00:55:28 | [diff] [blame] | 528 | { |
| 529 | "enable-instant-extended-api", |
| 530 | IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API, |
| 531 | IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 532 | kOsDesktop, |
[email protected] | 7344438 | 2013-02-26 19:31:51 | [diff] [blame] | 533 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI, |
| 534 | switches::kDisableInstantExtendedAPI) |
[email protected] | c94cebd | 2012-06-21 00:55:28 | [diff] [blame] | 535 | }, |
[email protected] | e9bf9d9 | 2011-03-31 20:57:15 | [diff] [blame] | 536 | { |
[email protected] | 354e33b | 2011-06-15 00:29:10 | [diff] [blame] | 537 | "static-ip-config", |
| 538 | IDS_FLAGS_STATIC_IP_CONFIG_NAME, |
| 539 | IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION, |
| 540 | kOsCrOS, |
| 541 | #if defined(OS_CHROMEOS) |
| 542 | // This switch exists only on Chrome OS. |
| 543 | SINGLE_VALUE_TYPE(switches::kEnableStaticIPConfig) |
| 544 | #else |
| 545 | SINGLE_VALUE_TYPE("") |
| 546 | #endif |
| 547 | }, |
[email protected] | 3eb5728c | 2011-06-20 22:32:24 | [diff] [blame] | 548 | { |
| 549 | "show-autofill-type-predictions", |
| 550 | IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME, |
| 551 | IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION, |
| 552 | kOsAll, |
| 553 | SINGLE_VALUE_TYPE(switches::kShowAutofillTypePredictions) |
| 554 | }, |
[email protected] | bff4d3e | 2011-06-21 23:58:52 | [diff] [blame] | 555 | { |
[email protected] | fdf4e25 | 2012-04-27 00:26:55 | [diff] [blame] | 556 | "sync-tab-favicons", |
| 557 | IDS_FLAGS_SYNC_TAB_FAVICONS_NAME, |
| 558 | IDS_FLAGS_SYNC_TAB_FAVICONS_DESCRIPTION, |
| 559 | kOsAll, |
| 560 | SINGLE_VALUE_TYPE(switches::kSyncTabFavicons) |
| 561 | }, |
| 562 | { |
[email protected] | aae9eeb1 | 2011-10-21 21:59:26 | [diff] [blame] | 563 | "sync-app-notifications", |
| 564 | IDS_FLAGS_SYNC_APP_NOTIFICATIONS_NAME, |
| 565 | IDS_FLAGS_SYNC_APP_NOTIFICATIONS_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 566 | kOsDesktop, |
[email protected] | 0b6fba8 | 2011-11-18 01:31:11 | [diff] [blame] | 567 | SINGLE_VALUE_TYPE(switches::kDisableSyncAppNotifications) |
[email protected] | aae9eeb1 | 2011-10-21 21:59:26 | [diff] [blame] | 568 | }, |
| 569 | { |
[email protected] | 5d90a0a | 2012-11-15 02:43:40 | [diff] [blame] | 570 | "sync-keystore-encryption", |
| 571 | IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME, |
| 572 | IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION, |
| 573 | kOsAll, |
| 574 | SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption) |
| 575 | }, |
| 576 | { |
[email protected] | e755a38 | 2012-09-13 17:16:35 | [diff] [blame] | 577 | "enable-gesture-tap-highlight", |
| 578 | IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME, |
| 579 | IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION, |
| 580 | kOsLinux | kOsCrOS, |
| 581 | SINGLE_VALUE_TYPE(switches::kEnableGestureTapHighlight) |
| 582 | }, |
| 583 | { |
[email protected] | a22ebd81 | 2011-06-23 00:05:39 | [diff] [blame] | 584 | "enable-smooth-scrolling", // FLAGS:RECORD_UMA |
| 585 | IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME, |
| 586 | IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION, |
| 587 | // Can't expose the switch unless the code is compiled in. |
[email protected] | 554b706 | 2011-09-03 03:09:40 | [diff] [blame] | 588 | // On by default for the Mac (different implementation in WebKit). |
[email protected] | 2a5e9d0 | 2013-01-20 01:09:25 | [diff] [blame] | 589 | kOsWin | kOsLinux, |
[email protected] | a22ebd81 | 2011-06-23 00:05:39 | [diff] [blame] | 590 | SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling) |
| 591 | }, |
[email protected] | 81a6b0b | 2011-06-24 17:55:40 | [diff] [blame] | 592 | { |
[email protected] | 6831780 | 2012-06-07 19:13:23 | [diff] [blame] | 593 | "omnibox-history-quick-provider-new-scoring", |
| 594 | IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME, |
| 595 | IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION, |
| 596 | kOsAll, |
| 597 | MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderNewScoringChoices) |
| 598 | }, |
| 599 | { |
[email protected] | 128dc6c | 2012-06-22 20:30:35 | [diff] [blame] | 600 | "omnibox-history-quick-provider-reorder-for-inlining", |
| 601 | IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME, |
| 602 | IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION, |
| 603 | kOsAll, |
| 604 | MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices) |
| 605 | }, |
| 606 | { |
[email protected] | 032d5e6c | 2012-02-17 17:53:55 | [diff] [blame] | 607 | "omnibox-inline-history-quick-provider", |
| 608 | IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME, |
| 609 | IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION, |
| 610 | kOsAll, |
| 611 | MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices) |
| 612 | }, |
| 613 | { |
[email protected] | 7e7a2809 | 2011-12-09 22:24:55 | [diff] [blame] | 614 | "enable-panels", |
| 615 | IDS_FLAGS_ENABLE_PANELS_NAME, |
| 616 | IDS_FLAGS_ENABLE_PANELS_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 617 | kOsDesktop, |
[email protected] | 7e7a2809 | 2011-12-09 22:24:55 | [diff] [blame] | 618 | SINGLE_VALUE_TYPE(switches::kEnablePanels) |
[email protected] | 73fb1fc5 | 2011-07-09 00:06:54 | [diff] [blame] | 619 | }, |
[email protected] | e3749d1 | 2011-07-25 22:22:12 | [diff] [blame] | 620 | { |
[email protected] | 27c14f0 | 2012-06-22 17:29:58 | [diff] [blame] | 621 | // See http://crbug.com/120416 for how to remove this flag. |
[email protected] | 6474b11 | 2012-05-04 19:35:27 | [diff] [blame] | 622 | "save-page-as-mhtml", // FLAGS:RECORD_UMA |
| 623 | IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME, |
| 624 | IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION, |
| 625 | kOsMac | kOsWin | kOsLinux, |
| 626 | SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML) |
| 627 | }, |
| 628 | { |
[email protected] | b7bb44f | 2011-09-01 05:17:03 | [diff] [blame] | 629 | "enable-autologin", |
| 630 | IDS_FLAGS_ENABLE_AUTOLOGIN_NAME, |
| 631 | IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION, |
| 632 | kOsMac | kOsWin | kOsLinux, |
| 633 | SINGLE_VALUE_TYPE(switches::kEnableAutologin) |
| 634 | }, |
[email protected] | b984117 | 2011-09-26 23:36:09 | [diff] [blame] | 635 | { |
[email protected] | 3231b61 | 2012-03-23 05:57:54 | [diff] [blame] | 636 | "enable-spdy3", |
| 637 | IDS_FLAGS_ENABLE_SPDY3_NAME, |
| 638 | IDS_FLAGS_ENABLE_SPDY3_DESCRIPTION, |
| 639 | kOsAll, |
| 640 | SINGLE_VALUE_TYPE(switches::kEnableSpdy3) |
| 641 | }, |
| 642 | { |
[email protected] | 27b3fe9 | 2012-03-21 05:35:06 | [diff] [blame] | 643 | "enable-async-dns", |
| 644 | IDS_FLAGS_ENABLE_ASYNC_DNS_NAME, |
| 645 | IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION, |
[email protected] | 85594c14 | 2012-09-11 18:02:46 | [diff] [blame] | 646 | kOsWin | kOsMac | kOsLinux | kOsCrOS, |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 647 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns, |
| 648 | switches::kDisableAsyncDns) |
[email protected] | 27b3fe9 | 2012-03-21 05:35:06 | [diff] [blame] | 649 | }, |
| 650 | { |
[email protected] | 1eb9380 | 2012-09-11 18:57:56 | [diff] [blame] | 651 | "disable-media-source", |
[email protected] | da43c08 | 2012-09-07 18:56:11 | [diff] [blame] | 652 | IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME, |
| 653 | IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION, |
[email protected] | ec9d053 | 2012-03-21 05:55:32 | [diff] [blame] | 654 | kOsAll, |
[email protected] | da43c08 | 2012-09-07 18:56:11 | [diff] [blame] | 655 | SINGLE_VALUE_TYPE(switches::kDisableMediaSource) |
[email protected] | 6aa03b3 | 2011-10-27 21:44:44 | [diff] [blame] | 656 | }, |
[email protected] | e4e68dbb | 2011-11-18 01:50:22 | [diff] [blame] | 657 | { |
[email protected] | 36d9841 | 2013-01-31 20:28:53 | [diff] [blame] | 658 | "disable-encrypted-media", |
| 659 | IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME, |
| 660 | IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 661 | kOsDesktop, |
[email protected] | 36d9841 | 2013-01-31 20:28:53 | [diff] [blame] | 662 | SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia) |
[email protected] | 9f5b782 | 2012-04-18 23:39:03 | [diff] [blame] | 663 | }, |
[email protected] | f8862879 | 2012-12-18 07:07:50 | [diff] [blame] | 664 | { |
| 665 | "enable-opus-playback", |
| 666 | IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME, |
| 667 | IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 668 | kOsDesktop, |
[email protected] | f8862879 | 2012-12-18 07:07:50 | [diff] [blame] | 669 | SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback) |
| 670 | }, |
[email protected] | ca6eaa5a | 2013-01-24 16:16:04 | [diff] [blame] | 671 | { |
[email protected] | c54e1aa | 2013-01-25 09:26:17 | [diff] [blame] | 672 | "enable-vp9-playback", |
| 673 | IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME, |
| 674 | IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION, |
| 675 | kOsDesktop, |
| 676 | SINGLE_VALUE_TYPE(switches::kEnableVp9Playback) |
| 677 | }, |
| 678 | { |
[email protected] | ca6eaa5a | 2013-01-24 16:16:04 | [diff] [blame] | 679 | "enable-managed-users", |
| 680 | IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME, |
| 681 | IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION, |
| 682 | kOsAll, |
| 683 | SINGLE_VALUE_TYPE(switches::kEnableManagedUsers) |
| 684 | }, |
[email protected] | dc04be7c | 2012-03-15 23:57:49 | [diff] [blame] | 685 | #if defined(USE_ASH) |
[email protected] | 8cc10df | 2011-11-03 23:57:50 | [diff] [blame] | 686 | { |
[email protected] | cda278d | 2012-10-30 20:31:40 | [diff] [blame] | 687 | "ash-disable-auto-window-placement", |
| 688 | IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME, |
| 689 | IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION, |
| 690 | kOsWin | kOsLinux | kOsCrOS, |
| 691 | SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement) |
| 692 | }, |
[email protected] | b4e4ec4 | 2012-11-29 21:42:40 | [diff] [blame] | 693 | { |
[email protected] | 16f55a2 | 2013-02-13 23:47:34 | [diff] [blame] | 694 | "ash-disable-per-app-launcher", |
| 695 | IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME, |
| 696 | IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION, |
[email protected] | b4e4ec4 | 2012-11-29 21:42:40 | [diff] [blame] | 697 | kOsWin | kOsLinux | kOsCrOS, |
[email protected] | 16f55a2 | 2013-02-13 23:47:34 | [diff] [blame] | 698 | SINGLE_VALUE_TYPE(ash::switches::kAshDisablePerAppLauncher) |
[email protected] | b4e4ec4 | 2012-11-29 21:42:40 | [diff] [blame] | 699 | }, |
[email protected] | 1c92d862 | 2013-03-06 13:06:13 | [diff] [blame] | 700 | { |
| 701 | "ash-enable-full-browser-list-in-launcher", |
| 702 | IDS_FLAGS_ASH_ENABLE_FULL_BROWSER_LIST_IN_LAUNCHER_NAME, |
| 703 | IDS_FLAGS_ASH_ENABLE_FULL_BROWSER_LIST_IN_LAUNCHER_DESCRIPTION, |
| 704 | kOsWin | kOsLinux | kOsCrOS, |
| 705 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableFullBrowserListInLauncher) |
| 706 | }, |
[email protected] | dc04be7c | 2012-03-15 23:57:49 | [diff] [blame] | 707 | #endif |
[email protected] | eaae8b46 | 2012-01-20 22:20:39 | [diff] [blame] | 708 | { |
[email protected] | db543d32 | 2011-12-15 20:40:15 | [diff] [blame] | 709 | "per-tile-painting", |
| 710 | IDS_FLAGS_PER_TILE_PAINTING_NAME, |
| 711 | IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION, |
[email protected] | a5b1b27 | 2012-01-06 20:44:37 | [diff] [blame] | 712 | kOsMac | kOsLinux | kOsCrOS, |
[email protected] | 65bfd997 | 2012-10-19 03:39:37 | [diff] [blame] | 713 | SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting) |
[email protected] | db543d32 | 2011-12-15 20:40:15 | [diff] [blame] | 714 | }, |
[email protected] | bf88c03 | 2011-12-22 19:05:47 | [diff] [blame] | 715 | { |
| 716 | "enable-javascript-harmony", |
| 717 | IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME, |
| 718 | IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION, |
| 719 | kOsAll, |
| 720 | SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony") |
| 721 | }, |
[email protected] | 7e7f378a | 2012-01-05 14:35:37 | [diff] [blame] | 722 | { |
[email protected] | 8564617 | 2012-01-09 22:45:54 | [diff] [blame] | 723 | "enable-tab-browser-dragging", |
| 724 | IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME, |
| 725 | IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION, |
| 726 | kOsWin, |
| 727 | SINGLE_VALUE_TYPE(switches::kTabBrowserDragging) |
| 728 | }, |
| 729 | { |
[email protected] | 068b7b5 | 2012-02-27 12:41:44 | [diff] [blame] | 730 | "disable-restore-session-state", |
| 731 | IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME, |
| 732 | IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION, |
[email protected] | 7e7f378a | 2012-01-05 14:35:37 | [diff] [blame] | 733 | kOsAll, |
[email protected] | 068b7b5 | 2012-02-27 12:41:44 | [diff] [blame] | 734 | SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState) |
[email protected] | 7e7f378a | 2012-01-05 14:35:37 | [diff] [blame] | 735 | }, |
[email protected] | 88864db | 2012-01-18 20:56:35 | [diff] [blame] | 736 | { |
| 737 | "disable-software-rasterizer", |
| 738 | IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME, |
| 739 | IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION, |
| 740 | #if defined(ENABLE_SWIFTSHADER) |
| 741 | kOsAll, |
| 742 | #else |
| 743 | 0, |
| 744 | #endif |
| 745 | SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer) |
| 746 | }, |
[email protected] | 15a5d72 | 2012-01-23 09:11:14 | [diff] [blame] | 747 | { |
[email protected] | ff7b6dd | 2012-09-15 20:20:03 | [diff] [blame] | 748 | "enable-experimental-webkit-features", |
| 749 | IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME, |
| 750 | IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION, |
[email protected] | d2edc670 | 2012-01-30 09:13:16 | [diff] [blame] | 751 | kOsAll, |
[email protected] | ff7b6dd | 2012-09-15 20:20:03 | [diff] [blame] | 752 | SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures) |
[email protected] | ca7a3d79 | 2012-03-02 15:55:49 | [diff] [blame] | 753 | }, |
| 754 | { |
[email protected] | 0f95a25 | 2012-09-13 22:30:04 | [diff] [blame] | 755 | "enable-css-shaders", |
| 756 | IDS_FLAGS_CSS_SHADERS_NAME, |
| 757 | IDS_FLAGS_CSS_SHADERS_DESCRIPTION, |
| 758 | kOsAll, |
| 759 | SINGLE_VALUE_TYPE(switches::kEnableCssShaders) |
| 760 | }, |
| 761 | { |
[email protected] | 9860c68b | 2012-02-02 01:58:09 | [diff] [blame] | 762 | "enable-extension-activity-ui", |
| 763 | IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME, |
| 764 | IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 765 | kOsDesktop, |
[email protected] | 9860c68b | 2012-02-02 01:58:09 | [diff] [blame] | 766 | SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI) |
[email protected] | 8bed69d | 2012-02-02 06:46:00 | [diff] [blame] | 767 | }, |
[email protected] | 54ae4e9 | 2012-02-16 15:19:05 | [diff] [blame] | 768 | { |
[email protected] | 3e8befc | 2012-03-13 01:17:03 | [diff] [blame] | 769 | "disable-ntp-other-sessions-menu", |
[email protected] | 156f96633 | 2012-02-29 00:03:16 | [diff] [blame] | 770 | IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME, |
| 771 | IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 772 | kOsDesktop, |
[email protected] | 3e8befc | 2012-03-13 01:17:03 | [diff] [blame] | 773 | SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu) |
[email protected] | 156f96633 | 2012-02-29 00:03:16 | [diff] [blame] | 774 | }, |
[email protected] | dc04be7c | 2012-03-15 23:57:49 | [diff] [blame] | 775 | #if defined(USE_ASH) |
[email protected] | 31cf1c5 | 2012-02-29 20:55:01 | [diff] [blame] | 776 | { |
[email protected] | 3cd198a2 | 2012-03-12 20:38:01 | [diff] [blame] | 777 | "enable-ash-oak", |
| 778 | IDS_FLAGS_ENABLE_ASH_OAK_NAME, |
| 779 | IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION, |
| 780 | kOsAll, |
| 781 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak), |
| 782 | }, |
[email protected] | 31cf1c5 | 2012-02-29 20:55:01 | [diff] [blame] | 783 | #endif |
[email protected] | 184ec59 | 2012-03-01 11:54:28 | [diff] [blame] | 784 | { |
| 785 | "enable-devtools-experiments", |
| 786 | IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME, |
| 787 | IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 788 | kOsDesktop, |
[email protected] | 184ec59 | 2012-03-01 11:54:28 | [diff] [blame] | 789 | SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments) |
| 790 | }, |
[email protected] | 76d1854e | 2012-03-02 23:57:44 | [diff] [blame] | 791 | { |
[email protected] | 2fefdb3 | 2013-02-26 14:28:10 | [diff] [blame] | 792 | "silent-debugger-extension-api", |
| 793 | IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME, |
| 794 | IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION, |
| 795 | kOsDesktop, |
| 796 | SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI) |
| 797 | }, |
| 798 | { |
[email protected] | 76d1854e | 2012-03-02 23:57:44 | [diff] [blame] | 799 | "enable-suggestions-ntp", |
| 800 | IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME, |
| 801 | IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 802 | kOsDesktop, |
[email protected] | 76d1854e | 2012-03-02 23:57:44 | [diff] [blame] | 803 | SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage) |
| 804 | }, |
[email protected] | a3d5425 | 2012-04-05 20:04:13 | [diff] [blame] | 805 | { |
[email protected] | 1dbaf5e | 2012-11-30 05:51:32 | [diff] [blame] | 806 | "spellcheck-autocorrect", |
| 807 | IDS_FLAGS_SPELLCHECK_AUTOCORRECT, |
| 808 | IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION, |
| 809 | kOsWin | kOsLinux | kOsCrOS, |
| 810 | SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect) |
| 811 | }, |
| 812 | { |
[email protected] | d793253 | 2012-11-21 21:10:31 | [diff] [blame] | 813 | "touch-events", |
| 814 | IDS_TOUCH_EVENTS_NAME, |
| 815 | IDS_TOUCH_EVENTS_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 816 | kOsDesktop, |
[email protected] | d793253 | 2012-11-21 21:10:31 | [diff] [blame] | 817 | MULTI_VALUE_TYPE(kTouchEventsChoices) |
| 818 | }, |
| 819 | { |
[email protected] | c9c73ad4 | 2012-04-18 03:35:59 | [diff] [blame] | 820 | "touch-optimized-ui", |
[email protected] | 347a0c7 | 2012-05-14 20:28:06 | [diff] [blame] | 821 | IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME, |
| 822 | IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION, |
[email protected] | c71fe640 | 2012-08-15 15:22:55 | [diff] [blame] | 823 | kOsWin, |
[email protected] | 347a0c7 | 2012-05-14 20:28:06 | [diff] [blame] | 824 | MULTI_VALUE_TYPE(kTouchOptimizedUIChoices) |
[email protected] | c9c73ad4 | 2012-04-18 03:35:59 | [diff] [blame] | 825 | }, |
[email protected] | 8a6aaa7 | 2012-04-20 20:53:58 | [diff] [blame] | 826 | { |
[email protected] | b9c96ff | 2012-11-26 22:24:40 | [diff] [blame] | 827 | "disable-touch-adjustment", |
| 828 | IDS_DISABLE_TOUCH_ADJUSTMENT_NAME, |
| 829 | IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION, |
| 830 | kOsWin | kOsLinux | kOsCrOS, |
| 831 | SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment) |
| 832 | }, |
| 833 | { |
[email protected] | 0b9383a | 2012-10-26 00:58:16 | [diff] [blame] | 834 | "enable-tab-capture", |
| 835 | IDS_ENABLE_TAB_CAPTURE_NAME, |
| 836 | IDS_ENABLE_TAB_CAPTURE_DESCRIPTION, |
[email protected] | a692d13 | 2012-10-31 05:15:25 | [diff] [blame] | 837 | kOsWin | kOsMac | kOsLinux | kOsCrOS, |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 838 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kTabCapture, "1", |
| 839 | switches::kTabCapture, "0") |
[email protected] | 0b9383a | 2012-10-26 00:58:16 | [diff] [blame] | 840 | }, |
[email protected] | 0b60afa | 2012-04-19 17:36:39 | [diff] [blame] | 841 | #if defined(OS_CHROMEOS) |
| 842 | { |
[email protected] | 7c4a9bc | 2012-09-11 22:10:05 | [diff] [blame] | 843 | "enable-background-loader", |
| 844 | IDS_ENABLE_BACKLOADER_NAME, |
| 845 | IDS_ENABLE_BACKLOADER_DESCRIPTION, |
| 846 | kOsCrOS, |
| 847 | SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader) |
| 848 | }, |
| 849 | { |
[email protected] | c5667b28 | 2012-08-31 00:32:50 | [diff] [blame] | 850 | "enable-bezel-touch", |
| 851 | IDS_ENABLE_BEZEL_TOUCH_NAME, |
| 852 | IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION, |
[email protected] | 1995d80d | 2012-08-23 02:58:47 | [diff] [blame] | 853 | kOsCrOS, |
[email protected] | c5667b28 | 2012-08-31 00:32:50 | [diff] [blame] | 854 | SINGLE_VALUE_TYPE(switches::kEnableBezelTouch) |
[email protected] | 1995d80d | 2012-08-23 02:58:47 | [diff] [blame] | 855 | }, |
| 856 | { |
[email protected] | 3f4181a | 2013-02-01 21:31:07 | [diff] [blame] | 857 | "enable-screensaver-extension", |
| 858 | IDS_ENABLE_SCREENSAVER_EXTENSION_NAME, |
| 859 | IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION, |
| 860 | kOsCrOS, |
| 861 | SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions) |
| 862 | }, |
| 863 | { |
[email protected] | 0b60afa | 2012-04-19 17:36:39 | [diff] [blame] | 864 | "no-discard-tabs", |
| 865 | IDS_FLAGS_NO_DISCARD_TABS_NAME, |
| 866 | IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION, |
| 867 | kOsCrOS, |
| 868 | SINGLE_VALUE_TYPE(switches::kNoDiscardTabs) |
| 869 | }, |
| 870 | #endif |
[email protected] | 79be6d3 | 2012-04-24 20:47:44 | [diff] [blame] | 871 | { |
[email protected] | 8d68a3e0 | 2013-01-12 15:57:10 | [diff] [blame] | 872 | "enable-download-resumption", |
| 873 | IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME, |
| 874 | IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 875 | kOsDesktop, |
[email protected] | 8d68a3e0 | 2013-01-12 15:57:10 | [diff] [blame] | 876 | SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption) |
| 877 | }, |
| 878 | { |
[email protected] | 9a5940d | 2012-04-27 19:16:23 | [diff] [blame] | 879 | "allow-nacl-socket-api", |
| 880 | IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME, |
| 881 | IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 882 | kOsDesktop, |
[email protected] | 9a5940d | 2012-04-27 19:16:23 | [diff] [blame] | 883 | SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*") |
| 884 | }, |
[email protected] | 8533373 | 2012-05-01 19:02:24 | [diff] [blame] | 885 | { |
[email protected] | 60673ad7 | 2012-05-02 06:16:33 | [diff] [blame] | 886 | "stacked-tab-strip", |
| 887 | IDS_FLAGS_STACKED_TAB_STRIP_NAME, |
| 888 | IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION, |
| 889 | kOsWin, |
| 890 | SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip) |
| 891 | }, |
| 892 | { |
[email protected] | 4bd2020 | 2012-06-14 17:35:01 | [diff] [blame] | 893 | "force-device-scale-factor", |
[email protected] | 8533373 | 2012-05-01 19:02:24 | [diff] [blame] | 894 | IDS_FLAGS_FORCE_HIGH_DPI_NAME, |
| 895 | IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION, |
| 896 | kOsCrOS, |
[email protected] | 4bd2020 | 2012-06-14 17:35:01 | [diff] [blame] | 897 | SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2") |
[email protected] | 8533373 | 2012-05-01 19:02:24 | [diff] [blame] | 898 | }, |
[email protected] | 190349fd | 2012-05-02 00:10:47 | [diff] [blame] | 899 | #if defined(OS_CHROMEOS) |
| 900 | { |
| 901 | "allow-touchpad-three-finger-click", |
| 902 | IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME, |
| 903 | IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION, |
| 904 | kOsCrOS, |
| 905 | SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick) |
| 906 | }, |
[email protected] | fbc176b6 | 2012-10-27 02:19:58 | [diff] [blame] | 907 | { |
| 908 | "allow-touchpad-three-finger-swipe", |
| 909 | IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME, |
| 910 | IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION, |
| 911 | kOsCrOS, |
| 912 | SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe) |
| 913 | }, |
[email protected] | 190349fd | 2012-05-02 00:10:47 | [diff] [blame] | 914 | #endif |
[email protected] | 1992a2f4 | 2012-10-23 18:32:21 | [diff] [blame] | 915 | { |
[email protected] | a585e46 | 2013-01-26 00:37:15 | [diff] [blame] | 916 | "use-client-login-signin-flow", |
| 917 | IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME, |
| 918 | IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION, |
[email protected] | 1992a2f4 | 2012-10-23 18:32:21 | [diff] [blame] | 919 | kOsMac | kOsWin | kOsLinux, |
[email protected] | a585e46 | 2013-01-26 00:37:15 | [diff] [blame] | 920 | SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow) |
[email protected] | 1992a2f4 | 2012-10-23 18:32:21 | [diff] [blame] | 921 | }, |
[email protected] | 8ee0224 | 2012-12-04 15:23:32 | [diff] [blame] | 922 | { |
| 923 | "enable-desktop-guest-mode", |
| 924 | IDS_FLAGS_DESKTOP_GUEST_MODE_NAME, |
| 925 | IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION, |
| 926 | kOsMac | kOsWin | kOsLinux, |
| 927 | SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode) |
| 928 | }, |
[email protected] | 53520b1b | 2012-05-07 21:43:37 | [diff] [blame] | 929 | #if defined(USE_ASH) |
| 930 | { |
[email protected] | fac380e0 | 2013-03-08 20:06:30 | [diff] [blame] | 931 | "hide-launcher-alignment-menu", |
| 932 | IDS_FLAGS_HIDE_LAUNCHER_ALIGNMENT_MENU_NAME, |
| 933 | IDS_FLAGS_HIDE_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION, |
[email protected] | 35a4ced | 2013-02-06 23:24:42 | [diff] [blame] | 934 | kOsAll, |
[email protected] | fac380e0 | 2013-03-08 20:06:30 | [diff] [blame] | 935 | SINGLE_VALUE_TYPE(switches::kHideLauncherAlignmentMenu) |
[email protected] | 35a4ced | 2013-02-06 23:24:42 | [diff] [blame] | 936 | }, |
| 937 | { |
[email protected] | 7307474 | 2012-05-17 01:44:41 | [diff] [blame] | 938 | "show-touch-hud", |
| 939 | IDS_FLAGS_SHOW_TOUCH_HUD_NAME, |
| 940 | IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION, |
| 941 | kOsAll, |
| 942 | SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud) |
| 943 | }, |
| 944 | { |
[email protected] | 9f0940b6 | 2012-05-23 22:56:35 | [diff] [blame] | 945 | "enable-pinch", |
| 946 | IDS_FLAGS_ENABLE_PINCH_SCALE_NAME, |
| 947 | IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION, |
[email protected] | 16ad47f8 | 2012-12-05 21:06:06 | [diff] [blame] | 948 | kOsLinux | kOsWin | kOsCrOS, |
[email protected] | 9f0940b6 | 2012-05-23 22:56:35 | [diff] [blame] | 949 | SINGLE_VALUE_TYPE(switches::kEnablePinch), |
| 950 | }, |
[email protected] | a837931 | 2012-06-15 00:20:43 | [diff] [blame] | 951 | { |
| 952 | "app-list-show-apps-only", |
| 953 | IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME, |
| 954 | IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION, |
| 955 | kOsAll, |
[email protected] | 0bc6c27 | 2012-07-17 03:32:03 | [diff] [blame] | 956 | SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly), |
[email protected] | a837931 | 2012-06-15 00:20:43 | [diff] [blame] | 957 | }, |
[email protected] | 7307474 | 2012-05-17 01:44:41 | [diff] [blame] | 958 | #endif // defined(USE_ASH) |
[email protected] | ed7b67f3 | 2012-05-28 10:12:28 | [diff] [blame] | 959 | #if defined(OS_CHROMEOS) |
| 960 | { |
[email protected] | 8b04a165 | 2012-08-04 02:59:49 | [diff] [blame] | 961 | "disable-boot-animation", |
| 962 | IDS_FLAGS_DISABLE_BOOT_ANIMATION, |
| 963 | IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION, |
| 964 | kOsCrOS, |
| 965 | SINGLE_VALUE_TYPE(switches::kDisableBootAnimation), |
| 966 | }, |
[email protected] | 9505857 | 2012-08-20 14:57:29 | [diff] [blame] | 967 | { |
[email protected] | b455719 | 2012-09-19 11:29:58 | [diff] [blame] | 968 | "disable-boot-animation2", |
| 969 | IDS_FLAGS_DISABLE_BOOT_ANIMATION2, |
| 970 | IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION, |
| 971 | kOsCrOS, |
| 972 | SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2), |
| 973 | }, |
| 974 | { |
[email protected] | ea2f334 | 2012-09-21 21:13:36 | [diff] [blame] | 975 | "boot-animation-fucntion", |
| 976 | IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION, |
| 977 | IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION, |
| 978 | kOsCrOS, |
| 979 | MULTI_VALUE_TYPE(kAshBootAnimationFunction), |
| 980 | }, |
[email protected] | 839667d6 | 2012-10-23 19:38:57 | [diff] [blame] | 981 | { |
[email protected] | d96aef2 | 2012-10-30 11:47:02 | [diff] [blame] | 982 | "captive-portal-detector", |
| 983 | IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME, |
| 984 | IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION, |
| 985 | kOsCrOS, |
| 986 | MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices), |
| 987 | }, |
| 988 | { |
[email protected] | c11aa8f1 | 2012-12-18 18:43:14 | [diff] [blame] | 989 | "disable-new-lock-animations", |
[email protected] | 839667d6 | 2012-10-23 19:38:57 | [diff] [blame] | 990 | IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS, |
| 991 | IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION, |
| 992 | kOsCrOS, |
[email protected] | c11aa8f1 | 2012-12-18 18:43:14 | [diff] [blame] | 993 | SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations), |
[email protected] | 839667d6 | 2012-10-23 19:38:57 | [diff] [blame] | 994 | }, |
[email protected] | f028095 | 2012-11-06 20:30:50 | [diff] [blame] | 995 | { |
[email protected] | 0fb5c485 | 2012-11-08 20:33:23 | [diff] [blame] | 996 | "file-manager-packaged", |
| 997 | IDS_FLAGS_FILE_MANAGER_PACKAGED_NAME, |
| 998 | IDS_FLAGS_FILE_MANAGER_PACKAGED_DESCRIPTION, |
| 999 | kOsCrOS, |
| 1000 | SINGLE_VALUE_TYPE(switches::kFileManagerPackaged), |
| 1001 | }, |
[email protected] | 3e035e8 | 2012-11-27 20:54:32 | [diff] [blame] | 1002 | { |
[email protected] | 8039e06c | 2013-01-17 23:34:50 | [diff] [blame] | 1003 | "disable-launcher-per-display", |
| 1004 | IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_NAME, |
| 1005 | IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION, |
[email protected] | 62018dc | 2012-12-13 00:37:35 | [diff] [blame] | 1006 | kOsCrOS, |
[email protected] | 8039e06c | 2013-01-17 23:34:50 | [diff] [blame] | 1007 | SINGLE_VALUE_TYPE(ash::switches::kAshDisableLauncherPerDisplay), |
[email protected] | 62018dc | 2012-12-13 00:37:35 | [diff] [blame] | 1008 | }, |
[email protected] | 06b146d | 2013-02-07 06:06:47 | [diff] [blame] | 1009 | { |
| 1010 | "enable-app-mode", |
| 1011 | IDS_FLAGS_ENABLE_KIOSK_APPS_NAME, |
| 1012 | IDS_FLAGS_ENABLE_KIOSK_APPS_DESCRIPTION, |
| 1013 | kOsCrOS, |
| 1014 | SINGLE_VALUE_TYPE(switches::kEnableAppMode), |
| 1015 | }, |
[email protected] | 6ad015c | 2013-03-06 00:49:51 | [diff] [blame] | 1016 | { |
| 1017 | "force-fullscreen-app", |
| 1018 | IDS_FLAGS_FORCE_FULLSCREEN_APP_NAME, |
| 1019 | IDS_FLAGS_FORCE_FULLSCREEN_APP_DESCRIPTION, |
| 1020 | kOsCrOS, |
| 1021 | SINGLE_VALUE_TYPE(switches::kForceFullscreenApp), |
| 1022 | }, |
[email protected] | 62018dc | 2012-12-13 00:37:35 | [diff] [blame] | 1023 | #endif // defined(OS_CHROMEOS) |
[email protected] | fc7a93c | 2012-06-08 20:25:39 | [diff] [blame] | 1024 | { |
[email protected] | 6247aba | 2013-03-04 22:57:18 | [diff] [blame] | 1025 | "views-textfield", |
| 1026 | IDS_FLAGS_VIEWS_TEXTFIELD_NAME, |
| 1027 | IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION, |
[email protected] | fc7a93c | 2012-06-08 20:25:39 | [diff] [blame] | 1028 | kOsWin, |
[email protected] | 6247aba | 2013-03-04 22:57:18 | [diff] [blame] | 1029 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableViewsTextfield, |
| 1030 | switches::kDisableViewsTextfield), |
[email protected] | fc7a93c | 2012-06-08 20:25:39 | [diff] [blame] | 1031 | }, |
[email protected] | bd0cd3bb | 2012-06-14 03:03:38 | [diff] [blame] | 1032 | { |
[email protected] | 2d481774 | 2012-12-17 20:16:18 | [diff] [blame] | 1033 | "enable-new-dialog-style", |
| 1034 | IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME, |
| 1035 | IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION, |
[email protected] | fcb88de | 2012-07-12 22:25:32 | [diff] [blame] | 1036 | kOsWin | kOsCrOS, |
[email protected] | 2d481774 | 2012-12-17 20:16:18 | [diff] [blame] | 1037 | SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle), |
[email protected] | fcb88de | 2012-07-12 22:25:32 | [diff] [blame] | 1038 | }, |
[email protected] | 7db8893a | 2012-07-26 00:49:40 | [diff] [blame] | 1039 | { "disable-accelerated-video-decode", |
| 1040 | IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME, |
| 1041 | IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 1042 | kOsDesktop, |
[email protected] | 7db8893a | 2012-07-26 00:49:40 | [diff] [blame] | 1043 | SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode), |
[email protected] | 66dcb049 | 2012-06-18 22:32:15 | [diff] [blame] | 1044 | }, |
[email protected] | 66ae9fc | 2012-06-19 21:33:52 | [diff] [blame] | 1045 | #if defined(USE_ASH) |
| 1046 | { |
| 1047 | "ash-debug-shortcuts", |
| 1048 | IDS_FLAGS_DEBUG_SHORTCUTS_NAME, |
| 1049 | IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION, |
| 1050 | kOsAll, |
| 1051 | SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts), |
| 1052 | }, |
| 1053 | #endif |
[email protected] | 37fee094 | 2012-08-07 21:07:45 | [diff] [blame] | 1054 | { |
[email protected] | ad3f6d2 | 2012-08-29 02:34:19 | [diff] [blame] | 1055 | "enable-contacts", |
| 1056 | IDS_FLAGS_ENABLE_CONTACTS_NAME, |
| 1057 | IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION, |
| 1058 | kOsCrOS, |
| 1059 | SINGLE_VALUE_TYPE(switches::kEnableContacts) |
| 1060 | }, |
[email protected] | 1d9bb9cd | 2012-08-28 22:02:50 | [diff] [blame] | 1061 | #if defined(USE_ASH) |
| 1062 | { "ash-enable-advanced-gestures", |
| 1063 | IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME, |
| 1064 | IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION, |
| 1065 | kOsCrOS, |
| 1066 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures), |
| 1067 | }, |
[email protected] | cfa24e6 | 2013-02-13 21:19:11 | [diff] [blame] | 1068 | { "ash-disable-tab-scrubbing", |
| 1069 | IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME, |
| 1070 | IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION, |
[email protected] | 51075f8c | 2012-11-13 01:48:16 | [diff] [blame] | 1071 | kOsCrOS, |
[email protected] | cfa24e6 | 2013-02-13 21:19:11 | [diff] [blame] | 1072 | SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing), |
[email protected] | 51075f8c | 2012-11-13 01:48:16 | [diff] [blame] | 1073 | }, |
[email protected] | 83eef80 | 2012-12-02 07:43:52 | [diff] [blame] | 1074 | { "ash-enable-workspace-scrubbing", |
| 1075 | IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME, |
| 1076 | IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION, |
| 1077 | kOsCrOS, |
| 1078 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing), |
| 1079 | }, |
[email protected] | 8c426dc | 2013-03-06 01:30:12 | [diff] [blame] | 1080 | { "ash-disable-immersive-mode", |
| 1081 | IDS_FLAGS_ASH_DISABLE_IMMERSIVE_MODE_NAME, |
| 1082 | IDS_FLAGS_ASH_DISABLE_IMMERSIVE_MODE_DESCRIPTION, |
[email protected] | c043df27 | 2012-11-21 00:43:24 | [diff] [blame] | 1083 | kOsCrOS, |
[email protected] | 8c426dc | 2013-03-06 01:30:12 | [diff] [blame] | 1084 | SINGLE_VALUE_TYPE(ash::switches::kAshDisableImmersiveMode), |
[email protected] | c043df27 | 2012-11-21 00:43:24 | [diff] [blame] | 1085 | }, |
[email protected] | 316708a | 2012-11-05 22:57:02 | [diff] [blame] | 1086 | #if defined(OS_LINUX) |
| 1087 | { "ash-enable-memory-monitor", |
| 1088 | IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME, |
| 1089 | IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION, |
| 1090 | kOsCrOS, |
| 1091 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor), |
| 1092 | }, |
| 1093 | #endif |
[email protected] | 1d9bb9cd | 2012-08-28 22:02:50 | [diff] [blame] | 1094 | #endif |
[email protected] | 9b7ab88 | 2012-09-10 23:46:36 | [diff] [blame] | 1095 | #if defined(OS_CHROMEOS) |
[email protected] | 9475ee6f | 2013-03-08 18:20:09 | [diff] [blame] | 1096 | { "ash-disable-new-network-status-area", |
| 1097 | IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_NAME, |
| 1098 | IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_DESCRIPTION, |
[email protected] | badba1ad | 2012-11-16 17:21:46 | [diff] [blame] | 1099 | kOsCrOS, |
[email protected] | 9475ee6f | 2013-03-08 18:20:09 | [diff] [blame] | 1100 | SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewNetworkStatusArea), |
[email protected] | badba1ad | 2012-11-16 17:21:46 | [diff] [blame] | 1101 | }, |
[email protected] | 9b7ab88 | 2012-09-10 23:46:36 | [diff] [blame] | 1102 | { |
[email protected] | 205f0789 | 2012-10-16 20:26:22 | [diff] [blame] | 1103 | "enable-carrier-switching", |
| 1104 | IDS_FLAGS_ENABLE_CARRIER_SWITCHING, |
| 1105 | IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION, |
| 1106 | kOsCrOS, |
| 1107 | SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching) |
| 1108 | }, |
| 1109 | { |
[email protected] | 9b7ab88 | 2012-09-10 23:46:36 | [diff] [blame] | 1110 | "enable-request-tablet-site", |
| 1111 | IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME, |
| 1112 | IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION, |
| 1113 | kOsCrOS, |
| 1114 | SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite) |
| 1115 | }, |
| 1116 | #endif |
[email protected] | dab49c0b | 2012-10-04 05:55:35 | [diff] [blame] | 1117 | { |
| 1118 | "debug-packed-apps", |
| 1119 | IDS_FLAGS_DEBUG_PACKED_APP_NAME, |
| 1120 | IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 1121 | kOsDesktop, |
[email protected] | dab49c0b | 2012-10-04 05:55:35 | [diff] [blame] | 1122 | SINGLE_VALUE_TYPE(switches::kDebugPackedApps) |
| 1123 | }, |
[email protected] | d1459ed | 2012-10-10 01:29:33 | [diff] [blame] | 1124 | { |
| 1125 | "enable-password-generation", |
| 1126 | IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME, |
| 1127 | IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 1128 | kOsDesktop, |
[email protected] | d1459ed | 2012-10-10 01:29:33 | [diff] [blame] | 1129 | SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration) |
| 1130 | }, |
[email protected] | 26d045f | 2012-10-18 21:18:43 | [diff] [blame] | 1131 | { |
| 1132 | "crash-on-gpu-hang", |
| 1133 | IDS_FLAGS_CRASH_ON_GPU_HANG_NAME, |
| 1134 | IDS_FLAGS_CRASH_ON_GPU_HANG_DESCRIPTION, |
| 1135 | kOsAll, |
| 1136 | SINGLE_VALUE_TYPE(switches::kCrashOnGpuHang) |
| 1137 | }, |
[email protected] | 075543d | 2012-10-24 01:29:14 | [diff] [blame] | 1138 | { |
[email protected] | 76f7d488 | 2012-10-26 21:09:22 | [diff] [blame] | 1139 | "enable-deferred-image-decoding", |
| 1140 | IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME, |
| 1141 | IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION, |
[email protected] | 76f7d488 | 2012-10-26 21:09:22 | [diff] [blame] | 1142 | kOsMac | kOsLinux | kOsCrOS, |
[email protected] | 76f7d488 | 2012-10-26 21:09:22 | [diff] [blame] | 1143 | SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding) |
| 1144 | }, |
| 1145 | { |
[email protected] | 075543d | 2012-10-24 01:29:14 | [diff] [blame] | 1146 | "performance-monitor-gathering", |
| 1147 | IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME, |
| 1148 | IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION, |
| 1149 | kOsAll, |
| 1150 | SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering) |
| 1151 | }, |
[email protected] | 783d5bb | 2012-10-24 03:47:14 | [diff] [blame] | 1152 | { |
[email protected] | b58d5a0 | 2013-03-06 04:33:53 | [diff] [blame] | 1153 | "enable-native-autofill-ui", |
| 1154 | IDS_FLAGS_ENABLE_NATIVE_AUTOFILL_UI_NAME, |
| 1155 | IDS_FLAGS_ENABLE_NATIVE_AUTOFILL_UI_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 1156 | kOsDesktop, |
[email protected] | b58d5a0 | 2013-03-06 04:33:53 | [diff] [blame] | 1157 | SINGLE_VALUE_TYPE(switches::kEnableNativeAutofillUi) |
[email protected] | 0572fb2e | 2012-11-03 00:38:59 | [diff] [blame] | 1158 | }, |
| 1159 | { |
[email protected] | 99002fd | 2012-11-06 04:35:52 | [diff] [blame] | 1160 | "show-app-list-shortcut", |
| 1161 | IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME, |
| 1162 | IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION, |
| 1163 | kOsWin, |
[email protected] | 7d1d209 | 2013-03-04 04:12:43 | [diff] [blame] | 1164 | SINGLE_VALUE_TYPE(apps::switches::kShowAppListShortcut) |
[email protected] | 99002fd | 2012-11-06 04:35:52 | [diff] [blame] | 1165 | }, |
[email protected] | a7259fb | 2012-11-08 06:22:23 | [diff] [blame] | 1166 | { |
| 1167 | "enable-experimental-form-filling", |
| 1168 | IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME, |
| 1169 | IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION, |
| 1170 | kOsWin | kOsCrOS, |
| 1171 | SINGLE_VALUE_TYPE(switches::kEnableExperimentalFormFilling) |
| 1172 | }, |
[email protected] | 6e6efe4 | 2013-01-30 00:04:50 | [diff] [blame] | 1173 | { |
| 1174 | "enable-interactive-autocomplete", |
| 1175 | IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME, |
| 1176 | IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION, |
[email protected] | 57e67ac | 2013-02-22 03:37:22 | [diff] [blame] | 1177 | kOsWin | kOsCrOS | kOsAndroid, |
[email protected] | 6e6efe4 | 2013-01-30 00:04:50 | [diff] [blame] | 1178 | SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete) |
| 1179 | }, |
[email protected] | e42b1f8 | 2012-11-16 21:18:46 | [diff] [blame] | 1180 | #if defined(USE_AURA) |
| 1181 | { |
[email protected] | b75ba13 | 2013-02-26 19:38:31 | [diff] [blame] | 1182 | "disable-overscroll-history-navigation", |
| 1183 | IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_NAME, |
| 1184 | IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION, |
[email protected] | e42b1f8 | 2012-11-16 21:18:46 | [diff] [blame] | 1185 | kOsAll, |
[email protected] | b75ba13 | 2013-02-26 19:38:31 | [diff] [blame] | 1186 | SINGLE_VALUE_TYPE(switches::kDisableOverscrollHistoryNavigation) |
[email protected] | e42b1f8 | 2012-11-16 21:18:46 | [diff] [blame] | 1187 | }, |
| 1188 | #endif |
[email protected] | edbea62 | 2012-11-28 20:39:38 | [diff] [blame] | 1189 | { |
| 1190 | "enable-touch-drag-drop", |
| 1191 | IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME, |
| 1192 | IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION, |
| 1193 | kOsWin | kOsCrOS, |
| 1194 | SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop) |
| 1195 | }, |
[email protected] | 0e2f43b6 | 2013-02-21 00:47:15 | [diff] [blame] | 1196 | { |
| 1197 | "enable-touch-editing", |
| 1198 | IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME, |
| 1199 | IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION, |
| 1200 | kOsCrOS, |
| 1201 | SINGLE_VALUE_TYPE(switches::kEnableTouchEditing) |
| 1202 | }, |
[email protected] | f1c3924 | 2013-01-29 16:13:01 | [diff] [blame] | 1203 | #if defined(ENABLE_MESSAGE_CENTER) |
[email protected] | 92e12dd9 | 2012-12-11 03:33:20 | [diff] [blame] | 1204 | { |
| 1205 | "enable-rich-notifications", |
| 1206 | IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME, |
| 1207 | IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION, |
| 1208 | kOsWin | kOsCrOS, |
[email protected] | f1c3924 | 2013-01-29 16:13:01 | [diff] [blame] | 1209 | SINGLE_VALUE_TYPE(message_center::switches::kEnableRichNotifications) |
[email protected] | 92e12dd9 | 2012-12-11 03:33:20 | [diff] [blame] | 1210 | }, |
[email protected] | f1c3924 | 2013-01-29 16:13:01 | [diff] [blame] | 1211 | #endif |
[email protected] | 4d51c68 | 2012-12-11 11:34:55 | [diff] [blame] | 1212 | { |
| 1213 | "full-history-sync", |
| 1214 | IDS_FLAGS_FULL_HISTORY_SYNC_NAME, |
| 1215 | IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION, |
| 1216 | kOsAll, |
| 1217 | SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync) |
| 1218 | }, |
[email protected] | 628a69a9 | 2012-12-23 04:09:34 | [diff] [blame] | 1219 | { |
[email protected] | fd03014 | 2013-02-08 02:04:38 | [diff] [blame] | 1220 | "enable-usermedia-screen-capture", |
| 1221 | IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME, |
| 1222 | IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION, |
| 1223 | kOsDesktop, |
| 1224 | SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing) |
| 1225 | }, |
[email protected] | 5b93e16 | 2013-02-19 06:33:09 | [diff] [blame] | 1226 | { |
| 1227 | "enable-apps-devtool-app", |
| 1228 | IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME, |
| 1229 | IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION, |
| 1230 | kOsDesktop, |
| 1231 | SINGLE_VALUE_TYPE(switches::kAppsDevtool) |
| 1232 | }, |
[email protected] | 9323fdd1 | 2013-02-23 00:31:36 | [diff] [blame] | 1233 | { |
| 1234 | "impl-side-painting", |
| 1235 | IDS_FLAGS_IMPL_SIDE_PAINTING_NAME, |
| 1236 | IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION, |
| 1237 | kOsAndroid, |
| 1238 | MULTI_VALUE_TYPE(kImplSidePaintingChoices) |
| 1239 | }, |
[email protected] | 2f2f72b | 2013-03-08 22:37:31 | [diff] [blame^] | 1240 | // TODO(sky): ifdef needed until focus sorted out in DesktopNativeWidgetAura. |
| 1241 | #if !defined(USE_AURA) |
[email protected] | 484deaa | 2013-03-01 03:10:37 | [diff] [blame] | 1242 | { |
| 1243 | "track-active-visit-time", |
| 1244 | IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME, |
| 1245 | IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION, |
| 1246 | kOsWin, |
| 1247 | SINGLE_VALUE_TYPE(switches::kTrackActiveVisitTime) |
| 1248 | }, |
[email protected] | 2f2f72b | 2013-03-08 22:37:31 | [diff] [blame^] | 1249 | #endif |
[email protected] | 8cc71d4 | 2013-03-02 17:26:08 | [diff] [blame] | 1250 | #if defined(OS_ANDROID) |
| 1251 | { |
| 1252 | "disable-gesture-requirement-for-media-playback", |
| 1253 | IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME, |
| 1254 | IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION, |
| 1255 | kOsAndroid, |
| 1256 | SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback) |
| 1257 | }, |
| 1258 | #endif |
[email protected] | a0e4b07 | 2011-08-17 01:47:07 | [diff] [blame] | 1259 | }; |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1260 | |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1261 | const Experiment* experiments = kExperiments; |
| 1262 | size_t num_experiments = arraysize(kExperiments); |
| 1263 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1264 | // Stores and encapsulates the little state that about:flags has. |
| 1265 | class FlagsState { |
| 1266 | public: |
| 1267 | FlagsState() : needs_restart_(false) {} |
| 1268 | void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line); |
| 1269 | bool IsRestartNeededToCommitChanges(); |
| 1270 | void SetExperimentEnabled( |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1271 | PrefService* prefs, const std::string& internal_name, bool enable); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1272 | void RemoveFlagsSwitches( |
| 1273 | std::map<std::string, CommandLine::StringType>* switch_list); |
[email protected] | cb93bf5 | 2013-02-20 01:20:00 | [diff] [blame] | 1274 | void ResetAllFlags(PrefService* prefs); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1275 | void reset(); |
| 1276 | |
| 1277 | // Returns the singleton instance of this class |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1278 | static FlagsState* GetInstance() { |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1279 | return Singleton<FlagsState>::get(); |
| 1280 | } |
| 1281 | |
| 1282 | private: |
| 1283 | bool needs_restart_; |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1284 | std::map<std::string, std::string> flags_switches_; |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1285 | |
| 1286 | DISALLOW_COPY_AND_ASSIGN(FlagsState); |
| 1287 | }; |
| 1288 | |
[email protected] | 4967396 | 2013-03-08 01:18:02 | [diff] [blame] | 1289 | #if defined(OS_CHROMEOS) |
| 1290 | // Extracts the list of enabled lab experiments from device settings and stores |
| 1291 | // them in a set. |
| 1292 | void GetEnabledFlagsFromDeviceSettings(std::set<std::string>* result) { |
| 1293 | const ListValue* enabled_experiments; |
| 1294 | if (!chromeos::CrosSettings::Get()->GetList(chromeos::kStartUpFlags, |
| 1295 | &enabled_experiments)) { |
| 1296 | return; |
| 1297 | } |
| 1298 | |
| 1299 | for (ListValue::const_iterator it = enabled_experiments->begin(); |
| 1300 | it != enabled_experiments->end(); |
| 1301 | ++it) { |
| 1302 | std::string experiment_name; |
| 1303 | if (!(*it)->GetAsString(&experiment_name)) { |
| 1304 | LOG(WARNING) << "Invalid entry in " << chromeos::kStartUpFlags; |
| 1305 | continue; |
| 1306 | } |
| 1307 | result->insert(experiment_name); |
| 1308 | } |
| 1309 | } |
| 1310 | |
| 1311 | // Takes a set of enabled lab experiments and saves it into the device settings |
| 1312 | // storage on ChromeOS. |
| 1313 | void SetEnabledFlagsToDeviceSettings( |
| 1314 | const std::set<std::string>& enabled_experiments) { |
| 1315 | scoped_ptr<base::ListValue> experiments_list(new base::ListValue()); |
| 1316 | |
| 1317 | for (std::set<std::string>::const_iterator it = enabled_experiments.begin(); |
| 1318 | it != enabled_experiments.end(); |
| 1319 | ++it) { |
| 1320 | experiments_list->Append(new StringValue(*it)); |
| 1321 | } |
| 1322 | chromeos::CrosSettings::Get()->Set(chromeos::kStartUpFlags, |
| 1323 | *experiments_list); |
| 1324 | } |
| 1325 | #endif |
| 1326 | |
[email protected] | c7b7800a | 2010-10-07 18:51:35 | [diff] [blame] | 1327 | // Extracts the list of enabled lab experiments from preferences and stores them |
[email protected] | 4967396 | 2013-03-08 01:18:02 | [diff] [blame] | 1328 | // in a set. On ChromeOS |prefs| can be NULL when reading machine level flags. |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1329 | void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) { |
[email protected] | 4967396 | 2013-03-08 01:18:02 | [diff] [blame] | 1330 | #if defined(OS_CHROMEOS) |
| 1331 | // On ChromeOS flags are stored in the device settings blob. |
| 1332 | if (!prefs) { |
| 1333 | GetEnabledFlagsFromDeviceSettings(result); |
| 1334 | return; |
| 1335 | } |
| 1336 | #else |
| 1337 | // Never allow |prefs| to be NULL on other platforms. |
| 1338 | CHECK(prefs); |
| 1339 | #endif |
| 1340 | |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1341 | const ListValue* enabled_experiments = prefs->GetList( |
| 1342 | prefs::kEnabledLabsExperiments); |
| 1343 | if (!enabled_experiments) |
| 1344 | return; |
| 1345 | |
| 1346 | for (ListValue::const_iterator it = enabled_experiments->begin(); |
| 1347 | it != enabled_experiments->end(); |
| 1348 | ++it) { |
| 1349 | std::string experiment_name; |
| 1350 | if (!(*it)->GetAsString(&experiment_name)) { |
| 1351 | LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments; |
| 1352 | continue; |
| 1353 | } |
| 1354 | result->insert(experiment_name); |
| 1355 | } |
| 1356 | } |
| 1357 | |
[email protected] | 4967396 | 2013-03-08 01:18:02 | [diff] [blame] | 1358 | // Takes a set of enabled lab experiments. On ChromeOS |prefs| can be NULL when |
| 1359 | // setting machine level flags. |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1360 | void SetEnabledFlags( |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1361 | PrefService* prefs, const std::set<std::string>& enabled_experiments) { |
[email protected] | 4967396 | 2013-03-08 01:18:02 | [diff] [blame] | 1362 | #if defined(OS_CHROMEOS) |
| 1363 | // On ChromeOS flags are stored in the device settings blob. |
| 1364 | if (!prefs) { |
| 1365 | SetEnabledFlagsToDeviceSettings(enabled_experiments); |
| 1366 | return; |
| 1367 | } |
| 1368 | #else |
| 1369 | // Never allow |prefs| to be NULL on other platforms. |
| 1370 | CHECK(prefs); |
| 1371 | #endif |
| 1372 | |
[email protected] | 1bc7842 | 2011-03-31 08:41:38 | [diff] [blame] | 1373 | ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments); |
| 1374 | ListValue* experiments_list = update.Get(); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1375 | |
| 1376 | experiments_list->Clear(); |
| 1377 | for (std::set<std::string>::const_iterator it = enabled_experiments.begin(); |
| 1378 | it != enabled_experiments.end(); |
| 1379 | ++it) { |
| 1380 | experiments_list->Append(new StringValue(*it)); |
| 1381 | } |
| 1382 | } |
| 1383 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1384 | // Adds the internal names for the specified experiment to |names|. |
| 1385 | void AddInternalName(const Experiment& e, std::set<std::string>* names) { |
| 1386 | if (e.type == Experiment::SINGLE_VALUE) { |
| 1387 | names->insert(e.internal_name); |
| 1388 | } else { |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1389 | DCHECK(e.type == Experiment::MULTI_VALUE || |
| 1390 | e.type == Experiment::ENABLE_DISABLE_VALUE); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1391 | for (int i = 0; i < e.num_choices; ++i) |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1392 | names->insert(e.NameForChoice(i)); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1393 | } |
| 1394 | } |
| 1395 | |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1396 | // Confirms that an experiment is valid, used in a DCHECK in |
| 1397 | // SanitizeList below. |
| 1398 | bool ValidateExperiment(const Experiment& e) { |
| 1399 | switch (e.type) { |
| 1400 | case Experiment::SINGLE_VALUE: |
| 1401 | DCHECK_EQ(0, e.num_choices); |
| 1402 | DCHECK(!e.choices); |
| 1403 | break; |
| 1404 | case Experiment::MULTI_VALUE: |
| 1405 | DCHECK_GT(e.num_choices, 0); |
| 1406 | DCHECK(e.choices); |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1407 | DCHECK(e.choices[0].command_line_switch); |
| 1408 | DCHECK_EQ('\0', e.choices[0].command_line_switch[0]); |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1409 | break; |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1410 | case Experiment::ENABLE_DISABLE_VALUE: |
| 1411 | DCHECK_EQ(3, e.num_choices); |
| 1412 | DCHECK(!e.choices); |
| 1413 | DCHECK(e.command_line_switch); |
| 1414 | DCHECK(e.command_line_value); |
| 1415 | DCHECK(e.disable_command_line_switch); |
| 1416 | DCHECK(e.disable_command_line_value); |
| 1417 | break; |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1418 | default: |
| 1419 | NOTREACHED(); |
| 1420 | } |
| 1421 | return true; |
| 1422 | } |
| 1423 | |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1424 | // Removes all experiments from prefs::kEnabledLabsExperiments that are |
| 1425 | // unknown, to prevent this list to become very long as experiments are added |
| 1426 | // and removed. |
| 1427 | void SanitizeList(PrefService* prefs) { |
| 1428 | std::set<std::string> known_experiments; |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1429 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1430 | DCHECK(ValidateExperiment(experiments[i])); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1431 | AddInternalName(experiments[i], &known_experiments); |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1432 | } |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1433 | |
| 1434 | std::set<std::string> enabled_experiments; |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1435 | GetEnabledFlags(prefs, &enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1436 | |
| 1437 | std::set<std::string> new_enabled_experiments; |
| 1438 | std::set_intersection( |
| 1439 | known_experiments.begin(), known_experiments.end(), |
| 1440 | enabled_experiments.begin(), enabled_experiments.end(), |
| 1441 | std::inserter(new_enabled_experiments, new_enabled_experiments.begin())); |
| 1442 | |
[email protected] | 4c8853f | 2012-07-23 01:29:16 | [diff] [blame] | 1443 | if (new_enabled_experiments != enabled_experiments) |
| 1444 | SetEnabledFlags(prefs, new_enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1445 | } |
| 1446 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1447 | void GetSanitizedEnabledFlags( |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1448 | PrefService* prefs, std::set<std::string>* result) { |
| 1449 | SanitizeList(prefs); |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1450 | GetEnabledFlags(prefs, result); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1451 | } |
| 1452 | |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1453 | // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't |
| 1454 | // enabled on the current platform. |
| 1455 | void GetSanitizedEnabledFlagsForCurrentPlatform( |
| 1456 | PrefService* prefs, std::set<std::string>* result) { |
| 1457 | GetSanitizedEnabledFlags(prefs, result); |
| 1458 | |
| 1459 | // Filter out any experiments that aren't enabled on the current platform. We |
| 1460 | // don't remove these from prefs else syncing to a platform with a different |
| 1461 | // set of experiments would be lossy. |
| 1462 | std::set<std::string> platform_experiments; |
| 1463 | int current_platform = GetCurrentPlatform(); |
| 1464 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1465 | if (experiments[i].supported_platforms & current_platform) |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1466 | AddInternalName(experiments[i], &platform_experiments); |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1467 | } |
| 1468 | |
| 1469 | std::set<std::string> new_enabled_experiments; |
| 1470 | std::set_intersection( |
| 1471 | platform_experiments.begin(), platform_experiments.end(), |
| 1472 | result->begin(), result->end(), |
| 1473 | std::inserter(new_enabled_experiments, new_enabled_experiments.begin())); |
| 1474 | |
| 1475 | result->swap(new_enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1476 | } |
| 1477 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1478 | // Returns the Value representing the choice data in the specified experiment. |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1479 | Value* CreateChoiceData(const Experiment& experiment, |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1480 | const std::set<std::string>& enabled_experiments) { |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1481 | DCHECK(experiment.type == Experiment::MULTI_VALUE || |
| 1482 | experiment.type == Experiment::ENABLE_DISABLE_VALUE); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1483 | ListValue* result = new ListValue; |
| 1484 | for (int i = 0; i < experiment.num_choices; ++i) { |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1485 | DictionaryValue* value = new DictionaryValue; |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1486 | const std::string name = experiment.NameForChoice(i); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1487 | value->SetString("internal_name", name); |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1488 | value->SetString("description", experiment.DescriptionForChoice(i)); |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1489 | value->SetBoolean("selected", enabled_experiments.count(name) > 0); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1490 | result->Append(value); |
| 1491 | } |
| 1492 | return result; |
| 1493 | } |
| 1494 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1495 | } // namespace |
| 1496 | |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1497 | std::string Experiment::NameForChoice(int index) const { |
| 1498 | DCHECK(type == Experiment::MULTI_VALUE || |
| 1499 | type == Experiment::ENABLE_DISABLE_VALUE); |
| 1500 | DCHECK_LT(index, num_choices); |
| 1501 | return std::string(internal_name) + testing::kMultiSeparator + |
| 1502 | base::IntToString(index); |
| 1503 | } |
| 1504 | |
| 1505 | string16 Experiment::DescriptionForChoice(int index) const { |
| 1506 | DCHECK(type == Experiment::MULTI_VALUE || |
| 1507 | type == Experiment::ENABLE_DISABLE_VALUE); |
| 1508 | DCHECK_LT(index, num_choices); |
| 1509 | int description_id; |
| 1510 | if (type == Experiment::ENABLE_DISABLE_VALUE) { |
| 1511 | const int kEnableDisableDescriptionIds[] = { |
| 1512 | IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, |
| 1513 | IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 1514 | IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 1515 | }; |
| 1516 | description_id = kEnableDisableDescriptionIds[index]; |
| 1517 | } else { |
| 1518 | description_id = choices[index].description_id; |
| 1519 | } |
| 1520 | return l10n_util::GetStringUTF16(description_id); |
| 1521 | } |
| 1522 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1523 | void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) { |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1524 | FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1525 | } |
| 1526 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1527 | ListValue* GetFlagsExperimentsData(PrefService* prefs) { |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1528 | std::set<std::string> enabled_experiments; |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1529 | GetSanitizedEnabledFlags(prefs, &enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1530 | |
| 1531 | int current_platform = GetCurrentPlatform(); |
| 1532 | |
| 1533 | ListValue* experiments_data = new ListValue(); |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1534 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1535 | const Experiment& experiment = experiments[i]; |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1536 | |
| 1537 | DictionaryValue* data = new DictionaryValue(); |
| 1538 | data->SetString("internal_name", experiment.internal_name); |
| 1539 | data->SetString("name", |
| 1540 | l10n_util::GetStringUTF16(experiment.visible_name_id)); |
| 1541 | data->SetString("description", |
| 1542 | l10n_util::GetStringUTF16( |
| 1543 | experiment.visible_description_id)); |
[email protected] | cc3e205 | 2011-12-20 01:01:40 | [diff] [blame] | 1544 | bool supported = !!(experiment.supported_platforms & current_platform); |
| 1545 | data->SetBoolean("supported", supported); |
| 1546 | |
| 1547 | ListValue* supported_platforms = new ListValue(); |
| 1548 | AddOsStrings(experiment.supported_platforms, supported_platforms); |
| 1549 | data->Set("supported_platforms", supported_platforms); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1550 | |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1551 | switch (experiment.type) { |
| 1552 | case Experiment::SINGLE_VALUE: |
| 1553 | data->SetBoolean( |
| 1554 | "enabled", |
| 1555 | enabled_experiments.count(experiment.internal_name) > 0); |
| 1556 | break; |
| 1557 | case Experiment::MULTI_VALUE: |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1558 | case Experiment::ENABLE_DISABLE_VALUE: |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1559 | data->Set("choices", CreateChoiceData(experiment, enabled_experiments)); |
| 1560 | break; |
| 1561 | default: |
| 1562 | NOTREACHED(); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1563 | } |
| 1564 | |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1565 | experiments_data->Append(data); |
| 1566 | } |
| 1567 | return experiments_data; |
| 1568 | } |
| 1569 | |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1570 | bool IsRestartNeededToCommitChanges() { |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1571 | return FlagsState::GetInstance()->IsRestartNeededToCommitChanges(); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1572 | } |
| 1573 | |
| 1574 | void SetExperimentEnabled( |
[email protected] | c7b7800a | 2010-10-07 18:51:35 | [diff] [blame] | 1575 | PrefService* prefs, const std::string& internal_name, bool enable) { |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1576 | FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1577 | } |
| 1578 | |
| 1579 | void RemoveFlagsSwitches( |
| 1580 | std::map<std::string, CommandLine::StringType>* switch_list) { |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1581 | FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1582 | } |
| 1583 | |
[email protected] | cb93bf5 | 2013-02-20 01:20:00 | [diff] [blame] | 1584 | void ResetAllFlags(PrefService* prefs) { |
| 1585 | FlagsState::GetInstance()->ResetAllFlags(prefs); |
| 1586 | } |
| 1587 | |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1588 | int GetCurrentPlatform() { |
| 1589 | #if defined(OS_MACOSX) |
| 1590 | return kOsMac; |
| 1591 | #elif defined(OS_WIN) |
| 1592 | return kOsWin; |
| 1593 | #elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check. |
| 1594 | return kOsCrOS; |
[email protected] | c92f4ed | 2011-10-21 19:50:21 | [diff] [blame] | 1595 | #elif defined(OS_LINUX) || defined(OS_OPENBSD) |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1596 | return kOsLinux; |
[email protected] | 9c7453d | 2012-01-21 00:45:40 | [diff] [blame] | 1597 | #elif defined(OS_ANDROID) |
| 1598 | return kOsAndroid; |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1599 | #else |
| 1600 | #error Unknown platform |
| 1601 | #endif |
| 1602 | } |
| 1603 | |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 1604 | void RecordUMAStatistics(const PrefService* prefs) { |
| 1605 | std::set<std::string> flags; |
| 1606 | GetEnabledFlags(prefs, &flags); |
| 1607 | for (std::set<std::string>::iterator it = flags.begin(); it != flags.end(); |
| 1608 | ++it) { |
| 1609 | std::string action("AboutFlags_"); |
| 1610 | action += *it; |
[email protected] | 7f6f44c | 2011-12-14 13:23:38 | [diff] [blame] | 1611 | content::RecordComputedAction(action); |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 1612 | } |
| 1613 | // Since flag metrics are recorded every startup, add a tick so that the |
| 1614 | // stats can be made meaningful. |
| 1615 | if (flags.size()) |
[email protected] | 7f6f44c | 2011-12-14 13:23:38 | [diff] [blame] | 1616 | content::RecordAction(UserMetricsAction("AboutFlags_StartupTick")); |
| 1617 | content::RecordAction(UserMetricsAction("StartupTick")); |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 1618 | } |
| 1619 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1620 | ////////////////////////////////////////////////////////////////////////////// |
| 1621 | // FlagsState implementation. |
| 1622 | |
| 1623 | namespace { |
| 1624 | |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1625 | typedef std::map<std::string, std::pair<std::string, std::string> > |
| 1626 | NameToSwitchAndValueMap; |
| 1627 | |
| 1628 | void SetFlagToSwitchMapping(const std::string& key, |
| 1629 | const std::string& switch_name, |
| 1630 | const std::string& switch_value, |
| 1631 | NameToSwitchAndValueMap* name_to_switch_map) { |
| 1632 | DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key)); |
| 1633 | (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value); |
| 1634 | } |
| 1635 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1636 | void FlagsState::ConvertFlagsToSwitches( |
| 1637 | PrefService* prefs, CommandLine* command_line) { |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1638 | if (command_line->HasSwitch(switches::kNoExperiments)) |
| 1639 | return; |
| 1640 | |
| 1641 | std::set<std::string> enabled_experiments; |
[email protected] | ba816424 | 2010-11-16 21:31:00 | [diff] [blame] | 1642 | |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1643 | GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1644 | |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1645 | NameToSwitchAndValueMap name_to_switch_map; |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1646 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1647 | const Experiment& e = experiments[i]; |
| 1648 | if (e.type == Experiment::SINGLE_VALUE) { |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1649 | SetFlagToSwitchMapping(e.internal_name, e.command_line_switch, |
| 1650 | e.command_line_value, &name_to_switch_map); |
| 1651 | } else if (e.type == Experiment::MULTI_VALUE) { |
| 1652 | for (int j = 0; j < e.num_choices; ++j) { |
| 1653 | SetFlagToSwitchMapping(e.NameForChoice(j), |
| 1654 | e.choices[j].command_line_switch, |
| 1655 | e.choices[j].command_line_value, |
| 1656 | &name_to_switch_map); |
| 1657 | } |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1658 | } else { |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1659 | DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE); |
| 1660 | SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(), |
| 1661 | &name_to_switch_map); |
| 1662 | SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch, |
| 1663 | e.command_line_value, &name_to_switch_map); |
| 1664 | SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch, |
| 1665 | e.disable_command_line_value, &name_to_switch_map); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1666 | } |
| 1667 | } |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1668 | |
| 1669 | command_line->AppendSwitch(switches::kFlagSwitchesBegin); |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1670 | flags_switches_.insert( |
| 1671 | std::pair<std::string, std::string>(switches::kFlagSwitchesBegin, |
| 1672 | std::string())); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1673 | for (std::set<std::string>::iterator it = enabled_experiments.begin(); |
| 1674 | it != enabled_experiments.end(); |
| 1675 | ++it) { |
| 1676 | const std::string& experiment_name = *it; |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1677 | NameToSwitchAndValueMap::const_iterator name_to_switch_it = |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1678 | name_to_switch_map.find(experiment_name); |
| 1679 | if (name_to_switch_it == name_to_switch_map.end()) { |
| 1680 | NOTREACHED(); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1681 | continue; |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1682 | } |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1683 | |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1684 | const std::pair<std::string, std::string>& |
| 1685 | switch_and_value_pair = name_to_switch_it->second; |
| 1686 | |
| 1687 | command_line->AppendSwitchASCII(switch_and_value_pair.first, |
| 1688 | switch_and_value_pair.second); |
| 1689 | flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second; |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1690 | } |
| 1691 | command_line->AppendSwitch(switches::kFlagSwitchesEnd); |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1692 | flags_switches_.insert( |
| 1693 | std::pair<std::string, std::string>(switches::kFlagSwitchesEnd, |
| 1694 | std::string())); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1695 | } |
| 1696 | |
| 1697 | bool FlagsState::IsRestartNeededToCommitChanges() { |
| 1698 | return needs_restart_; |
| 1699 | } |
| 1700 | |
| 1701 | void FlagsState::SetExperimentEnabled( |
| 1702 | PrefService* prefs, const std::string& internal_name, bool enable) { |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1703 | needs_restart_ = true; |
| 1704 | |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1705 | size_t at_index = internal_name.find(testing::kMultiSeparator); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1706 | if (at_index != std::string::npos) { |
| 1707 | DCHECK(enable); |
| 1708 | // We're being asked to enable a multi-choice experiment. Disable the |
| 1709 | // currently selected choice. |
| 1710 | DCHECK_NE(at_index, 0u); |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1711 | const std::string experiment_name = internal_name.substr(0, at_index); |
| 1712 | SetExperimentEnabled(prefs, experiment_name, false); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1713 | |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1714 | // And enable the new choice, if it is not the default first choice. |
| 1715 | if (internal_name != experiment_name + "@0") { |
| 1716 | std::set<std::string> enabled_experiments; |
| 1717 | GetSanitizedEnabledFlags(prefs, &enabled_experiments); |
| 1718 | enabled_experiments.insert(internal_name); |
| 1719 | SetEnabledFlags(prefs, enabled_experiments); |
| 1720 | } |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1721 | return; |
| 1722 | } |
| 1723 | |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1724 | std::set<std::string> enabled_experiments; |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1725 | GetSanitizedEnabledFlags(prefs, &enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1726 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1727 | const Experiment* e = NULL; |
| 1728 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1729 | if (experiments[i].internal_name == internal_name) { |
| 1730 | e = experiments + i; |
| 1731 | break; |
| 1732 | } |
| 1733 | } |
| 1734 | DCHECK(e); |
| 1735 | |
| 1736 | if (e->type == Experiment::SINGLE_VALUE) { |
[email protected] | 8a271368 | 2011-08-19 10:36:59 | [diff] [blame] | 1737 | if (enable) |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1738 | enabled_experiments.insert(internal_name); |
[email protected] | 8a271368 | 2011-08-19 10:36:59 | [diff] [blame] | 1739 | else |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1740 | enabled_experiments.erase(internal_name); |
| 1741 | } else { |
| 1742 | if (enable) { |
| 1743 | // Enable the first choice. |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1744 | enabled_experiments.insert(e->NameForChoice(0)); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1745 | } else { |
| 1746 | // Find the currently enabled choice and disable it. |
| 1747 | for (int i = 0; i < e->num_choices; ++i) { |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1748 | std::string choice_name = e->NameForChoice(i); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1749 | if (enabled_experiments.find(choice_name) != |
| 1750 | enabled_experiments.end()) { |
| 1751 | enabled_experiments.erase(choice_name); |
| 1752 | // Continue on just in case there's a bug and more than one |
| 1753 | // experiment for this choice was enabled. |
| 1754 | } |
| 1755 | } |
| 1756 | } |
| 1757 | } |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1758 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1759 | SetEnabledFlags(prefs, enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1760 | } |
| 1761 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1762 | void FlagsState::RemoveFlagsSwitches( |
| 1763 | std::map<std::string, CommandLine::StringType>* switch_list) { |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1764 | for (std::map<std::string, std::string>::const_iterator |
| 1765 | it = flags_switches_.begin(); it != flags_switches_.end(); ++it) { |
| 1766 | switch_list->erase(it->first); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1767 | } |
| 1768 | } |
| 1769 | |
[email protected] | cb93bf5 | 2013-02-20 01:20:00 | [diff] [blame] | 1770 | void FlagsState::ResetAllFlags(PrefService* prefs) { |
| 1771 | needs_restart_ = true; |
| 1772 | |
| 1773 | std::set<std::string> no_experiments; |
| 1774 | SetEnabledFlags(prefs, no_experiments); |
| 1775 | } |
| 1776 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1777 | void FlagsState::reset() { |
| 1778 | needs_restart_ = false; |
| 1779 | flags_switches_.clear(); |
| 1780 | } |
| 1781 | |
[email protected] | 38e4681 | 2011-05-09 20:49:22 | [diff] [blame] | 1782 | } // namespace |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1783 | |
| 1784 | namespace testing { |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1785 | |
| 1786 | // WARNING: '@' is also used in the html file. If you update this constant you |
| 1787 | // also need to update the html file. |
| 1788 | const char kMultiSeparator[] = "@"; |
| 1789 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1790 | void ClearState() { |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1791 | FlagsState::GetInstance()->reset(); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1792 | } |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1793 | |
| 1794 | void SetExperiments(const Experiment* e, size_t count) { |
| 1795 | if (!e) { |
| 1796 | experiments = kExperiments; |
| 1797 | num_experiments = arraysize(kExperiments); |
| 1798 | } else { |
| 1799 | experiments = e; |
| 1800 | num_experiments = count; |
| 1801 | } |
| 1802 | } |
| 1803 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1804 | const Experiment* GetExperiments(size_t* count) { |
| 1805 | *count = num_experiments; |
| 1806 | return experiments; |
| 1807 | } |
| 1808 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1809 | } // namespace testing |
| 1810 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1811 | } // namespace about_flags |