[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] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 17 | #include "chrome/browser/prefs/pref_service.h" |
[email protected] | 1bc7842 | 2011-03-31 08:41:38 | [diff] [blame] | 18 | #include "chrome/browser/prefs/scoped_user_pref_update.h" |
[email protected] | d208f4d8 | 2011-05-23 21:52:03 | [diff] [blame] | 19 | #include "chrome/common/chrome_content_client.h" |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 20 | #include "chrome/common/chrome_switches.h" |
| 21 | #include "chrome/common/pref_names.h" |
[email protected] | 7f6f44c | 2011-12-14 13:23:38 | [diff] [blame] | 22 | #include "content/public/browser/user_metrics.h" |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 23 | #include "grit/generated_resources.h" |
[email protected] | 0bc6c27 | 2012-07-17 03:32:03 | [diff] [blame] | 24 | #include "ui/app_list/app_list_switches.h" |
[email protected] | c051a1b | 2011-01-21 23:30:17 | [diff] [blame] | 25 | #include "ui/base/l10n/l10n_util.h" |
[email protected] | c9c73ad4 | 2012-04-18 03:35:59 | [diff] [blame] | 26 | #include "ui/base/ui_base_switches.h" |
[email protected] | c9e2cbbb | 2012-05-12 21:17:27 | [diff] [blame] | 27 | #include "ui/gl/gl_switches.h" |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 28 | |
[email protected] | dc04be7c | 2012-03-15 23:57:49 | [diff] [blame] | 29 | #if defined(USE_ASH) |
[email protected] | b65bdda | 2011-12-23 23:35:31 | [diff] [blame] | 30 | #include "ash/ash_switches.h" |
[email protected] | dc04be7c | 2012-03-15 23:57:49 | [diff] [blame] | 31 | #endif |
| 32 | |
| 33 | #if defined(USE_AURA) |
[email protected] | 308aaa3 | 2012-03-12 13:14:50 | [diff] [blame] | 34 | #include "ui/aura/aura_switches.h" |
[email protected] | 8cc10df | 2011-11-03 23:57:50 | [diff] [blame] | 35 | #endif |
| 36 | |
[email protected] | 7f6f44c | 2011-12-14 13:23:38 | [diff] [blame] | 37 | using content::UserMetricsAction; |
| 38 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 39 | namespace about_flags { |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 40 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 41 | // Macros to simplify specifying the type. |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 42 | #define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \ |
| 43 | Experiment::SINGLE_VALUE, command_line_switch, switch_value, NULL, 0 |
| 44 | #define SINGLE_VALUE_TYPE(command_line_switch) \ |
| 45 | SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "") |
| 46 | #define MULTI_VALUE_TYPE(choices) \ |
[email protected] | 0e6f56d | 2011-02-12 23:45:15 | [diff] [blame] | 47 | Experiment::MULTI_VALUE, "", "", choices, arraysize(choices) |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 48 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 49 | namespace { |
| 50 | |
[email protected] | 9c7453d | 2012-01-21 00:45:40 | [diff] [blame] | 51 | const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid; |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 52 | |
[email protected] | cc3e205 | 2011-12-20 01:01:40 | [diff] [blame] | 53 | // Adds a |StringValue| to |list| for each platform where |bitmask| indicates |
| 54 | // whether the experiment is available on that platform. |
| 55 | void AddOsStrings(unsigned bitmask, ListValue* list) { |
| 56 | struct { |
| 57 | unsigned bit; |
| 58 | const char* const name; |
| 59 | } kBitsToOs[] = { |
| 60 | {kOsMac, "Mac"}, |
| 61 | {kOsWin, "Windows"}, |
| 62 | {kOsLinux, "Linux"}, |
| 63 | {kOsCrOS, "Chrome OS"}, |
| 64 | }; |
| 65 | for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i) |
| 66 | if (bitmask & kBitsToOs[i].bit) |
| 67 | list->Append(new StringValue(kBitsToOs[i].name)); |
| 68 | } |
| 69 | |
[email protected] | ba816424 | 2010-11-16 21:31:00 | [diff] [blame] | 70 | // Names for former Chrome OS Labs experiments, shared with prefs migration |
| 71 | // code. |
| 72 | const char kMediaPlayerExperimentName[] = "media-player"; |
| 73 | const char kAdvancedFileSystemExperimentName[] = "advanced-file-system"; |
| 74 | const char kVerticalTabsExperimentName[] = "vertical-tabs"; |
| 75 | |
[email protected] | 6831780 | 2012-06-07 19:13:23 | [diff] [blame] | 76 | const Experiment::Choice kOmniboxHistoryQuickProviderNewScoringChoices[] = { |
| 77 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_AUTOMATIC, "", "" }, |
| 78 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_ENABLED, |
| 79 | switches::kOmniboxHistoryQuickProviderNewScoring, |
| 80 | switches::kOmniboxHistoryQuickProviderNewScoringEnabled }, |
| 81 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DISABLED, |
| 82 | switches::kOmniboxHistoryQuickProviderNewScoring, |
| 83 | switches::kOmniboxHistoryQuickProviderNewScoringDisabled } |
| 84 | }; |
| 85 | |
[email protected] | 128dc6c | 2012-06-22 20:30:35 | [diff] [blame] | 86 | const Experiment::Choice |
| 87 | kOmniboxHistoryQuickProviderReorderForInliningChoices[] = { |
| 88 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC, |
| 89 | "", |
| 90 | "" }, |
| 91 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED, |
| 92 | switches::kOmniboxHistoryQuickProviderReorderForInlining, |
| 93 | switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled }, |
| 94 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED, |
| 95 | switches::kOmniboxHistoryQuickProviderReorderForInlining, |
| 96 | switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled } |
| 97 | }; |
| 98 | |
[email protected] | 032d5e6c | 2012-02-17 17:53:55 | [diff] [blame] | 99 | const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = { |
| 100 | { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" }, |
| 101 | { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED, |
| 102 | switches::kOmniboxInlineHistoryQuickProvider, |
| 103 | switches::kOmniboxInlineHistoryQuickProviderAllowed }, |
| 104 | { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED, |
| 105 | switches::kOmniboxInlineHistoryQuickProvider, |
| 106 | switches::kOmniboxInlineHistoryQuickProviderProhibited } |
| 107 | }; |
| 108 | |
[email protected] | de02376 | 2012-07-26 17:10:17 | [diff] [blame] | 109 | const Experiment::Choice kFixedPositionCreatesStackingContextChoices[] = { |
| 110 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 111 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 112 | switches::kEnableFixedPositionCreatesStackingContext, ""}, |
| 113 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 114 | switches::kDisableFixedPositionCreatesStackingContext, ""} |
| 115 | }; |
| 116 | |
[email protected] | 9b19cf8 | 2012-06-13 06:23:23 | [diff] [blame] | 117 | const Experiment::Choice kForceCompositingModeChoices[] = { |
[email protected] | a45c6940 | 2012-06-24 16:32:20 | [diff] [blame] | 118 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 119 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
[email protected] | 9b19cf8 | 2012-06-13 06:23:23 | [diff] [blame] | 120 | switches::kForceCompositingMode, ""}, |
[email protected] | a45c6940 | 2012-06-24 16:32:20 | [diff] [blame] | 121 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
[email protected] | 9b19cf8 | 2012-06-13 06:23:23 | [diff] [blame] | 122 | switches::kDisableForceCompositingMode, ""} |
| 123 | }; |
| 124 | |
[email protected] | 72787e39 | 2012-03-23 05:55:43 | [diff] [blame] | 125 | const Experiment::Choice kThreadedCompositingModeChoices[] = { |
[email protected] | a45c6940 | 2012-06-24 16:32:20 | [diff] [blame] | 126 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 127 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
[email protected] | 72787e39 | 2012-03-23 05:55:43 | [diff] [blame] | 128 | switches::kDisableThreadedCompositing, ""}, |
[email protected] | a45c6940 | 2012-06-24 16:32:20 | [diff] [blame] | 129 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
[email protected] | 72787e39 | 2012-03-23 05:55:43 | [diff] [blame] | 130 | switches::kEnableThreadedCompositing, ""} |
| 131 | }; |
| 132 | |
[email protected] | 347a0c7 | 2012-05-14 20:28:06 | [diff] [blame] | 133 | const Experiment::Choice kTouchOptimizedUIChoices[] = { |
| 134 | { IDS_FLAGS_TOUCH_OPTIMIZED_UI_AUTOMATIC, "", "" }, |
[email protected] | a45c6940 | 2012-06-24 16:32:20 | [diff] [blame] | 135 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
[email protected] | 347a0c7 | 2012-05-14 20:28:06 | [diff] [blame] | 136 | switches::kTouchOptimizedUI, |
| 137 | switches::kTouchOptimizedUIEnabled }, |
[email protected] | a45c6940 | 2012-06-24 16:32:20 | [diff] [blame] | 138 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
[email protected] | 347a0c7 | 2012-05-14 20:28:06 | [diff] [blame] | 139 | switches::kTouchOptimizedUI, |
| 140 | switches::kTouchOptimizedUIDisabled } |
| 141 | }; |
| 142 | |
[email protected] | e4a8166 | 2012-06-25 23:57:07 | [diff] [blame] | 143 | const Experiment::Choice kPointerLockUIChoices[] = { |
| 144 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 145 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 146 | switches::kEnablePointerLock, ""}, |
| 147 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 148 | switches::kDisablePointerLock, ""} |
| 149 | }; |
| 150 | |
[email protected] | 026876f3 | 2012-08-22 23:53:40 | [diff] [blame^] | 151 | const Experiment::Choice kAsyncDnsChoices[] = { |
| 152 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 153 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 154 | switches::kDisableAsyncDns, ""}, |
| 155 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 156 | switches::kEnableAsyncDns, ""} |
| 157 | }; |
| 158 | |
[email protected] | 347a0c7 | 2012-05-14 20:28:06 | [diff] [blame] | 159 | |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 160 | // RECORDING USER METRICS FOR FLAGS: |
| 161 | // ----------------------------------------------------------------------------- |
| 162 | // The first line of the experiment is the internal name. If you'd like to |
| 163 | // gather statistics about the usage of your flag, you should append a marker |
| 164 | // comment to the end of the feature name, like so: |
| 165 | // "my-special-feature", // FLAGS:RECORD_UMA |
| 166 | // |
| 167 | // After doing that, run //chrome/tools/extract_actions.py (see instructions at |
| 168 | // the top of that file for details) to update the chromeactions.txt file, which |
| 169 | // will enable UMA to record your feature flag. |
| 170 | // |
| 171 | // After your feature has shipped under a flag, you can locate the metrics |
| 172 | // under the action name AboutFlags_internal-action-name. Actions are recorded |
| 173 | // once per startup, so you should divide this number by AboutFlags_StartupTick |
| 174 | // to get a sense of usage. Note that this will not be the same as number of |
| 175 | // users with a given feature enabled because users can quit and relaunch |
| 176 | // the application multiple times over a given time interval. |
| 177 | // TODO(rsesek): See if there's a way to count per-user, rather than |
| 178 | // per-startup. |
| 179 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 180 | // To add a new experiment add to the end of kExperiments. There are two |
| 181 | // distinct types of experiments: |
| 182 | // . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE |
| 183 | // macro for this type supplying the command line to the macro. |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 184 | // . MULTI_VALUE: a list of choices, the first of which should correspond to a |
| 185 | // deactivated state for this lab (i.e. no command line option). To specify |
| 186 | // this type of experiment use the macro MULTI_VALUE_TYPE supplying it the |
| 187 | // array of choices. |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 188 | // See the documentation of Experiment for details on the fields. |
| 189 | // |
| 190 | // When adding a new choice, add it to the end of the list. |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 191 | const Experiment kExperiments[] = { |
| 192 | { |
[email protected] | aac169d | 2011-03-18 19:53:03 | [diff] [blame] | 193 | "expose-for-tabs", // FLAGS:RECORD_UMA |
| 194 | IDS_FLAGS_TABPOSE_NAME, |
| 195 | IDS_FLAGS_TABPOSE_DESCRIPTION, |
| 196 | kOsMac, |
| 197 | #if defined(OS_MACOSX) |
| 198 | // The switch exists only on OS X. |
| 199 | SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs) |
| 200 | #else |
| 201 | SINGLE_VALUE_TYPE("") |
| 202 | #endif |
| 203 | }, |
| 204 | { |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 205 | "conflicting-modules-check", // FLAGS:RECORD_UMA |
[email protected] | c1bbaa8 | 2010-11-08 11:17:05 | [diff] [blame] | 206 | IDS_FLAGS_CONFLICTS_CHECK_NAME, |
| 207 | IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION, |
| 208 | kOsWin, |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 209 | SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck) |
[email protected] | c1bbaa8 | 2010-11-08 11:17:05 | [diff] [blame] | 210 | }, |
| 211 | { |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 212 | "cloud-print-proxy", // FLAGS:RECORD_UMA |
[email protected] | dae7325b | 2011-12-21 20:56:54 | [diff] [blame] | 213 | IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME, |
| 214 | IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION, |
[email protected] | 9f8872b3 | 2011-03-04 19:44:45 | [diff] [blame] | 215 | // 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] | 216 | // fully enabled. |
[email protected] | 5d10d57d | 2011-07-22 22:16:31 | [diff] [blame] | 217 | // Otherwise, where we know Windows could be working if a viable PDF |
[email protected] | 4fa24bf | 2011-08-20 02:15:22 | [diff] [blame] | 218 | // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux |
| 219 | // always have PDF rasterization available, so no flag needed there. |
| 220 | #if !defined(GOOGLE_CHROME_BUILD) |
| 221 | kOsWin, |
| 222 | #else |
| 223 | 0, |
[email protected] | fa6d2a2f | 2010-11-30 21:47:19 | [diff] [blame] | 224 | #endif |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 225 | SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy) |
[email protected] | 8b6588a | 2010-10-12 02:39:42 | [diff] [blame] | 226 | }, |
[email protected] | 580939a | 2010-10-12 18:54:37 | [diff] [blame] | 227 | { |
[email protected] | 0209b44 | 2012-07-18 00:38:05 | [diff] [blame] | 228 | "print-setting-reset", // FLAGS:RECORD_UMA |
| 229 | IDS_FLAGS_PRINT_SETTING_RESET_NAME, |
| 230 | IDS_FLAGS_PRINT_SETTING_RESET_DESCRIPTION, |
| 231 | kOsAll, |
| 232 | SINGLE_VALUE_TYPE(switches::kPrintSettingsReset) |
| 233 | }, |
[email protected] | 60d77bd | 2012-08-22 00:10:07 | [diff] [blame] | 234 | #if defined(OS_WIN) |
| 235 | { |
| 236 | "print-raster", |
| 237 | IDS_FLAGS_PRINT_RASTER_NAME, |
| 238 | IDS_FLAGS_PRINT_RASTER_DESCRIPTION, |
| 239 | kOsWin, |
| 240 | SINGLE_VALUE_TYPE(switches::kPrintRaster) |
| 241 | }, |
| 242 | #endif // OS_WIN |
[email protected] | 0209b44 | 2012-07-18 00:38:05 | [diff] [blame] | 243 | { |
[email protected] | bb46153 | 2010-11-26 21:50:23 | [diff] [blame] | 244 | "crxless-web-apps", |
| 245 | IDS_FLAGS_CRXLESS_WEB_APPS_NAME, |
| 246 | IDS_FLAGS_CRXLESS_WEB_APPS_DESCRIPTION, |
| 247 | kOsAll, |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 248 | SINGLE_VALUE_TYPE(switches::kEnableCrxlessWebApps) |
[email protected] | bb46153 | 2010-11-26 21:50:23 | [diff] [blame] | 249 | }, |
| 250 | { |
[email protected] | 96c6f4c | 2011-05-18 19:36:22 | [diff] [blame] | 251 | "ignore-gpu-blacklist", |
| 252 | IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME, |
| 253 | IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION, |
| 254 | kOsAll, |
| 255 | SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist) |
| 256 | }, |
| 257 | { |
[email protected] | 0110cf11 | 2011-07-02 00:39:43 | [diff] [blame] | 258 | "force-compositing-mode-2", |
[email protected] | 96c6f4c | 2011-05-18 19:36:22 | [diff] [blame] | 259 | IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME, |
| 260 | IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION, |
[email protected] | 9b19cf8 | 2012-06-13 06:23:23 | [diff] [blame] | 261 | kOsMac | kOsWin | kOsLinux, |
| 262 | MULTI_VALUE_TYPE(kForceCompositingModeChoices) |
[email protected] | 96c6f4c | 2011-05-18 19:36:22 | [diff] [blame] | 263 | }, |
| 264 | { |
[email protected] | 72787e39 | 2012-03-23 05:55:43 | [diff] [blame] | 265 | "threaded-compositing-mode", |
| 266 | IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME, |
| 267 | IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION, |
[email protected] | 644a107 | 2012-03-16 09:29:59 | [diff] [blame] | 268 | kOsAll, |
[email protected] | 72787e39 | 2012-03-23 05:55:43 | [diff] [blame] | 269 | MULTI_VALUE_TYPE(kThreadedCompositingModeChoices) |
[email protected] | 644a107 | 2012-03-16 09:29:59 | [diff] [blame] | 270 | }, |
| 271 | { |
[email protected] | 81c64af6 | 2012-06-06 20:15:52 | [diff] [blame] | 272 | "disable-accelerated-2d-canvas", |
| 273 | IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME, |
| 274 | IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION, |
| 275 | kOsAll, |
| 276 | SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas) |
| 277 | }, |
| 278 | { |
[email protected] | 69cffc8 | 2012-08-10 13:27:27 | [diff] [blame] | 279 | "disable-deferred-2d-canvas", |
| 280 | IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_NAME, |
| 281 | IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_DESCRIPTION, |
| 282 | kOsAll, |
| 283 | SINGLE_VALUE_TYPE(switches::kDisableDeferred2dCanvas) |
| 284 | }, |
| 285 | { |
[email protected] | efcde13 | 2012-05-30 01:05:18 | [diff] [blame] | 286 | "disable-threaded-animation", |
| 287 | IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME, |
| 288 | IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION, |
[email protected] | 644a107 | 2012-03-16 09:29:59 | [diff] [blame] | 289 | kOsAll, |
[email protected] | efcde13 | 2012-05-30 01:05:18 | [diff] [blame] | 290 | SINGLE_VALUE_TYPE(switches::kDisableThreadedAnimation) |
[email protected] | 644a107 | 2012-03-16 09:29:59 | [diff] [blame] | 291 | }, |
| 292 | { |
[email protected] | 5963b77 | 2011-02-09 22:55:38 | [diff] [blame] | 293 | "composited-layer-borders", |
| 294 | IDS_FLAGS_COMPOSITED_LAYER_BORDERS, |
| 295 | IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION, |
| 296 | kOsAll, |
| 297 | SINGLE_VALUE_TYPE(switches::kShowCompositedLayerBorders) |
| 298 | }, |
| 299 | { |
[email protected] | a8f1eaa | 2011-03-07 19:00:58 | [diff] [blame] | 300 | "show-fps-counter", |
| 301 | IDS_FLAGS_SHOW_FPS_COUNTER, |
| 302 | IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION, |
| 303 | kOsAll, |
| 304 | SINGLE_VALUE_TYPE(switches::kShowFPSCounter) |
| 305 | }, |
[email protected] | 8ff7f34 | 2011-05-25 01:49:47 | [diff] [blame] | 306 | { |
[email protected] | 70c98a33 | 2011-12-21 20:51:52 | [diff] [blame] | 307 | "accelerated-filters", |
| 308 | IDS_FLAGS_ACCELERATED_FILTERS, |
| 309 | IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION, |
| 310 | kOsAll, |
| 311 | SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters) |
| 312 | }, |
| 313 | { |
[email protected] | 8ff7f34 | 2011-05-25 01:49:47 | [diff] [blame] | 314 | "disable-gpu-vsync", |
| 315 | IDS_FLAGS_DISABLE_GPU_VSYNC_NAME, |
| 316 | IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION, |
| 317 | kOsAll, |
| 318 | SINGLE_VALUE_TYPE(switches::kDisableGpuVsync) |
| 319 | }, |
[email protected] | deaba6d5 | 2011-09-23 14:47:12 | [diff] [blame] | 320 | { |
| 321 | "disable-webgl", |
| 322 | IDS_FLAGS_DISABLE_WEBGL_NAME, |
| 323 | IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION, |
| 324 | kOsAll, |
| 325 | SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL) |
| 326 | }, |
[email protected] | 09096e0 | 2012-05-24 11:12:04 | [diff] [blame] | 327 | { |
[email protected] | 96bcdc10 | 2012-05-24 23:42:10 | [diff] [blame] | 328 | "fixed-position-creates-stacking-context", |
| 329 | IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME, |
| 330 | IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION, |
| 331 | kOsAll, |
[email protected] | de02376 | 2012-07-26 17:10:17 | [diff] [blame] | 332 | MULTI_VALUE_TYPE(kFixedPositionCreatesStackingContextChoices) |
[email protected] | 96bcdc10 | 2012-05-24 23:42:10 | [diff] [blame] | 333 | }, |
[email protected] | d208f4d8 | 2011-05-23 21:52:03 | [diff] [blame] | 334 | // TODO(dspringer): When NaCl is on by default, remove this flag entry. |
[email protected] | 2fe15fcb | 2010-10-21 20:39:53 | [diff] [blame] | 335 | { |
[email protected] | e3791ce9 | 2011-08-09 01:03:32 | [diff] [blame] | 336 | "enable-nacl", // FLAGS:RECORD_UMA |
[email protected] | 4ff87d20 | 2010-11-06 01:28:40 | [diff] [blame] | 337 | IDS_FLAGS_ENABLE_NACL_NAME, |
| 338 | IDS_FLAGS_ENABLE_NACL_DESCRIPTION, |
| 339 | kOsAll, |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 340 | SINGLE_VALUE_TYPE(switches::kEnableNaCl) |
[email protected] | 4ff87d20 | 2010-11-06 01:28:40 | [diff] [blame] | 341 | }, |
[email protected] | b39c6d9 | 2012-01-31 16:38:41 | [diff] [blame] | 342 | // TODO(halyavin): When exception handling is on by default, replace this |
| 343 | // flag with disable-nacl-exception-handling. |
| 344 | { |
| 345 | "enable-nacl-exception-handling", // FLAGS:RECORD_UMA |
| 346 | IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_NAME, |
| 347 | IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_DESCRIPTION, |
| 348 | kOsWin, |
| 349 | SINGLE_VALUE_TYPE(switches::kEnableNaClExceptionHandling) |
| 350 | }, |
[email protected] | 4ff87d20 | 2010-11-06 01:28:40 | [diff] [blame] | 351 | { |
[email protected] | 31a665e7 | 2012-03-11 12:37:46 | [diff] [blame] | 352 | "nacl-gdb", // FLAGS:RECORD_UMA |
| 353 | IDS_FLAGS_NACL_GDB_NAME, |
| 354 | IDS_FLAGS_NACL_GDB_DESCRIPTION, |
| 355 | kOsWin, |
| 356 | SINGLE_VALUE_TYPE(switches::kNaClGdb) |
| 357 | }, |
| 358 | { |
[email protected] | 401b9079 | 2012-05-30 11:41:13 | [diff] [blame] | 359 | "nacl-gdb-script", // FLAGS:RECORD_UMA |
| 360 | IDS_FLAGS_NACL_GDB_SCRIPT_NAME, |
| 361 | IDS_FLAGS_NACL_GDB_SCRIPT_DESCRIPTION, |
| 362 | kOsAll, |
| 363 | SINGLE_VALUE_TYPE(switches::kNaClGdbScript) |
| 364 | }, |
| 365 | { |
[email protected] | 7babd1c | 2012-08-08 20:35:29 | [diff] [blame] | 366 | "enable-pnacl", // FLAGS:RECORD_UMA |
| 367 | IDS_FLAGS_ENABLE_PNACL_NAME, |
| 368 | IDS_FLAGS_ENABLE_PNACL_DESCRIPTION, |
| 369 | kOsAll, |
| 370 | SINGLE_VALUE_TYPE(switches::kEnablePnacl) |
| 371 | }, |
| 372 | { |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 373 | "extension-apis", // FLAGS:RECORD_UMA |
[email protected] | 11dd68cd5 | 2010-11-12 01:15:32 | [diff] [blame] | 374 | IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME, |
| 375 | IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION, |
| 376 | kOsAll, |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 377 | SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis) |
[email protected] | 11dd68cd5 | 2010-11-12 01:15:32 | [diff] [blame] | 378 | }, |
[email protected] | 3627b06d | 2010-11-12 16:36:16 | [diff] [blame] | 379 | { |
[email protected] | cab18ef | 2012-04-27 07:22:03 | [diff] [blame] | 380 | "action-box", |
| 381 | IDS_FLAGS_ACTION_BOX_NAME, |
| 382 | IDS_FLAGS_ACTION_BOX_DESCRIPTION, |
| 383 | kOsAll, |
| 384 | SINGLE_VALUE_TYPE(switches::kEnableActionBox), |
| 385 | }, |
| 386 | { |
[email protected] | 3a36243 | 2012-06-18 20:39:51 | [diff] [blame] | 387 | "script-badges", |
| 388 | IDS_FLAGS_SCRIPT_BADGES_NAME, |
| 389 | IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION, |
| 390 | kOsAll, |
| 391 | SINGLE_VALUE_TYPE(switches::kEnableScriptBadges), |
| 392 | }, |
| 393 | { |
[email protected] | cbe224d | 2011-08-04 22:12:49 | [diff] [blame] | 394 | "apps-new-install-bubble", |
| 395 | IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME, |
| 396 | IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION, |
| 397 | kOsAll, |
| 398 | SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble) |
| 399 | }, |
| 400 | { |
[email protected] | 80bd24e | 2010-11-30 09:34:38 | [diff] [blame] | 401 | "disable-hyperlink-auditing", |
| 402 | IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME, |
| 403 | IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION, |
| 404 | kOsAll, |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 405 | SINGLE_VALUE_TYPE(switches::kNoPings) |
[email protected] | feb28fef | 2010-12-01 10:52:51 | [diff] [blame] | 406 | }, |
| 407 | { |
| 408 | "experimental-location-features", // FLAGS:RECORD_UMA |
| 409 | IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME, |
| 410 | IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION, |
| 411 | kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS. |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 412 | SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures) |
| 413 | }, |
| 414 | { |
[email protected] | 5aea186 | 2011-03-23 23:55:39 | [diff] [blame] | 415 | "tab-groups-context-menu", |
| 416 | IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME, |
| 417 | IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION, |
| 418 | kOsWin, |
| 419 | SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu) |
| 420 | }, |
[email protected] | c94cebd | 2012-06-21 00:55:28 | [diff] [blame] | 421 | #if defined(OS_CHROMEOS) |
| 422 | { |
| 423 | "enable-instant-extended-api", |
| 424 | IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API, |
| 425 | IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION, |
| 426 | kOsAll, |
| 427 | SINGLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI) |
| 428 | }, |
| 429 | #endif |
[email protected] | e9bf9d9 | 2011-03-31 20:57:15 | [diff] [blame] | 430 | { |
[email protected] | 354e33b | 2011-06-15 00:29:10 | [diff] [blame] | 431 | "static-ip-config", |
| 432 | IDS_FLAGS_STATIC_IP_CONFIG_NAME, |
| 433 | IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION, |
| 434 | kOsCrOS, |
| 435 | #if defined(OS_CHROMEOS) |
| 436 | // This switch exists only on Chrome OS. |
| 437 | SINGLE_VALUE_TYPE(switches::kEnableStaticIPConfig) |
| 438 | #else |
| 439 | SINGLE_VALUE_TYPE("") |
| 440 | #endif |
| 441 | }, |
[email protected] | 3eb5728c | 2011-06-20 22:32:24 | [diff] [blame] | 442 | { |
| 443 | "show-autofill-type-predictions", |
| 444 | IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME, |
| 445 | IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION, |
| 446 | kOsAll, |
| 447 | SINGLE_VALUE_TYPE(switches::kShowAutofillTypePredictions) |
| 448 | }, |
[email protected] | bff4d3e | 2011-06-21 23:58:52 | [diff] [blame] | 449 | { |
[email protected] | fdf4e25 | 2012-04-27 00:26:55 | [diff] [blame] | 450 | "sync-tab-favicons", |
| 451 | IDS_FLAGS_SYNC_TAB_FAVICONS_NAME, |
| 452 | IDS_FLAGS_SYNC_TAB_FAVICONS_DESCRIPTION, |
| 453 | kOsAll, |
| 454 | SINGLE_VALUE_TYPE(switches::kSyncTabFavicons) |
| 455 | }, |
| 456 | { |
[email protected] | aae9eeb1 | 2011-10-21 21:59:26 | [diff] [blame] | 457 | "sync-app-notifications", |
| 458 | IDS_FLAGS_SYNC_APP_NOTIFICATIONS_NAME, |
| 459 | IDS_FLAGS_SYNC_APP_NOTIFICATIONS_DESCRIPTION, |
| 460 | kOsAll, |
[email protected] | 0b6fba8 | 2011-11-18 01:31:11 | [diff] [blame] | 461 | SINGLE_VALUE_TYPE(switches::kDisableSyncAppNotifications) |
[email protected] | aae9eeb1 | 2011-10-21 21:59:26 | [diff] [blame] | 462 | }, |
| 463 | { |
[email protected] | a22ebd81 | 2011-06-23 00:05:39 | [diff] [blame] | 464 | "enable-smooth-scrolling", // FLAGS:RECORD_UMA |
| 465 | IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME, |
| 466 | IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION, |
| 467 | // Can't expose the switch unless the code is compiled in. |
[email protected] | 554b706 | 2011-09-03 03:09:40 | [diff] [blame] | 468 | // On by default for the Mac (different implementation in WebKit). |
[email protected] | 554b706 | 2011-09-03 03:09:40 | [diff] [blame] | 469 | kOsWin | kOsLinux | kOsCrOS, |
[email protected] | a22ebd81 | 2011-06-23 00:05:39 | [diff] [blame] | 470 | SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling) |
| 471 | }, |
[email protected] | 81a6b0b | 2011-06-24 17:55:40 | [diff] [blame] | 472 | { |
[email protected] | 6831780 | 2012-06-07 19:13:23 | [diff] [blame] | 473 | "omnibox-history-quick-provider-new-scoring", |
| 474 | IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME, |
| 475 | IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION, |
| 476 | kOsAll, |
| 477 | MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderNewScoringChoices) |
| 478 | }, |
| 479 | { |
[email protected] | 128dc6c | 2012-06-22 20:30:35 | [diff] [blame] | 480 | "omnibox-history-quick-provider-reorder-for-inlining", |
| 481 | IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME, |
| 482 | IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION, |
| 483 | kOsAll, |
| 484 | MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices) |
| 485 | }, |
| 486 | { |
[email protected] | 032d5e6c | 2012-02-17 17:53:55 | [diff] [blame] | 487 | "omnibox-inline-history-quick-provider", |
| 488 | IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME, |
| 489 | IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION, |
| 490 | kOsAll, |
| 491 | MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices) |
| 492 | }, |
| 493 | { |
[email protected] | 7e7a2809 | 2011-12-09 22:24:55 | [diff] [blame] | 494 | "enable-panels", |
| 495 | IDS_FLAGS_ENABLE_PANELS_NAME, |
| 496 | IDS_FLAGS_ENABLE_PANELS_DESCRIPTION, |
[email protected] | 73fb1fc5 | 2011-07-09 00:06:54 | [diff] [blame] | 497 | kOsAll, |
[email protected] | 7e7a2809 | 2011-12-09 22:24:55 | [diff] [blame] | 498 | SINGLE_VALUE_TYPE(switches::kEnablePanels) |
[email protected] | 73fb1fc5 | 2011-07-09 00:06:54 | [diff] [blame] | 499 | }, |
[email protected] | e3749d1 | 2011-07-25 22:22:12 | [diff] [blame] | 500 | { |
[email protected] | 27c14f0 | 2012-06-22 17:29:58 | [diff] [blame] | 501 | // See http://crbug.com/120416 for how to remove this flag. |
[email protected] | 6474b11 | 2012-05-04 19:35:27 | [diff] [blame] | 502 | "save-page-as-mhtml", // FLAGS:RECORD_UMA |
| 503 | IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME, |
| 504 | IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION, |
| 505 | kOsMac | kOsWin | kOsLinux, |
| 506 | SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML) |
| 507 | }, |
| 508 | { |
[email protected] | b7bb44f | 2011-09-01 05:17:03 | [diff] [blame] | 509 | "enable-autologin", |
| 510 | IDS_FLAGS_ENABLE_AUTOLOGIN_NAME, |
| 511 | IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION, |
| 512 | kOsMac | kOsWin | kOsLinux, |
| 513 | SINGLE_VALUE_TYPE(switches::kEnableAutologin) |
| 514 | }, |
[email protected] | b984117 | 2011-09-26 23:36:09 | [diff] [blame] | 515 | { |
[email protected] | bbadb11 | 2011-12-12 16:55:28 | [diff] [blame] | 516 | "enable-http-pipelining", |
| 517 | IDS_FLAGS_ENABLE_HTTP_PIPELINING_NAME, |
| 518 | IDS_FLAGS_ENABLE_HTTP_PIPELINING_DESCRIPTION, |
| 519 | kOsAll, |
| 520 | SINGLE_VALUE_TYPE(switches::kEnableHttpPipelining) |
| 521 | }, |
[email protected] | d411c01d | 2011-10-18 16:00:27 | [diff] [blame] | 522 | { |
[email protected] | 3231b61 | 2012-03-23 05:57:54 | [diff] [blame] | 523 | "enable-spdy3", |
| 524 | IDS_FLAGS_ENABLE_SPDY3_NAME, |
| 525 | IDS_FLAGS_ENABLE_SPDY3_DESCRIPTION, |
| 526 | kOsAll, |
| 527 | SINGLE_VALUE_TYPE(switches::kEnableSpdy3) |
| 528 | }, |
| 529 | { |
[email protected] | 27b3fe9 | 2012-03-21 05:35:06 | [diff] [blame] | 530 | "enable-async-dns", |
| 531 | IDS_FLAGS_ENABLE_ASYNC_DNS_NAME, |
| 532 | IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION, |
[email protected] | 026876f3 | 2012-08-22 23:53:40 | [diff] [blame^] | 533 | kOsWin | kOsMac | kOsLinux, |
| 534 | MULTI_VALUE_TYPE(kAsyncDnsChoices) |
[email protected] | 27b3fe9 | 2012-03-21 05:35:06 | [diff] [blame] | 535 | }, |
| 536 | { |
[email protected] | f5da41d | 2011-10-08 17:40:07 | [diff] [blame] | 537 | "enable-video-track", |
| 538 | IDS_FLAGS_ENABLE_VIDEO_TRACK_NAME, |
| 539 | IDS_FLAGS_ENABLE_VIDEO_TRACK_DESCRIPTION, |
| 540 | kOsAll, |
| 541 | SINGLE_VALUE_TYPE(switches::kEnableVideoTrack) |
| 542 | }, |
[email protected] | 08b8336 | 2011-10-19 05:23:17 | [diff] [blame] | 543 | { |
[email protected] | 6aa03b3 | 2011-10-27 21:44:44 | [diff] [blame] | 544 | "enable-media-source", |
| 545 | IDS_FLAGS_ENABLE_MEDIA_SOURCE_NAME, |
| 546 | IDS_FLAGS_ENABLE_MEDIA_SOURCE_DESCRIPTION, |
[email protected] | ec9d053 | 2012-03-21 05:55:32 | [diff] [blame] | 547 | kOsAll, |
[email protected] | 6aa03b3 | 2011-10-27 21:44:44 | [diff] [blame] | 548 | SINGLE_VALUE_TYPE(switches::kEnableMediaSource) |
| 549 | }, |
[email protected] | e4e68dbb | 2011-11-18 01:50:22 | [diff] [blame] | 550 | { |
[email protected] | 9f5b782 | 2012-04-18 23:39:03 | [diff] [blame] | 551 | "enable-encrypted-media", |
| 552 | IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_NAME, |
| 553 | IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_DESCRIPTION, |
| 554 | kOsAll, |
| 555 | SINGLE_VALUE_TYPE(switches::kEnableEncryptedMedia) |
| 556 | }, |
| 557 | { |
[email protected] | e4e68dbb | 2011-11-18 01:50:22 | [diff] [blame] | 558 | "enable-pointer-lock", |
| 559 | IDS_FLAGS_ENABLE_POINTER_LOCK_NAME, |
| 560 | IDS_FLAGS_ENABLE_POINTER_LOCK_DESCRIPTION, |
| 561 | kOsAll, |
[email protected] | e4a8166 | 2012-06-25 23:57:07 | [diff] [blame] | 562 | MULTI_VALUE_TYPE(kPointerLockUIChoices) |
[email protected] | e4e68dbb | 2011-11-18 01:50:22 | [diff] [blame] | 563 | }, |
[email protected] | dc04be7c | 2012-03-15 23:57:49 | [diff] [blame] | 564 | #if defined(USE_ASH) |
[email protected] | 8cc10df | 2011-11-03 23:57:50 | [diff] [blame] | 565 | { |
[email protected] | 57b8bb35 | 2012-01-11 05:11:46 | [diff] [blame] | 566 | "aura-google-dialog-frames", |
| 567 | IDS_FLAGS_AURA_GOOGLE_DIALOG_FRAMES_NAME, |
| 568 | IDS_FLAGS_AURA_GOOGLE_DIALOG_FRAMES_DESCRIPTION, |
| 569 | kOsWin | kOsLinux | kOsCrOS, |
| 570 | SINGLE_VALUE_TYPE(ash::switches::kAuraGoogleDialogFrames) |
| 571 | }, |
[email protected] | dc04be7c | 2012-03-15 23:57:49 | [diff] [blame] | 572 | #endif |
[email protected] | eaae8b46 | 2012-01-20 22:20:39 | [diff] [blame] | 573 | { |
[email protected] | db543d32 | 2011-12-15 20:40:15 | [diff] [blame] | 574 | "per-tile-painting", |
| 575 | IDS_FLAGS_PER_TILE_PAINTING_NAME, |
| 576 | IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION, |
| 577 | #if defined(USE_SKIA) |
[email protected] | a5b1b27 | 2012-01-06 20:44:37 | [diff] [blame] | 578 | kOsMac | kOsLinux | kOsCrOS, |
[email protected] | db543d32 | 2011-12-15 20:40:15 | [diff] [blame] | 579 | #else |
| 580 | 0, |
| 581 | #endif |
| 582 | SINGLE_VALUE_TYPE(switches::kEnablePerTilePainting) |
| 583 | }, |
[email protected] | bf88c03 | 2011-12-22 19:05:47 | [diff] [blame] | 584 | { |
| 585 | "enable-javascript-harmony", |
| 586 | IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME, |
| 587 | IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION, |
| 588 | kOsAll, |
| 589 | SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony") |
| 590 | }, |
[email protected] | 7e7f378a | 2012-01-05 14:35:37 | [diff] [blame] | 591 | { |
[email protected] | 8564617 | 2012-01-09 22:45:54 | [diff] [blame] | 592 | "enable-tab-browser-dragging", |
| 593 | IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME, |
| 594 | IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION, |
| 595 | kOsWin, |
| 596 | SINGLE_VALUE_TYPE(switches::kTabBrowserDragging) |
| 597 | }, |
| 598 | { |
[email protected] | 068b7b5 | 2012-02-27 12:41:44 | [diff] [blame] | 599 | "disable-restore-session-state", |
| 600 | IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME, |
| 601 | IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION, |
[email protected] | 7e7f378a | 2012-01-05 14:35:37 | [diff] [blame] | 602 | kOsAll, |
[email protected] | 068b7b5 | 2012-02-27 12:41:44 | [diff] [blame] | 603 | SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState) |
[email protected] | 7e7f378a | 2012-01-05 14:35:37 | [diff] [blame] | 604 | }, |
[email protected] | 88864db | 2012-01-18 20:56:35 | [diff] [blame] | 605 | { |
| 606 | "disable-software-rasterizer", |
| 607 | IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME, |
| 608 | IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION, |
| 609 | #if defined(ENABLE_SWIFTSHADER) |
| 610 | kOsAll, |
| 611 | #else |
| 612 | 0, |
| 613 | #endif |
| 614 | SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer) |
| 615 | }, |
[email protected] | 15a5d72 | 2012-01-23 09:11:14 | [diff] [blame] | 616 | { |
[email protected] | 8ea05a1 | 2012-05-02 09:17:47 | [diff] [blame] | 617 | "enable-peer-connection", |
| 618 | IDS_FLAGS_PEER_CONNECTION_NAME, |
| 619 | IDS_FLAGS_PEER_CONNECTION_DESCRIPTION, |
| 620 | kOsAll, |
| 621 | SINGLE_VALUE_TYPE(switches::kEnablePeerConnection) |
| 622 | }, |
| 623 | { |
[email protected] | d2edc670 | 2012-01-30 09:13:16 | [diff] [blame] | 624 | "enable-shadow-dom", |
| 625 | IDS_FLAGS_SHADOW_DOM_NAME, |
| 626 | IDS_FLAGS_SHADOW_DOM_DESCRIPTION, |
| 627 | kOsAll, |
| 628 | SINGLE_VALUE_TYPE(switches::kEnableShadowDOM) |
| 629 | }, |
[email protected] | 9860c68b | 2012-02-02 01:58:09 | [diff] [blame] | 630 | { |
[email protected] | 4961218f | 2012-02-23 10:11:07 | [diff] [blame] | 631 | "enable-style-scoped", |
| 632 | IDS_FLAGS_STYLE_SCOPED_NAME, |
| 633 | IDS_FLAGS_STYLE_SCOPED_DESCRIPTION, |
| 634 | kOsAll, |
| 635 | SINGLE_VALUE_TYPE(switches::kEnableStyleScoped) |
| 636 | }, |
| 637 | { |
[email protected] | ca7a3d79 | 2012-03-02 15:55:49 | [diff] [blame] | 638 | "enable-css-regions", |
| 639 | IDS_FLAGS_CSS_REGIONS_NAME, |
| 640 | IDS_FLAGS_CSS_REGIONS_DESCRIPTION, |
| 641 | kOsAll, |
| 642 | SINGLE_VALUE_TYPE(switches::kEnableCssRegions) |
| 643 | }, |
| 644 | { |
[email protected] | b63b969 | 2012-07-25 02:38:01 | [diff] [blame] | 645 | "enable-css-variables", |
| 646 | IDS_FLAGS_CSS_VARIABLES_NAME, |
| 647 | IDS_FLAGS_CSS_VARIABLES_DESCRIPTION, |
| 648 | kOsAll, |
| 649 | SINGLE_VALUE_TYPE(switches::kEnableCssVariables) |
| 650 | }, |
| 651 | { |
[email protected] | 9860c68b | 2012-02-02 01:58:09 | [diff] [blame] | 652 | "enable-extension-activity-ui", |
| 653 | IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME, |
| 654 | IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION, |
| 655 | kOsAll, |
| 656 | SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI) |
[email protected] | 8bed69d | 2012-02-02 06:46:00 | [diff] [blame] | 657 | }, |
[email protected] | 54ae4e9 | 2012-02-16 15:19:05 | [diff] [blame] | 658 | { |
[email protected] | 3e8befc | 2012-03-13 01:17:03 | [diff] [blame] | 659 | "disable-ntp-other-sessions-menu", |
[email protected] | 156f96633 | 2012-02-29 00:03:16 | [diff] [blame] | 660 | IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME, |
| 661 | IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION, |
| 662 | kOsAll, |
[email protected] | 3e8befc | 2012-03-13 01:17:03 | [diff] [blame] | 663 | SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu) |
[email protected] | 156f96633 | 2012-02-29 00:03:16 | [diff] [blame] | 664 | }, |
[email protected] | dc04be7c | 2012-03-15 23:57:49 | [diff] [blame] | 665 | #if defined(USE_ASH) |
[email protected] | 31cf1c5 | 2012-02-29 20:55:01 | [diff] [blame] | 666 | { |
[email protected] | 3cd198a2 | 2012-03-12 20:38:01 | [diff] [blame] | 667 | "enable-ash-oak", |
| 668 | IDS_FLAGS_ENABLE_ASH_OAK_NAME, |
| 669 | IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION, |
| 670 | kOsAll, |
| 671 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak), |
| 672 | }, |
[email protected] | 31cf1c5 | 2012-02-29 20:55:01 | [diff] [blame] | 673 | #endif |
[email protected] | 184ec59 | 2012-03-01 11:54:28 | [diff] [blame] | 674 | { |
| 675 | "enable-devtools-experiments", |
| 676 | IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME, |
| 677 | IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION, |
| 678 | kOsAll, |
| 679 | SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments) |
| 680 | }, |
[email protected] | 76d1854e | 2012-03-02 23:57:44 | [diff] [blame] | 681 | { |
| 682 | "enable-suggestions-ntp", |
| 683 | IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME, |
| 684 | IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION, |
| 685 | kOsAll, |
| 686 | SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage) |
| 687 | }, |
[email protected] | a78ef9e | 2012-03-21 02:49:55 | [diff] [blame] | 688 | { |
[email protected] | 7226735 | 2012-07-20 20:14:47 | [diff] [blame] | 689 | "enable-discovery-ntp", |
| 690 | IDS_FLAGS_ENABLE_NTP_DISCOVERY_NAME, |
| 691 | IDS_FLAGS_ENABLE_NTP_DISCOVERY_DESCRIPTION, |
| 692 | kOsAll, |
| 693 | SINGLE_VALUE_TYPE(switches::kEnableDiscoveryInNewTabPage) |
| 694 | }, |
| 695 | { |
[email protected] | f9717ce | 2012-08-10 20:44:03 | [diff] [blame] | 696 | "disable-chrome-to-mobile", // FLAGS:RECORD_UMA |
| 697 | IDS_FLAGS_DISABLE_CHROME_TO_MOBILE_NAME, |
| 698 | IDS_FLAGS_DISABLE_CHROME_TO_MOBILE_DESCRIPTION, |
[email protected] | a78ef9e | 2012-03-21 02:49:55 | [diff] [blame] | 699 | kOsAll, |
[email protected] | f9717ce | 2012-08-10 20:44:03 | [diff] [blame] | 700 | SINGLE_VALUE_TYPE(switches::kDisableChromeToMobile) |
[email protected] | a78ef9e | 2012-03-21 02:49:55 | [diff] [blame] | 701 | }, |
[email protected] | 8e466dd | 2012-05-04 19:16:05 | [diff] [blame] | 702 | #if defined(GOOGLE_CHROME_BUILD) |
[email protected] | a3d5425 | 2012-04-05 20:04:13 | [diff] [blame] | 703 | { |
[email protected] | 37b928e | 2012-05-30 09:01:10 | [diff] [blame] | 704 | "disable-asynchronous-spellchecking", |
| 705 | IDS_FLAGS_DISABLE_ASYNCHRONOUS_SPELLCHECKING, |
| 706 | IDS_FLAGS_DISABLE_ASYNCHRONOUS_SPELLCHECKING_DESCRIPTION, |
| 707 | kOsWin | kOsLinux | kOsCrOS, |
| 708 | SINGLE_VALUE_TYPE(switches::kDisableAsynchronousSpellChecking) |
[email protected] | a3d5425 | 2012-04-05 20:04:13 | [diff] [blame] | 709 | }, |
[email protected] | 8e466dd | 2012-05-04 19:16:05 | [diff] [blame] | 710 | #endif |
[email protected] | c9c73ad4 | 2012-04-18 03:35:59 | [diff] [blame] | 711 | { |
| 712 | "touch-optimized-ui", |
[email protected] | 347a0c7 | 2012-05-14 20:28:06 | [diff] [blame] | 713 | IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME, |
| 714 | IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION, |
[email protected] | c71fe640 | 2012-08-15 15:22:55 | [diff] [blame] | 715 | kOsWin, |
[email protected] | 347a0c7 | 2012-05-14 20:28:06 | [diff] [blame] | 716 | MULTI_VALUE_TYPE(kTouchOptimizedUIChoices) |
[email protected] | c9c73ad4 | 2012-04-18 03:35:59 | [diff] [blame] | 717 | }, |
[email protected] | 8a6aaa7 | 2012-04-20 20:53:58 | [diff] [blame] | 718 | { |
| 719 | "enable-touch-events", |
| 720 | IDS_ENABLE_TOUCH_EVENTS_NAME, |
| 721 | IDS_ENABLE_TOUCH_EVENTS_DESCRIPTION, |
| 722 | kOsAll, |
| 723 | SINGLE_VALUE_TYPE(switches::kEnableTouchEvents) |
| 724 | }, |
[email protected] | 0b60afa | 2012-04-19 17:36:39 | [diff] [blame] | 725 | #if defined(OS_CHROMEOS) |
| 726 | { |
[email protected] | 0b60afa | 2012-04-19 17:36:39 | [diff] [blame] | 727 | "no-discard-tabs", |
| 728 | IDS_FLAGS_NO_DISCARD_TABS_NAME, |
| 729 | IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION, |
| 730 | kOsCrOS, |
| 731 | SINGLE_VALUE_TYPE(switches::kNoDiscardTabs) |
| 732 | }, |
| 733 | #endif |
[email protected] | 79be6d3 | 2012-04-24 20:47:44 | [diff] [blame] | 734 | { |
[email protected] | 9a5940d | 2012-04-27 19:16:23 | [diff] [blame] | 735 | "allow-nacl-socket-api", |
| 736 | IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME, |
| 737 | IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION, |
| 738 | kOsAll, |
| 739 | SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*") |
| 740 | }, |
[email protected] | 8533373 | 2012-05-01 19:02:24 | [diff] [blame] | 741 | { |
[email protected] | 60673ad7 | 2012-05-02 06:16:33 | [diff] [blame] | 742 | "stacked-tab-strip", |
| 743 | IDS_FLAGS_STACKED_TAB_STRIP_NAME, |
| 744 | IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION, |
| 745 | kOsWin, |
| 746 | SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip) |
| 747 | }, |
| 748 | { |
[email protected] | 4bd2020 | 2012-06-14 17:35:01 | [diff] [blame] | 749 | "force-device-scale-factor", |
[email protected] | 8533373 | 2012-05-01 19:02:24 | [diff] [blame] | 750 | IDS_FLAGS_FORCE_HIGH_DPI_NAME, |
| 751 | IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION, |
| 752 | kOsCrOS, |
[email protected] | 4bd2020 | 2012-06-14 17:35:01 | [diff] [blame] | 753 | SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2") |
[email protected] | 8533373 | 2012-05-01 19:02:24 | [diff] [blame] | 754 | }, |
[email protected] | adda8951 | 2012-07-26 17:01:54 | [diff] [blame] | 755 | { |
| 756 | "enable-hidpi-pdf-plugin", |
| 757 | IDS_FLAGS_ENABLE_HIGH_DPI_PDF_PLUGIN_NAME, |
| 758 | IDS_FLAGS_ENABLE_HIGH_DPI_PDF_PLUGIN_DESCRIPTION, |
| 759 | kOsCrOS | kOsMac, |
| 760 | SINGLE_VALUE_TYPE(switches::kEnableHighDPIPDFPlugin) |
| 761 | }, |
[email protected] | 190349fd | 2012-05-02 00:10:47 | [diff] [blame] | 762 | #if defined(OS_CHROMEOS) |
| 763 | { |
| 764 | "allow-touchpad-three-finger-click", |
| 765 | IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME, |
| 766 | IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION, |
| 767 | kOsCrOS, |
| 768 | SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick) |
| 769 | }, |
| 770 | #endif |
[email protected] | aab64e0 | 2012-05-03 19:24:16 | [diff] [blame] | 771 | { |
[email protected] | d3ace93 | 2012-08-09 15:39:34 | [diff] [blame] | 772 | "enable-client-oauth-signin", |
| 773 | IDS_FLAGS_ENABLE_CLIENT_OAUTH_SIGNIN_NAME, |
| 774 | IDS_FLAGS_ENABLE_CLIENT_OAUTH_SIGNIN_DESCRIPTION, |
[email protected] | aab64e0 | 2012-05-03 19:24:16 | [diff] [blame] | 775 | kOsMac | kOsWin | kOsLinux, |
[email protected] | d3ace93 | 2012-08-09 15:39:34 | [diff] [blame] | 776 | SINGLE_VALUE_TYPE(switches::kEnableClientOAuthSignin) |
[email protected] | aab64e0 | 2012-05-03 19:24:16 | [diff] [blame] | 777 | }, |
[email protected] | 53520b1b | 2012-05-07 21:43:37 | [diff] [blame] | 778 | #if defined(USE_ASH) |
| 779 | { |
[email protected] | 5544450 | 2012-05-10 15:43:53 | [diff] [blame] | 780 | "show-launcher-alignment-menu", |
| 781 | IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME, |
| 782 | IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION, |
| 783 | kOsAll, |
| 784 | SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu) |
| 785 | }, |
[email protected] | 817ecd1 | 2012-05-16 18:36:53 | [diff] [blame] | 786 | { |
[email protected] | 7307474 | 2012-05-17 01:44:41 | [diff] [blame] | 787 | "show-touch-hud", |
| 788 | IDS_FLAGS_SHOW_TOUCH_HUD_NAME, |
| 789 | IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION, |
| 790 | kOsAll, |
| 791 | SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud) |
| 792 | }, |
| 793 | { |
[email protected] | e154db3 | 2012-06-18 16:20:46 | [diff] [blame] | 794 | "ash-notify-disabled", |
| 795 | IDS_FLAGS_DISABLE_ASH_NOTIFY_NAME, |
| 796 | IDS_FLAGS_DISABLE_ASH_NOTIFY_DESCRIPTION, |
[email protected] | 817ecd1 | 2012-05-16 18:36:53 | [diff] [blame] | 797 | kOsAll, |
[email protected] | e154db3 | 2012-06-18 16:20:46 | [diff] [blame] | 798 | SINGLE_VALUE_TYPE(ash::switches::kAshNotifyDisabled), |
[email protected] | 817ecd1 | 2012-05-16 18:36:53 | [diff] [blame] | 799 | }, |
[email protected] | 9f0940b6 | 2012-05-23 22:56:35 | [diff] [blame] | 800 | { |
| 801 | "enable-pinch", |
| 802 | IDS_FLAGS_ENABLE_PINCH_SCALE_NAME, |
| 803 | IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION, |
| 804 | kOsAll, |
| 805 | SINGLE_VALUE_TYPE(switches::kEnablePinch), |
| 806 | }, |
[email protected] | a837931 | 2012-06-15 00:20:43 | [diff] [blame] | 807 | { |
| 808 | "app-list-show-apps-only", |
| 809 | IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME, |
| 810 | IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION, |
| 811 | kOsAll, |
[email protected] | 0bc6c27 | 2012-07-17 03:32:03 | [diff] [blame] | 812 | SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly), |
[email protected] | a837931 | 2012-06-15 00:20:43 | [diff] [blame] | 813 | }, |
[email protected] | 6aee259 | 2012-06-15 19:51:06 | [diff] [blame] | 814 | { |
[email protected] | 3e4351b | 2012-08-09 04:04:16 | [diff] [blame] | 815 | "ash-extended-desktop-disabled", |
| 816 | IDS_FLAGS_DISABLE_ASH_EXTENDED_DESKTOP_NAME, |
| 817 | IDS_FLAGS_DISABLE_ASH_EXTENDED_DESKTOP_DESCRIPTION, |
[email protected] | 6aee259 | 2012-06-15 19:51:06 | [diff] [blame] | 818 | kOsAll, |
[email protected] | 3e4351b | 2012-08-09 04:04:16 | [diff] [blame] | 819 | SINGLE_VALUE_TYPE(ash::switches::kAshExtendedDesktopDisabled) |
[email protected] | 6aee259 | 2012-06-15 19:51:06 | [diff] [blame] | 820 | }, |
[email protected] | 7307474 | 2012-05-17 01:44:41 | [diff] [blame] | 821 | #endif // defined(USE_ASH) |
[email protected] | ed7b67f3 | 2012-05-28 10:12:28 | [diff] [blame] | 822 | #if defined(OS_CHROMEOS) |
| 823 | { |
[email protected] | a7668a1 | 2012-05-28 22:23:48 | [diff] [blame] | 824 | "experimental-wallpaper-ui", |
| 825 | IDS_FLAGS_EXPERIMENTAL_WALLPAPER_UI_NAME, |
| 826 | IDS_FLAGS_EXPERIMENTAL_WALLPAPER_UI_DESCRIPTION, |
| 827 | kOsCrOS, |
| 828 | SINGLE_VALUE_TYPE(switches::kExperimentalWallpaperUI) |
| 829 | }, |
| 830 | { |
[email protected] | 89821307 | 2012-07-11 02:25:48 | [diff] [blame] | 831 | "enable-drive-v2-api", |
| 832 | IDS_FLAGS_ENABLE_DRIVE_V2_API, |
| 833 | IDS_FLAGS_ENABLE_DRIVE_V2_API_DESCRIPTION, |
| 834 | kOsCrOS, |
| 835 | SINGLE_VALUE_TYPE(switches::kEnableDriveV2Api), |
| 836 | }, |
| 837 | { |
[email protected] | 02a8cb5 | 2012-08-06 22:21:12 | [diff] [blame] | 838 | "use-leveldb-for-gdata", |
| 839 | IDS_FLAGS_USE_LEVELDB_FOR_GDATA_NAME, |
| 840 | IDS_FLAGS_USE_LEVELDB_FOR_GDATA_DESCRIPTION, |
| 841 | kOsCrOS, |
| 842 | SINGLE_VALUE_TYPE(switches::kUseLevelDBForGData), |
| 843 | }, |
| 844 | { |
[email protected] | 89ef5017 | 2012-07-24 21:58:38 | [diff] [blame] | 845 | "disable-html5-camera", |
| 846 | IDS_FLAGS_DISABLE_HTML5_CAMERA, |
| 847 | IDS_FLAGS_DISABLE_HTML5_CAMERA_DESCRIPTION, |
[email protected] | ffc6f7b1 | 2012-07-04 09:11:33 | [diff] [blame] | 848 | kOsCrOS, |
[email protected] | 89ef5017 | 2012-07-24 21:58:38 | [diff] [blame] | 849 | SINGLE_VALUE_TYPE(switches::kDisableHtml5Camera), |
[email protected] | ffc6f7b1 | 2012-07-04 09:11:33 | [diff] [blame] | 850 | }, |
| 851 | { |
[email protected] | e03dc78d | 2012-07-24 08:21:43 | [diff] [blame] | 852 | "disable-new-oobe", |
| 853 | IDS_FLAGS_DISABLE_NEW_OOBE, |
| 854 | IDS_FLAGS_DISABLE_NEW_OOBE_DESCRIPTION, |
[email protected] | ed7b67f3 | 2012-05-28 10:12:28 | [diff] [blame] | 855 | kOsCrOS, |
[email protected] | e03dc78d | 2012-07-24 08:21:43 | [diff] [blame] | 856 | SINGLE_VALUE_TYPE(switches::kDisableNewOobe), |
[email protected] | ed7b67f3 | 2012-05-28 10:12:28 | [diff] [blame] | 857 | }, |
[email protected] | 8b04a165 | 2012-08-04 02:59:49 | [diff] [blame] | 858 | { |
| 859 | "disable-boot-animation", |
| 860 | IDS_FLAGS_DISABLE_BOOT_ANIMATION, |
| 861 | IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION, |
| 862 | kOsCrOS, |
| 863 | SINGLE_VALUE_TYPE(switches::kDisableBootAnimation), |
| 864 | }, |
[email protected] | 9505857 | 2012-08-20 14:57:29 | [diff] [blame] | 865 | { |
| 866 | "enable-workspace2", |
| 867 | IDS_FLAGS_ENABLE_WORKSPACE2, |
| 868 | IDS_FLAGS_ENABLE_WORKSPACE2_DESCRIPTION, |
| 869 | kOsCrOS, |
| 870 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspace2), |
| 871 | }, |
[email protected] | ed7b67f3 | 2012-05-28 10:12:28 | [diff] [blame] | 872 | #endif |
[email protected] | fc7a93c | 2012-06-08 20:25:39 | [diff] [blame] | 873 | { |
| 874 | "enable-views-textfield", |
| 875 | IDS_FLAGS_ENABLE_VIEWS_TEXTFIELD_NAME, |
| 876 | IDS_FLAGS_ENABLE_VIEWS_TEXTFIELD_DESCRIPTION, |
| 877 | kOsWin, |
| 878 | SINGLE_VALUE_TYPE(switches::kEnableViewsTextfield), |
| 879 | }, |
[email protected] | bd0cd3bb | 2012-06-14 03:03:38 | [diff] [blame] | 880 | { |
[email protected] | ef41b7ee | 2012-07-24 19:10:41 | [diff] [blame] | 881 | "old-checkbox-style", |
| 882 | IDS_FLAGS_OLD_CHECKBOX_STYLE, |
| 883 | IDS_FLAGS_OLD_CHECKBOX_STYLE_DESCRIPTION, |
| 884 | kOsLinux | kOsCrOS, |
| 885 | SINGLE_VALUE_TYPE(switches::kOldCheckboxStyle), |
| 886 | }, |
| 887 | { |
[email protected] | fcb88de | 2012-07-12 22:25:32 | [diff] [blame] | 888 | "enable-frameless-constrained-dialogs", |
| 889 | IDS_FLAGS_ENABLE_FRAMELESS_DIALOG_NAME, |
| 890 | IDS_FLAGS_ENABLE_FRAMELESS_DIALOG_DESCRIPTION, |
| 891 | kOsWin | kOsCrOS, |
| 892 | SINGLE_VALUE_TYPE(switches::kEnableFramelessConstrainedDialogs), |
| 893 | }, |
| 894 | { |
[email protected] | 2faeaabd | 2012-06-15 01:05:02 | [diff] [blame] | 895 | "disable-non-fullscreen-mouse-lock", |
| 896 | IDS_FLAGS_DISABLE_NON_FULLSCREEN_MOUSE_LOCK_NAME, |
| 897 | IDS_FLAGS_DISABLE_NON_FULLSCREEN_MOUSE_LOCK_DESCRIPTION, |
| 898 | kOsAll, |
| 899 | SINGLE_VALUE_TYPE(switches::kDisableNonFullscreenMouseLock), |
| 900 | }, |
[email protected] | 7057b3e | 2012-06-18 19:19:16 | [diff] [blame] | 901 | #if defined(OS_CHROMEOS) |
| 902 | { |
| 903 | "enable-unsupported-bluetooth-devices", |
| 904 | IDS_FLAGS_UNSUPPORTED_BLUETOOTH_DEVICES_NAME, |
| 905 | IDS_FLAGS_UNSUPPORTED_BLUETOOTH_DEVICES_DESCRIPTION, |
| 906 | kOsCrOS, |
| 907 | SINGLE_VALUE_TYPE(switches::kEnableUnsupportedBluetoothDevices) |
| 908 | }, |
| 909 | #endif |
[email protected] | 7db8893a | 2012-07-26 00:49:40 | [diff] [blame] | 910 | { "disable-accelerated-video-decode", |
| 911 | IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME, |
| 912 | IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION, |
[email protected] | 66dcb049 | 2012-06-18 22:32:15 | [diff] [blame] | 913 | kOsAll, |
[email protected] | 7db8893a | 2012-07-26 00:49:40 | [diff] [blame] | 914 | SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode), |
[email protected] | 66dcb049 | 2012-06-18 22:32:15 | [diff] [blame] | 915 | }, |
[email protected] | 66ae9fc | 2012-06-19 21:33:52 | [diff] [blame] | 916 | #if defined(USE_ASH) |
| 917 | { |
| 918 | "ash-debug-shortcuts", |
| 919 | IDS_FLAGS_DEBUG_SHORTCUTS_NAME, |
| 920 | IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION, |
| 921 | kOsAll, |
| 922 | SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts), |
| 923 | }, |
| 924 | #endif |
[email protected] | 37fee094 | 2012-08-07 21:07:45 | [diff] [blame] | 925 | { |
| 926 | "enable-website-settings", // FLAGS:RECORD_UMA |
| 927 | IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME, |
| 928 | IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION, |
| 929 | kOsAll, |
| 930 | SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettings), |
| 931 | }, |
[email protected] | a0e4b07 | 2011-08-17 01:47:07 | [diff] [blame] | 932 | }; |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 933 | |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 934 | const Experiment* experiments = kExperiments; |
| 935 | size_t num_experiments = arraysize(kExperiments); |
| 936 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 937 | // Stores and encapsulates the little state that about:flags has. |
| 938 | class FlagsState { |
| 939 | public: |
| 940 | FlagsState() : needs_restart_(false) {} |
| 941 | void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line); |
| 942 | bool IsRestartNeededToCommitChanges(); |
| 943 | void SetExperimentEnabled( |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 944 | PrefService* prefs, const std::string& internal_name, bool enable); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 945 | void RemoveFlagsSwitches( |
| 946 | std::map<std::string, CommandLine::StringType>* switch_list); |
| 947 | void reset(); |
| 948 | |
| 949 | // Returns the singleton instance of this class |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 950 | static FlagsState* GetInstance() { |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 951 | return Singleton<FlagsState>::get(); |
| 952 | } |
| 953 | |
| 954 | private: |
| 955 | bool needs_restart_; |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 956 | std::map<std::string, std::string> flags_switches_; |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 957 | |
| 958 | DISALLOW_COPY_AND_ASSIGN(FlagsState); |
| 959 | }; |
| 960 | |
[email protected] | c7b7800a | 2010-10-07 18:51:35 | [diff] [blame] | 961 | // Extracts the list of enabled lab experiments from preferences and stores them |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 962 | // in a set. |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 963 | void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) { |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 964 | const ListValue* enabled_experiments = prefs->GetList( |
| 965 | prefs::kEnabledLabsExperiments); |
| 966 | if (!enabled_experiments) |
| 967 | return; |
| 968 | |
| 969 | for (ListValue::const_iterator it = enabled_experiments->begin(); |
| 970 | it != enabled_experiments->end(); |
| 971 | ++it) { |
| 972 | std::string experiment_name; |
| 973 | if (!(*it)->GetAsString(&experiment_name)) { |
| 974 | LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments; |
| 975 | continue; |
| 976 | } |
| 977 | result->insert(experiment_name); |
| 978 | } |
| 979 | } |
| 980 | |
| 981 | // Takes a set of enabled lab experiments |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 982 | void SetEnabledFlags( |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 983 | PrefService* prefs, const std::set<std::string>& enabled_experiments) { |
[email protected] | 1bc7842 | 2011-03-31 08:41:38 | [diff] [blame] | 984 | ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments); |
| 985 | ListValue* experiments_list = update.Get(); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 986 | |
| 987 | experiments_list->Clear(); |
| 988 | for (std::set<std::string>::const_iterator it = enabled_experiments.begin(); |
| 989 | it != enabled_experiments.end(); |
| 990 | ++it) { |
| 991 | experiments_list->Append(new StringValue(*it)); |
| 992 | } |
| 993 | } |
| 994 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 995 | // Returns the name used in prefs for the choice at the specified index. |
| 996 | std::string NameForChoice(const Experiment& e, int index) { |
[email protected] | 2ce9c8975 | 2011-02-25 18:24:34 | [diff] [blame] | 997 | DCHECK_EQ(Experiment::MULTI_VALUE, e.type); |
| 998 | DCHECK_LT(index, e.num_choices); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 999 | return std::string(e.internal_name) + about_flags::testing::kMultiSeparator + |
| 1000 | base::IntToString(index); |
| 1001 | } |
| 1002 | |
| 1003 | // Adds the internal names for the specified experiment to |names|. |
| 1004 | void AddInternalName(const Experiment& e, std::set<std::string>* names) { |
| 1005 | if (e.type == Experiment::SINGLE_VALUE) { |
| 1006 | names->insert(e.internal_name); |
| 1007 | } else { |
[email protected] | 2ce9c8975 | 2011-02-25 18:24:34 | [diff] [blame] | 1008 | DCHECK_EQ(Experiment::MULTI_VALUE, e.type); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1009 | for (int i = 0; i < e.num_choices; ++i) |
| 1010 | names->insert(NameForChoice(e, i)); |
| 1011 | } |
| 1012 | } |
| 1013 | |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1014 | // Confirms that an experiment is valid, used in a DCHECK in |
| 1015 | // SanitizeList below. |
| 1016 | bool ValidateExperiment(const Experiment& e) { |
| 1017 | switch (e.type) { |
| 1018 | case Experiment::SINGLE_VALUE: |
| 1019 | DCHECK_EQ(0, e.num_choices); |
| 1020 | DCHECK(!e.choices); |
| 1021 | break; |
| 1022 | case Experiment::MULTI_VALUE: |
| 1023 | DCHECK_GT(e.num_choices, 0); |
| 1024 | DCHECK(e.choices); |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1025 | DCHECK(e.choices[0].command_line_switch); |
| 1026 | DCHECK_EQ('\0', e.choices[0].command_line_switch[0]); |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1027 | break; |
| 1028 | default: |
| 1029 | NOTREACHED(); |
| 1030 | } |
| 1031 | return true; |
| 1032 | } |
| 1033 | |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1034 | // Removes all experiments from prefs::kEnabledLabsExperiments that are |
| 1035 | // unknown, to prevent this list to become very long as experiments are added |
| 1036 | // and removed. |
| 1037 | void SanitizeList(PrefService* prefs) { |
| 1038 | std::set<std::string> known_experiments; |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1039 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1040 | DCHECK(ValidateExperiment(experiments[i])); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1041 | AddInternalName(experiments[i], &known_experiments); |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1042 | } |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1043 | |
| 1044 | std::set<std::string> enabled_experiments; |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1045 | GetEnabledFlags(prefs, &enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1046 | |
| 1047 | std::set<std::string> new_enabled_experiments; |
| 1048 | std::set_intersection( |
| 1049 | known_experiments.begin(), known_experiments.end(), |
| 1050 | enabled_experiments.begin(), enabled_experiments.end(), |
| 1051 | std::inserter(new_enabled_experiments, new_enabled_experiments.begin())); |
| 1052 | |
[email protected] | 4c8853f | 2012-07-23 01:29:16 | [diff] [blame] | 1053 | if (new_enabled_experiments != enabled_experiments) |
| 1054 | SetEnabledFlags(prefs, new_enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1055 | } |
| 1056 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1057 | void GetSanitizedEnabledFlags( |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1058 | PrefService* prefs, std::set<std::string>* result) { |
| 1059 | SanitizeList(prefs); |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1060 | GetEnabledFlags(prefs, result); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1061 | } |
| 1062 | |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1063 | // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't |
| 1064 | // enabled on the current platform. |
| 1065 | void GetSanitizedEnabledFlagsForCurrentPlatform( |
| 1066 | PrefService* prefs, std::set<std::string>* result) { |
| 1067 | GetSanitizedEnabledFlags(prefs, result); |
| 1068 | |
| 1069 | // Filter out any experiments that aren't enabled on the current platform. We |
| 1070 | // don't remove these from prefs else syncing to a platform with a different |
| 1071 | // set of experiments would be lossy. |
| 1072 | std::set<std::string> platform_experiments; |
| 1073 | int current_platform = GetCurrentPlatform(); |
| 1074 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1075 | if (experiments[i].supported_platforms & current_platform) |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1076 | AddInternalName(experiments[i], &platform_experiments); |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1077 | } |
| 1078 | |
| 1079 | std::set<std::string> new_enabled_experiments; |
| 1080 | std::set_intersection( |
| 1081 | platform_experiments.begin(), platform_experiments.end(), |
| 1082 | result->begin(), result->end(), |
| 1083 | std::inserter(new_enabled_experiments, new_enabled_experiments.begin())); |
| 1084 | |
| 1085 | result->swap(new_enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1086 | } |
| 1087 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1088 | // Returns the Value representing the choice data in the specified experiment. |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1089 | Value* CreateChoiceData(const Experiment& experiment, |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1090 | const std::set<std::string>& enabled_experiments) { |
[email protected] | 2ce9c8975 | 2011-02-25 18:24:34 | [diff] [blame] | 1091 | DCHECK_EQ(Experiment::MULTI_VALUE, experiment.type); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1092 | ListValue* result = new ListValue; |
| 1093 | for (int i = 0; i < experiment.num_choices; ++i) { |
| 1094 | const Experiment::Choice& choice = experiment.choices[i]; |
| 1095 | DictionaryValue* value = new DictionaryValue; |
| 1096 | std::string name = NameForChoice(experiment, i); |
| 1097 | value->SetString("description", |
| 1098 | l10n_util::GetStringUTF16(choice.description_id)); |
| 1099 | value->SetString("internal_name", name); |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1100 | value->SetBoolean("selected", enabled_experiments.count(name) > 0); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1101 | result->Append(value); |
| 1102 | } |
| 1103 | return result; |
| 1104 | } |
| 1105 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1106 | } // namespace |
| 1107 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1108 | void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) { |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1109 | FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1110 | } |
| 1111 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1112 | ListValue* GetFlagsExperimentsData(PrefService* prefs) { |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1113 | std::set<std::string> enabled_experiments; |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1114 | GetSanitizedEnabledFlags(prefs, &enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1115 | |
| 1116 | int current_platform = GetCurrentPlatform(); |
| 1117 | |
| 1118 | ListValue* experiments_data = new ListValue(); |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1119 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1120 | const Experiment& experiment = experiments[i]; |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1121 | |
| 1122 | DictionaryValue* data = new DictionaryValue(); |
| 1123 | data->SetString("internal_name", experiment.internal_name); |
| 1124 | data->SetString("name", |
| 1125 | l10n_util::GetStringUTF16(experiment.visible_name_id)); |
| 1126 | data->SetString("description", |
| 1127 | l10n_util::GetStringUTF16( |
| 1128 | experiment.visible_description_id)); |
[email protected] | cc3e205 | 2011-12-20 01:01:40 | [diff] [blame] | 1129 | bool supported = !!(experiment.supported_platforms & current_platform); |
| 1130 | data->SetBoolean("supported", supported); |
| 1131 | |
| 1132 | ListValue* supported_platforms = new ListValue(); |
| 1133 | AddOsStrings(experiment.supported_platforms, supported_platforms); |
| 1134 | data->Set("supported_platforms", supported_platforms); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1135 | |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1136 | switch (experiment.type) { |
| 1137 | case Experiment::SINGLE_VALUE: |
| 1138 | data->SetBoolean( |
| 1139 | "enabled", |
| 1140 | enabled_experiments.count(experiment.internal_name) > 0); |
| 1141 | break; |
| 1142 | case Experiment::MULTI_VALUE: |
| 1143 | data->Set("choices", CreateChoiceData(experiment, enabled_experiments)); |
| 1144 | break; |
| 1145 | default: |
| 1146 | NOTREACHED(); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1147 | } |
| 1148 | |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1149 | experiments_data->Append(data); |
| 1150 | } |
| 1151 | return experiments_data; |
| 1152 | } |
| 1153 | |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1154 | bool IsRestartNeededToCommitChanges() { |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1155 | return FlagsState::GetInstance()->IsRestartNeededToCommitChanges(); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1156 | } |
| 1157 | |
| 1158 | void SetExperimentEnabled( |
[email protected] | c7b7800a | 2010-10-07 18:51:35 | [diff] [blame] | 1159 | PrefService* prefs, const std::string& internal_name, bool enable) { |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1160 | FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1161 | } |
| 1162 | |
| 1163 | void RemoveFlagsSwitches( |
| 1164 | std::map<std::string, CommandLine::StringType>* switch_list) { |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1165 | FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1166 | } |
| 1167 | |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1168 | int GetCurrentPlatform() { |
| 1169 | #if defined(OS_MACOSX) |
| 1170 | return kOsMac; |
| 1171 | #elif defined(OS_WIN) |
| 1172 | return kOsWin; |
| 1173 | #elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check. |
| 1174 | return kOsCrOS; |
[email protected] | c92f4ed | 2011-10-21 19:50:21 | [diff] [blame] | 1175 | #elif defined(OS_LINUX) || defined(OS_OPENBSD) |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1176 | return kOsLinux; |
[email protected] | 9c7453d | 2012-01-21 00:45:40 | [diff] [blame] | 1177 | #elif defined(OS_ANDROID) |
| 1178 | return kOsAndroid; |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1179 | #else |
| 1180 | #error Unknown platform |
| 1181 | #endif |
| 1182 | } |
| 1183 | |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 1184 | void RecordUMAStatistics(const PrefService* prefs) { |
| 1185 | std::set<std::string> flags; |
| 1186 | GetEnabledFlags(prefs, &flags); |
| 1187 | for (std::set<std::string>::iterator it = flags.begin(); it != flags.end(); |
| 1188 | ++it) { |
| 1189 | std::string action("AboutFlags_"); |
| 1190 | action += *it; |
[email protected] | 7f6f44c | 2011-12-14 13:23:38 | [diff] [blame] | 1191 | content::RecordComputedAction(action); |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 1192 | } |
| 1193 | // Since flag metrics are recorded every startup, add a tick so that the |
| 1194 | // stats can be made meaningful. |
| 1195 | if (flags.size()) |
[email protected] | 7f6f44c | 2011-12-14 13:23:38 | [diff] [blame] | 1196 | content::RecordAction(UserMetricsAction("AboutFlags_StartupTick")); |
| 1197 | content::RecordAction(UserMetricsAction("StartupTick")); |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 1198 | } |
| 1199 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1200 | ////////////////////////////////////////////////////////////////////////////// |
| 1201 | // FlagsState implementation. |
| 1202 | |
| 1203 | namespace { |
| 1204 | |
| 1205 | void FlagsState::ConvertFlagsToSwitches( |
| 1206 | PrefService* prefs, CommandLine* command_line) { |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1207 | if (command_line->HasSwitch(switches::kNoExperiments)) |
| 1208 | return; |
| 1209 | |
| 1210 | std::set<std::string> enabled_experiments; |
[email protected] | ba816424 | 2010-11-16 21:31:00 | [diff] [blame] | 1211 | |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1212 | GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1213 | |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1214 | typedef std::map<std::string, std::pair<std::string, std::string> > |
| 1215 | NameToSwitchAndValueMap; |
| 1216 | NameToSwitchAndValueMap name_to_switch_map; |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1217 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1218 | const Experiment& e = experiments[i]; |
| 1219 | if (e.type == Experiment::SINGLE_VALUE) { |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1220 | name_to_switch_map[e.internal_name] = |
| 1221 | std::pair<std::string, std::string>(e.command_line_switch, |
| 1222 | e.command_line_value); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1223 | } else { |
| 1224 | for (int j = 0; j < e.num_choices; ++j) |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1225 | name_to_switch_map[NameForChoice(e, j)] = |
| 1226 | std::pair<std::string, std::string>( |
| 1227 | e.choices[j].command_line_switch, |
| 1228 | e.choices[j].command_line_value); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1229 | } |
| 1230 | } |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1231 | |
| 1232 | command_line->AppendSwitch(switches::kFlagSwitchesBegin); |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1233 | flags_switches_.insert( |
| 1234 | std::pair<std::string, std::string>(switches::kFlagSwitchesBegin, |
| 1235 | std::string())); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1236 | for (std::set<std::string>::iterator it = enabled_experiments.begin(); |
| 1237 | it != enabled_experiments.end(); |
| 1238 | ++it) { |
| 1239 | const std::string& experiment_name = *it; |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1240 | NameToSwitchAndValueMap::const_iterator name_to_switch_it = |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1241 | name_to_switch_map.find(experiment_name); |
| 1242 | if (name_to_switch_it == name_to_switch_map.end()) { |
| 1243 | NOTREACHED(); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1244 | continue; |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1245 | } |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1246 | |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1247 | const std::pair<std::string, std::string>& |
| 1248 | switch_and_value_pair = name_to_switch_it->second; |
| 1249 | |
| 1250 | command_line->AppendSwitchASCII(switch_and_value_pair.first, |
| 1251 | switch_and_value_pair.second); |
| 1252 | flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second; |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1253 | } |
| 1254 | command_line->AppendSwitch(switches::kFlagSwitchesEnd); |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1255 | flags_switches_.insert( |
| 1256 | std::pair<std::string, std::string>(switches::kFlagSwitchesEnd, |
| 1257 | std::string())); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1258 | } |
| 1259 | |
| 1260 | bool FlagsState::IsRestartNeededToCommitChanges() { |
| 1261 | return needs_restart_; |
| 1262 | } |
| 1263 | |
| 1264 | void FlagsState::SetExperimentEnabled( |
| 1265 | PrefService* prefs, const std::string& internal_name, bool enable) { |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1266 | needs_restart_ = true; |
| 1267 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1268 | size_t at_index = internal_name.find(about_flags::testing::kMultiSeparator); |
| 1269 | if (at_index != std::string::npos) { |
| 1270 | DCHECK(enable); |
| 1271 | // We're being asked to enable a multi-choice experiment. Disable the |
| 1272 | // currently selected choice. |
| 1273 | DCHECK_NE(at_index, 0u); |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1274 | const std::string experiment_name = internal_name.substr(0, at_index); |
| 1275 | SetExperimentEnabled(prefs, experiment_name, false); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1276 | |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1277 | // And enable the new choice, if it is not the default first choice. |
| 1278 | if (internal_name != experiment_name + "@0") { |
| 1279 | std::set<std::string> enabled_experiments; |
| 1280 | GetSanitizedEnabledFlags(prefs, &enabled_experiments); |
| 1281 | enabled_experiments.insert(internal_name); |
| 1282 | SetEnabledFlags(prefs, enabled_experiments); |
| 1283 | } |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1284 | return; |
| 1285 | } |
| 1286 | |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1287 | std::set<std::string> enabled_experiments; |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1288 | GetSanitizedEnabledFlags(prefs, &enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1289 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1290 | const Experiment* e = NULL; |
| 1291 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1292 | if (experiments[i].internal_name == internal_name) { |
| 1293 | e = experiments + i; |
| 1294 | break; |
| 1295 | } |
| 1296 | } |
| 1297 | DCHECK(e); |
| 1298 | |
| 1299 | if (e->type == Experiment::SINGLE_VALUE) { |
[email protected] | 8a271368 | 2011-08-19 10:36:59 | [diff] [blame] | 1300 | if (enable) |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1301 | enabled_experiments.insert(internal_name); |
[email protected] | 8a271368 | 2011-08-19 10:36:59 | [diff] [blame] | 1302 | else |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1303 | enabled_experiments.erase(internal_name); |
| 1304 | } else { |
| 1305 | if (enable) { |
| 1306 | // Enable the first choice. |
| 1307 | enabled_experiments.insert(NameForChoice(*e, 0)); |
| 1308 | } else { |
| 1309 | // Find the currently enabled choice and disable it. |
| 1310 | for (int i = 0; i < e->num_choices; ++i) { |
| 1311 | std::string choice_name = NameForChoice(*e, i); |
| 1312 | if (enabled_experiments.find(choice_name) != |
| 1313 | enabled_experiments.end()) { |
| 1314 | enabled_experiments.erase(choice_name); |
| 1315 | // Continue on just in case there's a bug and more than one |
| 1316 | // experiment for this choice was enabled. |
| 1317 | } |
| 1318 | } |
| 1319 | } |
| 1320 | } |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1321 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1322 | SetEnabledFlags(prefs, enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1323 | } |
| 1324 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1325 | void FlagsState::RemoveFlagsSwitches( |
| 1326 | std::map<std::string, CommandLine::StringType>* switch_list) { |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1327 | for (std::map<std::string, std::string>::const_iterator |
| 1328 | it = flags_switches_.begin(); it != flags_switches_.end(); ++it) { |
| 1329 | switch_list->erase(it->first); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1330 | } |
| 1331 | } |
| 1332 | |
| 1333 | void FlagsState::reset() { |
| 1334 | needs_restart_ = false; |
| 1335 | flags_switches_.clear(); |
| 1336 | } |
| 1337 | |
[email protected] | 38e4681 | 2011-05-09 20:49:22 | [diff] [blame] | 1338 | } // namespace |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1339 | |
| 1340 | namespace testing { |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1341 | |
| 1342 | // WARNING: '@' is also used in the html file. If you update this constant you |
| 1343 | // also need to update the html file. |
| 1344 | const char kMultiSeparator[] = "@"; |
| 1345 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1346 | void ClearState() { |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1347 | FlagsState::GetInstance()->reset(); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1348 | } |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1349 | |
| 1350 | void SetExperiments(const Experiment* e, size_t count) { |
| 1351 | if (!e) { |
| 1352 | experiments = kExperiments; |
| 1353 | num_experiments = arraysize(kExperiments); |
| 1354 | } else { |
| 1355 | experiments = e; |
| 1356 | num_experiments = count; |
| 1357 | } |
| 1358 | } |
| 1359 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1360 | const Experiment* GetExperiments(size_t* count) { |
| 1361 | *count = num_experiments; |
| 1362 | return experiments; |
| 1363 | } |
| 1364 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1365 | } // namespace testing |
| 1366 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1367 | } // namespace about_flags |