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