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