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