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