blob: b3e4723af89fea3d8423f176daa6f64da0864337 [file] [log] [blame]
[email protected]3828d6f2011-02-24 18:32:211// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]ad2a3ded2010-08-27 13:19:052// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]1a47d7e2010-10-15 00:37:245#include "chrome/browser/about_flags.h"
[email protected]ad2a3ded2010-08-27 13:19:056
7#include <algorithm>
8#include <iterator>
9#include <map>
10#include <set>
11
[email protected]ad2a3ded2010-08-27 13:19:0512#include "base/command_line.h"
[email protected]3b63f8f42011-03-28 01:54:1513#include "base/memory/singleton.h"
[email protected]8a6ff28d2010-12-02 16:35:1914#include "base/string_number_conversions.h"
[email protected]d208f4d82011-05-23 21:52:0315#include "base/utf_string_conversions.h"
[email protected]ad2a3ded2010-08-27 13:19:0516#include "base/values.h"
[email protected]ad2a3ded2010-08-27 13:19:0517#include "chrome/browser/prefs/pref_service.h"
[email protected]1bc78422011-03-31 08:41:3818#include "chrome/browser/prefs/scoped_user_pref_update.h"
[email protected]d208f4d82011-05-23 21:52:0319#include "chrome/common/chrome_content_client.h"
[email protected]ad2a3ded2010-08-27 13:19:0520#include "chrome/common/chrome_switches.h"
21#include "chrome/common/pref_names.h"
[email protected]afd1e522011-04-27 23:29:5922#include "content/browser/user_metrics.h"
[email protected]deaba6d52011-09-23 14:47:1223#include "content/common/content_switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0524#include "grit/generated_resources.h"
[email protected]c051a1b2011-01-21 23:30:1725#include "ui/base/l10n/l10n_util.h"
[email protected]8ff7f342011-05-25 01:49:4726#include "ui/gfx/gl/gl_switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0527
[email protected]1a47d7e2010-10-15 00:37:2428namespace about_flags {
[email protected]ad2a3ded2010-08-27 13:19:0529
[email protected]8a6ff28d2010-12-02 16:35:1930// Macros to simplify specifying the type.
[email protected]a82744532011-02-11 16:15:5331#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
32 Experiment::SINGLE_VALUE, command_line_switch, switch_value, NULL, 0
33#define SINGLE_VALUE_TYPE(command_line_switch) \
34 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
35#define MULTI_VALUE_TYPE(choices) \
[email protected]0e6f56d2011-02-12 23:45:1536 Experiment::MULTI_VALUE, "", "", choices, arraysize(choices)
[email protected]8a6ff28d2010-12-02 16:35:1937
[email protected]e2ddbc92010-10-15 20:02:0738namespace {
39
[email protected]a314ee5a2010-10-26 21:23:2840const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS;
[email protected]ad2a3ded2010-08-27 13:19:0541
[email protected]ba8164242010-11-16 21:31:0042// Names for former Chrome OS Labs experiments, shared with prefs migration
43// code.
44const char kMediaPlayerExperimentName[] = "media-player";
45const char kAdvancedFileSystemExperimentName[] = "advanced-file-system";
46const char kVerticalTabsExperimentName[] = "vertical-tabs";
47
[email protected]4bc5050c2010-11-18 17:55:5448// RECORDING USER METRICS FOR FLAGS:
49// -----------------------------------------------------------------------------
50// The first line of the experiment is the internal name. If you'd like to
51// gather statistics about the usage of your flag, you should append a marker
52// comment to the end of the feature name, like so:
53// "my-special-feature", // FLAGS:RECORD_UMA
54//
55// After doing that, run //chrome/tools/extract_actions.py (see instructions at
56// the top of that file for details) to update the chromeactions.txt file, which
57// will enable UMA to record your feature flag.
58//
59// After your feature has shipped under a flag, you can locate the metrics
60// under the action name AboutFlags_internal-action-name. Actions are recorded
61// once per startup, so you should divide this number by AboutFlags_StartupTick
62// to get a sense of usage. Note that this will not be the same as number of
63// users with a given feature enabled because users can quit and relaunch
64// the application multiple times over a given time interval.
65// TODO(rsesek): See if there's a way to count per-user, rather than
66// per-startup.
67
[email protected]8a6ff28d2010-12-02 16:35:1968// To add a new experiment add to the end of kExperiments. There are two
69// distinct types of experiments:
70// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
71// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:2272// . MULTI_VALUE: a list of choices, the first of which should correspond to a
73// deactivated state for this lab (i.e. no command line option). To specify
74// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
75// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:1976// See the documentation of Experiment for details on the fields.
77//
78// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:0579const Experiment kExperiments[] = {
80 {
[email protected]aac169d2011-03-18 19:53:0381 "expose-for-tabs", // FLAGS:RECORD_UMA
82 IDS_FLAGS_TABPOSE_NAME,
83 IDS_FLAGS_TABPOSE_DESCRIPTION,
84 kOsMac,
85#if defined(OS_MACOSX)
86 // The switch exists only on OS X.
87 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
88#else
89 SINGLE_VALUE_TYPE("")
90#endif
91 },
92 {
[email protected]4bc5050c2010-11-18 17:55:5493 "vertical-tabs", // FLAGS:RECORD_UMA
[email protected]9486c1f2010-10-14 19:52:1294 IDS_FLAGS_SIDE_TABS_NAME,
95 IDS_FLAGS_SIDE_TABS_DESCRIPTION,
[email protected]ba8164242010-11-16 21:31:0096 kOsWin | kOsCrOS,
[email protected]8a6ff28d2010-12-02 16:35:1997 SINGLE_VALUE_TYPE(switches::kEnableVerticalTabs)
[email protected]654151872010-09-13 22:43:0598 },
99 {
[email protected]4bc5050c2010-11-18 17:55:54100 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05101 IDS_FLAGS_CONFLICTS_CHECK_NAME,
102 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
103 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19104 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05105 },
106 {
[email protected]4bc5050c2010-11-18 17:55:54107 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]9486c1f2010-10-14 19:52:12108 IDS_FLAGS_CLOUD_PRINT_PROXY_NAME,
109 IDS_FLAGS_CLOUD_PRINT_PROXY_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45110 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22111 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31112 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22113 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
114 // always have PDF rasterization available, so no flag needed there.
115#if !defined(GOOGLE_CHROME_BUILD)
116 kOsWin,
117#else
118 0,
[email protected]fa6d2a2f2010-11-30 21:47:19119#endif
[email protected]8a6ff28d2010-12-02 16:35:19120 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42121 },
[email protected]580939a2010-10-12 18:54:37122 {
[email protected]bb461532010-11-26 21:50:23123 "crxless-web-apps",
124 IDS_FLAGS_CRXLESS_WEB_APPS_NAME,
125 IDS_FLAGS_CRXLESS_WEB_APPS_DESCRIPTION,
126 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19127 SINGLE_VALUE_TYPE(switches::kEnableCrxlessWebApps)
[email protected]bb461532010-11-26 21:50:23128 },
129 {
[email protected]f72d0c62011-08-31 16:27:44130 "lazy-background-pages",
131 IDS_FLAGS_LAZY_BACKGROUND_PAGES_NAME,
132 IDS_FLAGS_LAZY_BACKGROUND_PAGES_DESCRIPTION,
133 kOsAll,
134 SINGLE_VALUE_TYPE(switches::kEnableLazyBackgroundPages)
135 },
136 {
[email protected]96c6f4c2011-05-18 19:36:22137 "ignore-gpu-blacklist",
138 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
139 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
140 kOsAll,
141 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
142 },
143 {
[email protected]0110cf112011-07-02 00:39:43144 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22145 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
146 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
147 kOsAll,
148 SINGLE_VALUE_TYPE(switches::kForceCompositingMode)
149 },
150 {
[email protected]5963b772011-02-09 22:55:38151 "composited-layer-borders",
152 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
153 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
154 kOsAll,
155 SINGLE_VALUE_TYPE(switches::kShowCompositedLayerBorders)
156 },
157 {
[email protected]a8f1eaa2011-03-07 19:00:58158 "show-fps-counter",
159 IDS_FLAGS_SHOW_FPS_COUNTER,
160 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
161 kOsAll,
162 SINGLE_VALUE_TYPE(switches::kShowFPSCounter)
163 },
[email protected]8ff7f342011-05-25 01:49:47164 {
165 "disable-gpu-vsync",
166 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
167 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
168 kOsAll,
169 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
170 },
[email protected]deaba6d52011-09-23 14:47:12171 {
172 "disable-webgl",
173 IDS_FLAGS_DISABLE_WEBGL_NAME,
174 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
175 kOsAll,
176 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
177 },
[email protected]9de0ec12011-08-24 21:57:50178 // Exposed on all platforms until there is a workaround for easy access to
179 // the native print dialog for users that need it. Once that's done, revert
180 // back to:
181 // Only expose this for Chromium builds where users may not have the PDF
182 // plugin. Do not give Google Chrome users the option to disable it here.
183 // Also expose it for Chrome OS where print preview is still experimental.
[email protected]8d260e52010-10-13 01:03:05184 {
[email protected]4bc5050c2010-11-18 17:55:54185 "print-preview", // FLAGS:RECORD_UMA
[email protected]9486c1f2010-10-14 19:52:12186 IDS_FLAGS_PRINT_PREVIEW_NAME,
187 IDS_FLAGS_PRINT_PREVIEW_DESCRIPTION,
[email protected]b579afd2011-07-13 00:01:27188 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19189 SINGLE_VALUE_TYPE(switches::kEnablePrintPreview)
[email protected]2fe15fcb2010-10-21 20:39:53190 },
[email protected]313bbf5e2011-08-24 03:31:15191 {
192 "cloud-print", // FLAGS:RECORD_UMA
193 IDS_FLAGS_CLOUD_PRINT_NAME,
194 IDS_FLAGS_CLOUD_PRINT_DESCRIPTION,
195 // Define this for all platforms except Chrome OS.
196 // It makes no sense to disable it on Chrome OS.
197 kOsMac | kOsWin | kOsLinux,
198 SINGLE_VALUE_TYPE(switches::kEnableCloudPrint)
199 },
[email protected]d208f4d82011-05-23 21:52:03200 // TODO(dspringer): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53201 {
[email protected]e3791ce92011-08-09 01:03:32202 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40203 IDS_FLAGS_ENABLE_NACL_NAME,
204 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
205 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19206 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40207 },
208 {
[email protected]4bc5050c2010-11-18 17:55:54209 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32210 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
211 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
212 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19213 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32214 },
[email protected]3627b06d2010-11-12 16:36:16215 {
[email protected]cbe224d2011-08-04 22:12:49216 "apps-new-install-bubble",
217 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
218 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
219 kOsAll,
220 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
221 },
222 {
[email protected]4bc5050c2010-11-18 17:55:54223 "click-to-play", // FLAGS:RECORD_UMA
[email protected]3627b06d2010-11-12 16:36:16224 IDS_FLAGS_CLICK_TO_PLAY_NAME,
225 IDS_FLAGS_CLICK_TO_PLAY_DESCRIPTION,
226 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19227 SINGLE_VALUE_TYPE(switches::kEnableClickToPlay)
[email protected]3627b06d2010-11-12 16:36:16228 },
[email protected]80bd24e2010-11-30 09:34:38229 {
230 "disable-hyperlink-auditing",
231 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
232 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
233 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19234 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51235 },
236 {
237 "experimental-location-features", // FLAGS:RECORD_UMA
238 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
239 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
240 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19241 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
242 },
243 {
[email protected]4c6452d2011-01-12 08:47:57244 "block-reading-third-party-cookies",
245 IDS_FLAGS_BLOCK_ALL_THIRD_PARTY_COOKIES_NAME,
246 IDS_FLAGS_BLOCK_ALL_THIRD_PARTY_COOKIES_DESCRIPTION,
247 kOsAll,
248 SINGLE_VALUE_TYPE(switches::kBlockReadingThirdPartyCookies)
249 },
[email protected]04227962011-01-20 02:03:09250 {
251 "disable-interactive-form-validation",
252 IDS_FLAGS_DISABLE_INTERACTIVE_FORM_VALIDATION_NAME,
253 IDS_FLAGS_DISABLE_INTERACTIVE_FORM_VALIDATION_DESCRIPTION,
254 kOsAll,
255 SINGLE_VALUE_TYPE(switches::kDisableInteractiveFormValidation)
256 },
[email protected]8df51192011-01-22 20:05:03257 {
[email protected]07d490bc2011-03-07 17:05:26258 "focus-existing-tab-on-open", // FLAGS:RECORD_UMA
259 IDS_FLAGS_FOCUS_EXISTING_TAB_ON_OPEN_NAME,
260 IDS_FLAGS_FOCUS_EXISTING_TAB_ON_OPEN_DESCRIPTION,
261 kOsAll,
262 SINGLE_VALUE_TYPE(switches::kFocusExistingTabOnOpen)
263 },
[email protected]d5dcfb32011-03-19 00:49:24264 {
[email protected]5aea1862011-03-23 23:55:39265 "tab-groups-context-menu",
266 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
267 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
268 kOsWin,
269 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
270 },
[email protected]e9bf9d92011-03-31 20:57:15271 {
272 "ppapi-flash-in-process",
273 IDS_FLAGS_PPAPI_FLASH_IN_PROCESS_NAME,
274 IDS_FLAGS_PPAPI_FLASH_IN_PROCESS_DESCRIPTION,
[email protected]f2d3ce0d2011-04-01 18:19:30275 kOsAll,
[email protected]e9bf9d92011-03-31 20:57:15276 SINGLE_VALUE_TYPE(switches::kPpapiFlashInProcess)
277 },
[email protected]ce5737142011-04-14 23:35:09278 {
[email protected]20b5df962011-04-18 22:07:43279 "multi-profiles",
280 IDS_FLAGS_MULTI_PROFILES_NAME,
281 IDS_FLAGS_MULTI_PROFILES_DESCRIPTION,
[email protected]5d7a87572011-09-14 22:44:13282 kOsLinux, // This switch is not available in CrOS.
[email protected]20b5df962011-04-18 22:07:43283 SINGLE_VALUE_TYPE(switches::kMultiProfiles)
284 },
[email protected]cc057b02011-04-21 17:19:04285 {
[email protected]08338b862011-05-05 20:22:23286 "restrict-instant-to-search",
287 IDS_FLAGS_RESTRICT_INSTANT_TO_SEARCH_NAME,
288 IDS_FLAGS_RESTRICT_INSTANT_TO_SEARCH_DESCRIPTION,
289 kOsAll,
290 SINGLE_VALUE_TYPE(switches::kRestrictInstantToSearch)
291 },
[email protected]b652fc82011-05-23 07:53:05292 {
[email protected]f2557bd2011-06-01 02:33:07293 "preload-instant-search",
294 IDS_FLAGS_PRELOAD_INSTANT_SEARCH_NAME,
295 IDS_FLAGS_PRELOAD_INSTANT_SEARCH_DESCRIPTION,
296 kOsAll,
297 SINGLE_VALUE_TYPE(switches::kPreloadInstantSearch)
298 },
[email protected]354e33b2011-06-15 00:29:10299 {
300 "static-ip-config",
301 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
302 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
303 kOsCrOS,
304#if defined(OS_CHROMEOS)
305 // This switch exists only on Chrome OS.
306 SINGLE_VALUE_TYPE(switches::kEnableStaticIPConfig)
307#else
308 SINGLE_VALUE_TYPE("")
309#endif
310 },
[email protected]3eb5728c2011-06-20 22:32:24311 {
312 "show-autofill-type-predictions",
313 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
314 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
315 kOsAll,
316 SINGLE_VALUE_TYPE(switches::kShowAutofillTypePredictions)
317 },
[email protected]bff4d3e2011-06-21 23:58:52318 {
[email protected]ebde4ca2011-08-12 10:44:45319 "sync-oauth",
320 IDS_FLAGS_SYNC_OAUTH_NAME,
321 IDS_FLAGS_SYNC_OAUTH_DESCRIPTION,
322 kOsAll,
323 SINGLE_VALUE_TYPE(switches::kEnableSyncOAuth)
324 },
325 {
[email protected]9a6180d7d2011-09-07 01:40:33326 "sync-tabs",
327 IDS_FLAGS_SYNC_TABS_NAME,
328 IDS_FLAGS_SYNC_TABS_DESCRIPTION,
[email protected]5b0ec7f2011-08-11 02:17:17329 kOsAll,
[email protected]9a6180d7d2011-09-07 01:40:33330 SINGLE_VALUE_TYPE(switches::kEnableSyncTabs)
[email protected]5b0ec7f2011-08-11 02:17:17331 },
332 {
[email protected]d9e33092011-09-01 03:34:05333 "sync-search-engines",
334 IDS_FLAGS_SYNC_SEARCH_ENGINES_NAME,
335 IDS_FLAGS_SYNC_SEARCH_ENGINES_DESCRIPTION,
336 kOsAll,
337 SINGLE_VALUE_TYPE(switches::kEnableSyncSearchEngines)
338 },
339 {
[email protected]a22ebd812011-06-23 00:05:39340 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
341 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
342 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
343 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40344 // On by default for the Mac (different implementation in WebKit).
[email protected]a22ebd812011-06-23 00:05:39345#if defined(ENABLE_SMOOTH_SCROLLING)
[email protected]554b7062011-09-03 03:09:40346 kOsWin | kOsLinux | kOsCrOS,
[email protected]a22ebd812011-06-23 00:05:39347#else
348 0,
349#endif
350 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
351 },
[email protected]81a6b0b2011-06-24 17:55:40352 {
[email protected]ae1eb29a2011-08-17 17:50:57353 "prerender-from-omnibox", // FLAGS:RECORD_UMA
[email protected]81a6b0b2011-06-24 17:55:40354 IDS_FLAGS_PRERENDER_FROM_OMNIBOX_NAME,
355 IDS_FLAGS_PRERENDER_FROM_OMNIBOX_DESCRIPTION,
356 kOsAll,
357 SINGLE_VALUE_TYPE(switches::kPrerenderFromOmnibox)
358 },
[email protected]40916632011-07-02 01:11:01359 {
[email protected]73fb1fc52011-07-09 00:06:54360 "panels",
361 IDS_FLAGS_ENABLE_PANELS_NAME,
362 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
363 kOsAll,
364 SINGLE_VALUE_TYPE(switches::kEnablePanels)
365 },
[email protected]e3749d12011-07-25 22:22:12366 {
367 "enable-shortcuts-provider",
368 IDS_FLAGS_ENABLE_SHORTCUTS_PROVIDER,
369 IDS_FLAGS_ENABLE_SHORTCUTS_PROVIDER_DESCRIPTION,
370 kOsAll,
371 SINGLE_VALUE_TYPE(switches::kEnableShortcutsProvider)
372 },
[email protected]1a2966b92011-08-09 06:50:19373#if defined(OS_CHROMEOS)
374 {
[email protected]35d16db2011-08-26 00:13:12375 "enable-archives",
376 IDS_FILE_BROWSER_MOUNT_ARCHIVE,
377 IDS_FILE_MANAGER,
378 kOsCrOS,
379 SINGLE_VALUE_TYPE(switches::kEnableArchives)
380 },
[email protected]1a2966b92011-08-09 06:50:19381#endif
[email protected]80eb4262011-08-03 16:10:41382 {
383 "memory-widget",
384 IDS_FLAGS_MEMORY_WIDGET_NAME,
385 IDS_FLAGS_MEMORY_WIDGET_DESCRIPTION,
386 kOsCrOS,
387#if defined(OS_CHROMEOS)
388 // This switch exists only on Chrome OS.
389 SINGLE_VALUE_TYPE(switches::kMemoryWidget)
390#else
391 SINGLE_VALUE_TYPE("")
392#endif
[email protected]a0e4b072011-08-17 01:47:07393 },
[email protected]6ec18e62011-09-10 00:28:18394#if defined(TOUCH_UI)
395 {
396 "touchui-views-desktop",
397 IDS_FLAGS_DISABLE_VIEWS_DESKTOP_NAME,
398 IDS_FLAGS_DISABLE_VIEWS_DESKTOP_DESCRIPTION,
399 kOsCrOS,
400 SINGLE_VALUE_TYPE_AND_VALUE(switches::kViewsDesktop, "disabled")
401 },
402#endif
[email protected]a0e4b072011-08-17 01:47:07403 {
404 "downloads-new-ui", // FLAGS:RECORD_UMA
405 IDS_FLAGS_DOWNLOADS_NEW_UI_NAME,
406 IDS_FLAGS_DOWNLOADS_NEW_UI_DESCRIPTION,
407 kOsAll,
408 SINGLE_VALUE_TYPE(switches::kDownloadsNewUI)
409 },
[email protected]b7bb44f2011-09-01 05:17:03410 {
411 "enable-autologin",
412 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
413 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
414 kOsMac | kOsWin | kOsLinux,
415 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
416 },
[email protected]a0e4b072011-08-17 01:47:07417};
[email protected]ad2a3ded2010-08-27 13:19:05418
[email protected]a314ee5a2010-10-26 21:23:28419const Experiment* experiments = kExperiments;
420size_t num_experiments = arraysize(kExperiments);
421
[email protected]e2ddbc92010-10-15 20:02:07422// Stores and encapsulates the little state that about:flags has.
423class FlagsState {
424 public:
425 FlagsState() : needs_restart_(false) {}
426 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
427 bool IsRestartNeededToCommitChanges();
428 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:28429 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:07430 void RemoveFlagsSwitches(
431 std::map<std::string, CommandLine::StringType>* switch_list);
432 void reset();
433
434 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:55435 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:07436 return Singleton<FlagsState>::get();
437 }
438
439 private:
440 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:53441 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:07442
443 DISALLOW_COPY_AND_ASSIGN(FlagsState);
444};
445
[email protected]c7b7800a2010-10-07 18:51:35446// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]ad2a3ded2010-08-27 13:19:05447// in a set.
[email protected]1a47d7e2010-10-15 00:37:24448void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:05449 const ListValue* enabled_experiments = prefs->GetList(
450 prefs::kEnabledLabsExperiments);
451 if (!enabled_experiments)
452 return;
453
454 for (ListValue::const_iterator it = enabled_experiments->begin();
455 it != enabled_experiments->end();
456 ++it) {
457 std::string experiment_name;
458 if (!(*it)->GetAsString(&experiment_name)) {
459 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
460 continue;
461 }
462 result->insert(experiment_name);
463 }
464}
465
466// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:24467void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:05468 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:38469 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
470 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:05471
472 experiments_list->Clear();
473 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
474 it != enabled_experiments.end();
475 ++it) {
476 experiments_list->Append(new StringValue(*it));
477 }
478}
479
[email protected]8a6ff28d2010-12-02 16:35:19480// Returns the name used in prefs for the choice at the specified index.
481std::string NameForChoice(const Experiment& e, int index) {
[email protected]2ce9c89752011-02-25 18:24:34482 DCHECK_EQ(Experiment::MULTI_VALUE, e.type);
483 DCHECK_LT(index, e.num_choices);
[email protected]8a6ff28d2010-12-02 16:35:19484 return std::string(e.internal_name) + about_flags::testing::kMultiSeparator +
485 base::IntToString(index);
486}
487
488// Adds the internal names for the specified experiment to |names|.
489void AddInternalName(const Experiment& e, std::set<std::string>* names) {
490 if (e.type == Experiment::SINGLE_VALUE) {
491 names->insert(e.internal_name);
492 } else {
[email protected]2ce9c89752011-02-25 18:24:34493 DCHECK_EQ(Experiment::MULTI_VALUE, e.type);
[email protected]8a6ff28d2010-12-02 16:35:19494 for (int i = 0; i < e.num_choices; ++i)
495 names->insert(NameForChoice(e, i));
496 }
497}
498
[email protected]28e35af2011-02-09 12:56:22499// Confirms that an experiment is valid, used in a DCHECK in
500// SanitizeList below.
501bool ValidateExperiment(const Experiment& e) {
502 switch (e.type) {
503 case Experiment::SINGLE_VALUE:
504 DCHECK_EQ(0, e.num_choices);
505 DCHECK(!e.choices);
506 break;
507 case Experiment::MULTI_VALUE:
508 DCHECK_GT(e.num_choices, 0);
509 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:53510 DCHECK(e.choices[0].command_line_switch);
511 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:22512 break;
513 default:
514 NOTREACHED();
515 }
516 return true;
517}
518
[email protected]ad2a3ded2010-08-27 13:19:05519// Removes all experiments from prefs::kEnabledLabsExperiments that are
520// unknown, to prevent this list to become very long as experiments are added
521// and removed.
522void SanitizeList(PrefService* prefs) {
523 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:22524 for (size_t i = 0; i < num_experiments; ++i) {
525 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:19526 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:22527 }
[email protected]ad2a3ded2010-08-27 13:19:05528
529 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:24530 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:05531
532 std::set<std::string> new_enabled_experiments;
533 std::set_intersection(
534 known_experiments.begin(), known_experiments.end(),
535 enabled_experiments.begin(), enabled_experiments.end(),
536 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
537
[email protected]1a47d7e2010-10-15 00:37:24538 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:05539}
540
[email protected]1a47d7e2010-10-15 00:37:24541void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:05542 PrefService* prefs, std::set<std::string>* result) {
543 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:24544 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:05545}
546
[email protected]a314ee5a2010-10-26 21:23:28547// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
548// enabled on the current platform.
549void GetSanitizedEnabledFlagsForCurrentPlatform(
550 PrefService* prefs, std::set<std::string>* result) {
551 GetSanitizedEnabledFlags(prefs, result);
552
553 // Filter out any experiments that aren't enabled on the current platform. We
554 // don't remove these from prefs else syncing to a platform with a different
555 // set of experiments would be lossy.
556 std::set<std::string> platform_experiments;
557 int current_platform = GetCurrentPlatform();
558 for (size_t i = 0; i < num_experiments; ++i) {
559 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:19560 AddInternalName(experiments[i], &platform_experiments);
[email protected]a314ee5a2010-10-26 21:23:28561 }
562
563 std::set<std::string> new_enabled_experiments;
564 std::set_intersection(
565 platform_experiments.begin(), platform_experiments.end(),
566 result->begin(), result->end(),
567 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
568
569 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:05570}
571
[email protected]8a6ff28d2010-12-02 16:35:19572// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:19573Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:22574 const std::set<std::string>& enabled_experiments) {
[email protected]2ce9c89752011-02-25 18:24:34575 DCHECK_EQ(Experiment::MULTI_VALUE, experiment.type);
[email protected]8a6ff28d2010-12-02 16:35:19576 ListValue* result = new ListValue;
577 for (int i = 0; i < experiment.num_choices; ++i) {
578 const Experiment::Choice& choice = experiment.choices[i];
579 DictionaryValue* value = new DictionaryValue;
580 std::string name = NameForChoice(experiment, i);
581 value->SetString("description",
582 l10n_util::GetStringUTF16(choice.description_id));
583 value->SetString("internal_name", name);
[email protected]28e35af2011-02-09 12:56:22584 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:19585 result->Append(value);
586 }
587 return result;
588}
589
[email protected]e2ddbc92010-10-15 20:02:07590} // namespace
591
[email protected]1a47d7e2010-10-15 00:37:24592void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:55593 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:05594}
595
[email protected]1a47d7e2010-10-15 00:37:24596ListValue* GetFlagsExperimentsData(PrefService* prefs) {
[email protected]ad2a3ded2010-08-27 13:19:05597 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:24598 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:05599
600 int current_platform = GetCurrentPlatform();
601
602 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:28603 for (size_t i = 0; i < num_experiments; ++i) {
604 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:05605 if (!(experiment.supported_platforms & current_platform))
606 continue;
607
608 DictionaryValue* data = new DictionaryValue();
609 data->SetString("internal_name", experiment.internal_name);
610 data->SetString("name",
611 l10n_util::GetStringUTF16(experiment.visible_name_id));
612 data->SetString("description",
613 l10n_util::GetStringUTF16(
614 experiment.visible_description_id));
[email protected]ad2a3ded2010-08-27 13:19:05615
[email protected]28e35af2011-02-09 12:56:22616 switch (experiment.type) {
617 case Experiment::SINGLE_VALUE:
618 data->SetBoolean(
619 "enabled",
620 enabled_experiments.count(experiment.internal_name) > 0);
621 break;
622 case Experiment::MULTI_VALUE:
623 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
624 break;
625 default:
626 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:19627 }
628
[email protected]ad2a3ded2010-08-27 13:19:05629 experiments_data->Append(data);
630 }
631 return experiments_data;
632}
633
[email protected]ad2a3ded2010-08-27 13:19:05634bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:55635 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:05636}
637
638void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:35639 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:55640 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:07641}
642
643void RemoveFlagsSwitches(
644 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:55645 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:07646}
647
[email protected]a314ee5a2010-10-26 21:23:28648int GetCurrentPlatform() {
649#if defined(OS_MACOSX)
650 return kOsMac;
651#elif defined(OS_WIN)
652 return kOsWin;
653#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
654 return kOsCrOS;
655#elif defined(OS_LINUX)
656 return kOsLinux;
657#else
658#error Unknown platform
659#endif
660}
661
[email protected]4bc5050c2010-11-18 17:55:54662void RecordUMAStatistics(const PrefService* prefs) {
663 std::set<std::string> flags;
664 GetEnabledFlags(prefs, &flags);
665 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
666 ++it) {
667 std::string action("AboutFlags_");
668 action += *it;
669 UserMetrics::RecordComputedAction(action);
670 }
671 // Since flag metrics are recorded every startup, add a tick so that the
672 // stats can be made meaningful.
673 if (flags.size())
674 UserMetrics::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
[email protected]970b2fd2011-01-22 18:06:45675 UserMetrics::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:54676}
677
[email protected]e2ddbc92010-10-15 20:02:07678//////////////////////////////////////////////////////////////////////////////
679// FlagsState implementation.
680
681namespace {
682
683void FlagsState::ConvertFlagsToSwitches(
684 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:07685 if (command_line->HasSwitch(switches::kNoExperiments))
686 return;
687
688 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:00689
[email protected]a314ee5a2010-10-26 21:23:28690 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:07691
[email protected]a82744532011-02-11 16:15:53692 typedef std::map<std::string, std::pair<std::string, std::string> >
693 NameToSwitchAndValueMap;
694 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:19695 for (size_t i = 0; i < num_experiments; ++i) {
696 const Experiment& e = experiments[i];
697 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]a82744532011-02-11 16:15:53698 name_to_switch_map[e.internal_name] =
699 std::pair<std::string, std::string>(e.command_line_switch,
700 e.command_line_value);
[email protected]8a6ff28d2010-12-02 16:35:19701 } else {
702 for (int j = 0; j < e.num_choices; ++j)
[email protected]a82744532011-02-11 16:15:53703 name_to_switch_map[NameForChoice(e, j)] =
704 std::pair<std::string, std::string>(
705 e.choices[j].command_line_switch,
706 e.choices[j].command_line_value);
[email protected]8a6ff28d2010-12-02 16:35:19707 }
708 }
[email protected]e2ddbc92010-10-15 20:02:07709
710 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:53711 flags_switches_.insert(
712 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
713 std::string()));
[email protected]e2ddbc92010-10-15 20:02:07714 for (std::set<std::string>::iterator it = enabled_experiments.begin();
715 it != enabled_experiments.end();
716 ++it) {
717 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:53718 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:19719 name_to_switch_map.find(experiment_name);
720 if (name_to_switch_it == name_to_switch_map.end()) {
721 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:07722 continue;
[email protected]8a6ff28d2010-12-02 16:35:19723 }
[email protected]e2ddbc92010-10-15 20:02:07724
[email protected]a82744532011-02-11 16:15:53725 const std::pair<std::string, std::string>&
726 switch_and_value_pair = name_to_switch_it->second;
727
728 command_line->AppendSwitchASCII(switch_and_value_pair.first,
729 switch_and_value_pair.second);
730 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:07731 }
732 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:53733 flags_switches_.insert(
734 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
735 std::string()));
[email protected]e2ddbc92010-10-15 20:02:07736}
737
738bool FlagsState::IsRestartNeededToCommitChanges() {
739 return needs_restart_;
740}
741
742void FlagsState::SetExperimentEnabled(
743 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]ad2a3ded2010-08-27 13:19:05744 needs_restart_ = true;
745
[email protected]8a6ff28d2010-12-02 16:35:19746 size_t at_index = internal_name.find(about_flags::testing::kMultiSeparator);
747 if (at_index != std::string::npos) {
748 DCHECK(enable);
749 // We're being asked to enable a multi-choice experiment. Disable the
750 // currently selected choice.
751 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:22752 const std::string experiment_name = internal_name.substr(0, at_index);
753 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:19754
[email protected]28e35af2011-02-09 12:56:22755 // And enable the new choice, if it is not the default first choice.
756 if (internal_name != experiment_name + "@0") {
757 std::set<std::string> enabled_experiments;
758 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
759 enabled_experiments.insert(internal_name);
760 SetEnabledFlags(prefs, enabled_experiments);
761 }
[email protected]8a6ff28d2010-12-02 16:35:19762 return;
763 }
764
[email protected]ad2a3ded2010-08-27 13:19:05765 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:24766 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:05767
[email protected]8a6ff28d2010-12-02 16:35:19768 const Experiment* e = NULL;
769 for (size_t i = 0; i < num_experiments; ++i) {
770 if (experiments[i].internal_name == internal_name) {
771 e = experiments + i;
772 break;
773 }
774 }
775 DCHECK(e);
776
777 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:59778 if (enable)
[email protected]8a6ff28d2010-12-02 16:35:19779 enabled_experiments.insert(internal_name);
[email protected]8a2713682011-08-19 10:36:59780 else
[email protected]8a6ff28d2010-12-02 16:35:19781 enabled_experiments.erase(internal_name);
782 } else {
783 if (enable) {
784 // Enable the first choice.
785 enabled_experiments.insert(NameForChoice(*e, 0));
786 } else {
787 // Find the currently enabled choice and disable it.
788 for (int i = 0; i < e->num_choices; ++i) {
789 std::string choice_name = NameForChoice(*e, i);
790 if (enabled_experiments.find(choice_name) !=
791 enabled_experiments.end()) {
792 enabled_experiments.erase(choice_name);
793 // Continue on just in case there's a bug and more than one
794 // experiment for this choice was enabled.
795 }
796 }
797 }
798 }
[email protected]ad2a3ded2010-08-27 13:19:05799
[email protected]1a47d7e2010-10-15 00:37:24800 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:05801}
802
[email protected]e2ddbc92010-10-15 20:02:07803void FlagsState::RemoveFlagsSwitches(
804 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:53805 for (std::map<std::string, std::string>::const_iterator
806 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
807 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:07808 }
809}
810
811void FlagsState::reset() {
812 needs_restart_ = false;
813 flags_switches_.clear();
814}
815
[email protected]38e46812011-05-09 20:49:22816} // namespace
[email protected]e2ddbc92010-10-15 20:02:07817
818namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:19819
820// WARNING: '@' is also used in the html file. If you update this constant you
821// also need to update the html file.
822const char kMultiSeparator[] = "@";
823
[email protected]e2ddbc92010-10-15 20:02:07824void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:55825 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:07826}
[email protected]a314ee5a2010-10-26 21:23:28827
828void SetExperiments(const Experiment* e, size_t count) {
829 if (!e) {
830 experiments = kExperiments;
831 num_experiments = arraysize(kExperiments);
832 } else {
833 experiments = e;
834 num_experiments = count;
835 }
836}
837
[email protected]8a6ff28d2010-12-02 16:35:19838const Experiment* GetExperiments(size_t* count) {
839 *count = num_experiments;
840 return experiments;
841}
842
[email protected]e2ddbc92010-10-15 20:02:07843} // namespace testing
844
[email protected]1a47d7e2010-10-15 00:37:24845} // namespace about_flags