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