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