1// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "chrome/common/chrome_switches.h"
6
7#include "base/base_switches.h"
8
9namespace switches {
10
11// -----------------------------------------------------------------------------
12// Can't find the switch you are looking for? try looking in
13// base/base_switches.cc instead.
14// -----------------------------------------------------------------------------
15
16// Activate (make foreground) myself on launch.  Helpful when Chrome
17// is launched on the command line (e.g. by Selenium).  Only needed on Mac.
18const char kActivateOnLaunch[]              = "activate-on-launch";
19
20// On ChromeOS, file:// access is disabled except for certain whitelisted
21// directories. This switch re-enables file:// for testing.
22const char kAllowFileAccess[]               = "allow-file-access";
23
24// Allow non-https URL for background_page for hosted apps.
25const char kAllowHTTPBackgroundPage[]       = "allow-http-background-page";
26
27// Don't block outdated plugins.
28const char kAllowOutdatedPlugins[]          = "allow-outdated-plugins";
29
30// Allows injecting extensions and user scripts on the extensions
31// gallery site. Normally prevented for security reasons, but can be
32// useful for automation testing of the gallery.
33const char kAllowScriptingGallery[]         = "allow-scripting-gallery";
34
35// This prevents Chrome from requiring authorization to run certain widely
36// installed but less commonly used plug-ins.
37const char kAlwaysAuthorizePlugins[]        = "always-authorize-plugins";
38
39// Enable web inspector for all windows, even if they're part of the browser.
40// Allows us to use our dev tools to debug browser windows itself.
41const char kAlwaysEnableDevTools[]          = "always-enable-dev-tools";
42
43// Specifies that the associated value should be launched in "application" mode.
44const char kApp[]                           = "app";
45
46// Specifies that the extension-app with the specified id should be launched
47// according to its configuration.
48const char kAppId[]                         = "app-id";
49
50// Override the apps checkout URL, which is used to determine when to expose
51// some private APIs.
52const char kAppsCheckoutURL[]               = "apps-checkout-url";
53
54// Specifying this flag allows the webstorePrivate APIs to return browser (aka
55// sync) login tokens to be used for auto-login in the Web Store (normally they
56// do not).
57const char kAppsGalleryReturnTokens[]       = "apps-gallery-return-tokens";
58
59// The URL to use for the gallery link in the app launcher.
60const char kAppsGalleryURL[]                = "apps-gallery-url";
61
62// The update url used by gallery/webstore extensions.
63const char kAppsGalleryUpdateURL[]          = "apps-gallery-update-url";
64
65// Disable throbber for extension apps.
66const char kAppsNoThrob[]                   = "apps-no-throb";
67
68// Whitelist of servers that Negotiate will generate delegated Kerberos tickets
69// for.
70const char kAuthNegotiateDelegateWhitelist[] =
71    "auth-negotiate-delegate-whitelist";
72
73// HTTP authentication schemes to enable. This is a comma separated list
74// of authentication schemes (basic, digest, ntlm, and negotiate). By default
75// all schemes are enabled. The primary use of this command line flag is to help
76// triage autentication-related issues reported by end-users.
77const char kAuthSchemes[]                   = "auth-schemes";
78
79// Whitelist of servers which NTLM and Negotiate can automatically authenticate
80// with using the default credentials of the currently logged in user.
81const char kAuthServerWhitelist[]           = "auth-server-whitelist";
82
83// The value of this switch tells the app to listen for and broadcast
84// automation-related messages on IPC channel with the given ID.
85const char kAutomationClientChannelID[]     = "automation-channel";
86
87// When the option to block third-party cookies from being set is enabled,
88// also block third-party cookies from being read.
89const char kBlockReadingThirdPartyCookies[] =
90    "block-reading-third-party-cookies";
91
92// Causes the browser process to throw an assertion on startup.
93const char kBrowserAssertTest[]             = "assert-test";
94
95// Causes the browser process to crash on startup.
96const char kBrowserCrashTest[]              = "crash-test";
97
98// How often (in seconds) to check for updates. Should only be used for
99// testing purposes.
100const char kCheckForUpdateIntervalSec[]     = "check-for-update-interval";
101
102// Run Chrome in Chrome Frame mode. This means that Chrome expects to be run
103// as a dependent process of the Chrome Frame plugin.
104const char kChromeFrame[]                   = "chrome-frame";
105
106// Tells chrome to load the specified version of chrome.dll on Windows. If
107// this version cannot be loaded, Chrome will exit.
108const char kChromeVersion[]                 = "chrome-version";
109
110// The unique id to be used for this cloud print proxy instance.
111const char kCloudPrintProxyId[]             = "cloud-print-proxy-id";
112
113// Tells chrome to display the cloud print dialog and upload the
114// specified file for printing.
115const char kCloudPrintFile[]                = "cloud-print-file";
116
117// Used with kCloudPrintFile to specify a title for the resulting print
118// job.
119const char kCloudPrintJobTitle[]            = "cloud-print-job-title";
120
121// Specifies the mime type to be used when uploading data from the
122// file referenced by cloud-print-file.
123// Defaults to "application/pdf" if unspecified.
124const char kCloudPrintFileType[]            = "cloud-print-file-type";
125
126// The URL of the cloud print service to use, overrides any value
127// stored in preferences, and the default.  Only used if the cloud
128// print service has been enabled (see enable-cloud-print).
129const char kCloudPrintServiceURL[]          = "cloud-print-service";
130
131// Causes the browser process to inspect loaded and registered DLLs for
132// known conflicts and warn the user.
133const char kConflictingModulesCheck[]       = "conflicting-modules-check";
134
135// The Country we should use.  This is normally obtained from the operating
136// system during first run and cached in the preferences afterwards.  This is a
137// string value, the 2 letter code from ISO 3166-1.
138const char kCountry[]                       = "country";
139
140// If enabled, tries to load inspector files from disk (allows reloading of
141// devtool files without having to restart the browser).
142const char kDebugDevTools[]                 = "debug-devtools";
143
144// Enables support to debug printing subsystem.
145const char kDebugPrint[]                    = "debug-print";
146
147// Specifies the URL at which to fetch configuration policy from the device
148// management backend. Specifying this switch turns on managed policy from the
149// device management backend.
150const char kDeviceManagementUrl[]           = "device-management-url";
151
152// Triggers a pletora of diagnostic modes.
153const char kDiagnostics[]                   = "diagnostics";
154
155// Disables the hardware acceleration of 3D CSS and animation.
156const char kDisableAcceleratedLayers[]      = "disable-accelerated-layers";
157
158// Disables GPU accelerated video display.
159const char kDisableAcceleratedVideo[]       = "disable-accelerated-video";
160
161// Disables the alternate window station for the renderer.
162const char kDisableAltWinstation[]          = "disable-winsta";
163
164// Replaces the audio IPC layer for <audio> and <video> with a mock audio
165// device, useful when using remote desktop or machines without sound cards.
166// This is temporary until we fix the underlying problem.
167
168// Disable CNAME lookup of the host when generating the Kerberos SPN for a
169// Negotiate challenge. See HttpAuthHandlerNegotiate::CreateSPN
170// for more background.
171const char kDisableAuthNegotiateCnameLookup[] =
172    "disable-auth-negotiate-cname-lookup";
173
174// Disable background mode (background apps will not keep chrome running in the
175// background).
176const char kDisableBackgroundMode[] = "disable-background-mode";
177
178// Disable several subsystems which run network requests in the background.
179// This is for use when doing network performance testing to avoid noise
180// in the measurements.
181const char kDisableBackgroundNetworking[] = "disable-background-networking";
182
183// Disables blocked content warning animation. Currently shows animation for
184// blocked pop-ups only.
185const char kDisableBlockContentAnimation[]  =
186    "disable-blocked-content-animation";
187
188// This switch is used to disable the client-side phishing detection feature.
189// Note that even if client-side phishing detection is enabled, it will only
190// be active if the user has opted in to UMA stats and SafeBrowsing is enabled
191// in the preferences.
192const char kDisableClientSidePhishingDetection[] =
193    "disable-client-side-phishing-detection";
194
195// Disables establishing a backup TCP connection if a specified timeout is
196// exceeded.
197const char kDisableConnectBackupJobs[]      = "disable-connect-backup-jobs";
198
199// Disables the custom JumpList on Windows 7.
200const char kDisableCustomJumpList[]         = "disable-custom-jumplist";
201
202// Browser flag to disable the web inspector for all renderers.
203const char kDisableDevTools[]               = "disable-dev-tools";
204
205// Disable extensions.
206const char kDisableExtensions[]             = "disable-extensions";
207
208// Disable checking for user opt-in for extensions that want to inject script
209// into file URLs (ie, always allow it). This is used during automated testing.
210const char kDisableExtensionsFileAccessCheck[] =
211    "disable-extensions-file-access-check";
212
213// Disables the sandbox for the built-in flash player.
214const char kDisableFlashSandbox[]           = "disable-flash-sandbox";
215
216// Suppresses hang monitor dialogs in renderer processes.  This may allow slow
217// unload handlers on a page to prevent the tab from closing, but the Task
218// Manager can be used to terminate the offending process in this case.
219const char kDisableHangMonitor[]            = "disable-hang-monitor";
220
221// Disable the use of the HistoryQuickProvider for autocomplete results.
222const char kDisableHistoryQuickProvider[]   = "disable-history-quick-provider";
223
224// Disable the use of the HistoryURLProvider for autocomplete results.
225const char kDisableHistoryURLProvider[]     = "disable-history-url-provider";
226
227// Disables HTML5 Forms interactive validation.
228const char kDisableInteractiveFormValidation[] =
229    "disable-interactive-form-validation";
230
231// Disable the internal Flash Player.
232const char kDisableInternalFlash[]          = "disable-internal-flash";
233
234// Don't resolve hostnames to IPv6 addresses. This can be used when debugging
235// issues relating to IPv6, but shouldn't otherwise be needed. Be sure to
236// file bugs if something isn't working properly in the presence of IPv6.
237// This flag can be overidden by the "enable-ipv6" flag.
238const char kDisableIPv6[]                   = "disable-ipv6";
239
240// Disables IP Pooling within the networks stack (SPDY only).  When a connection
241// is needed for a domain which shares an IP with an existing connection,
242// attempt to use the existing connection.
243const char kDisableIPPooling[]              = "disable-ip-pooling";
244
245// Disable speculative TCP/IP preconnection.
246const char kDisablePreconnect[]             = "disable-preconnect";
247
248// Whether we should prevent the new tab page from showing the first run
249// notification.
250const char kDisableNewTabFirstRun[]         = "disable-new-tab-first-run";
251
252// Normally when the user attempts to navigate to a page that was the result of
253// a post we prompt to make sure they want to. This switch may be used to
254// disable that check. This switch is used during automated testing.
255const char kDisablePromptOnRepost[]         = "disable-prompt-on-repost";
256
257// Disable remote web font support. SVG font should always work whether
258// this option is specified or not.
259const char kDisableRemoteFonts[]            = "disable-remote-fonts";
260
261// Turns off the accessibility in the renderer.
262const char kDisableRendererAccessibility[]  = "disable-renderer-accessibility";
263
264// Prevents the URLs of BackgroundContents from being remembered and re-launched
265// when the browser restarts.
266const char kDisableRestoreBackgroundContents[] =
267    "disable-restore-background-contents";
268
269// Disable site-specific tailoring to compatibility issues in WebKit.
270const char kDisableSiteSpecificQuirks[]     = "disable-site-specific-quirks";
271
272// Disable False Start in SSL and TLS connections.
273const char kDisableSSLFalseStart[]          = "disable-ssl-false-start";
274
275// Disable syncing browser data to a Google Account.
276const char kDisableSync[]                   = "disable-sync";
277
278// Disable syncing of apps.
279const char kDisableSyncApps[]               = "disable-sync-apps";
280
281// Disable syncing of autofill.
282const char kDisableSyncAutofill[]           = "disable-sync-autofill";
283
284// Disable syncing of autofill Profile.
285const char kDisableSyncAutofillProfile[]     = "disable-sync-autofill-profile";
286
287// Disable syncing of bookmarks.
288const char kDisableSyncBookmarks[]          = "disable-sync-bookmarks";
289
290// Disable syncing of extensions.
291const char kDisableSyncExtensions[]         = "disable-sync-extensions";
292
293// Disable syncing browser passwords.
294const char kDisableSyncPasswords[]          = "disable-sync-passwords";
295
296// Disable syncing of preferences.
297const char kDisableSyncPreferences[]        = "disable-sync-preferences";
298
299// Disable syncing of themes.
300const char kDisableSyncThemes[]             = "disable-sync-themes";
301
302// TabCloseableStateWatcher disallows closing of tabs and browsers under certain
303// situations on ChromeOS.  Some tests expect tabs or browsers to close, so we
304// need a switch to disable the watcher.
305const char kDisableTabCloseableStateWatcher[] =
306    "disable-tab-closeable-state-watcher";
307
308// Allow disabling of translate from the command line to assist with
309// automated browser testing (e.g. Selenium/WebDriver).  Normal
310// browser users should disable translate with the preference.
311const char kDisableTranslate[] = "disable-translate";
312
313// Disables the backend service for web resources.
314const char kDisableWebResources[]           = "disable-web-resources";
315
316// Don't enforce the same-origin policy.  (Used by people testing their sites.)
317const char kDisableWebSecurity[]            = "disable-web-security";
318
319// Disable WebKit's XSSAuditor.  The XSSAuditor mitigates reflective XSS.
320const char kDisableXSSAuditor[]             = "disable-xss-auditor";
321
322// Use a specific disk cache location, rather than one derived from the
323// UserDatadir.
324const char kDiskCacheDir[]                  = "disk-cache-dir";
325
326// Forces the maximum disk space to be used by the disk cache, in bytes.
327const char kDiskCacheSize[]                 = "disk-cache-size";
328
329const char kDnsLogDetails[]                 = "dns-log-details";
330
331// Disables prefetching of DNS information.
332const char kDnsPrefetchDisable[]            = "dns-prefetch-disable";
333
334// Use the specified DNS server for raw DNS resolution.
335const char kDnsServer[]                     = "dns-server";
336
337// Specifies if the |DOMAutomationController| needs to be bound in the
338// renderer. This binding happens on per-frame basis and hence can potentially
339// be a performance bottleneck. One should only enable it when automating
340// dom based tests.
341// Also enables sending/receiving renderer automation messages through the
342// |AutomationRenderViewHelper|.
343// TODO(kkania): Rename this to enable-renderer-automation after moving the
344// |DOMAutomationController| to the |AutomationRenderViewHelper|.
345const char kDomAutomationController[]       = "dom-automation";
346
347// Dump any accumualted histograms to the log when browser terminates (requires
348// logging to be enabled to really do anything).  Used by developers and test
349// scripts.
350const char kDumpHistogramsOnExit[]          = "dump-histograms-on-exit";
351
352// Enable displaying net log events on the command line.
353extern const char kLogNetLog[]              = "log-net-log";
354
355// Enable gpu-accelerated 2d canvas.
356const char kEnableAccelerated2dCanvas[]     = "enable-accelerated-2d-canvas";
357
358// Enables the hardware acceleration of plugins.
359const char kEnableAcceleratedPlugins[]      = "enable-accelerated-plugins";
360
361// Enables AeroPeek for each tab. (This switch only works on Windows 7).
362const char kEnableAeroPeekTabs[]            = "enable-aero-peek-tabs";
363
364// Enable the inclusion of non-standard ports when generating the Kerberos SPN
365// in response to a Negotiate challenge. See HttpAuthHandlerNegotiate::CreateSPN
366// for more background.
367const char kEnableAuthNegotiatePort[]       = "enable-auth-negotiate-port";
368
369// At this point, even if client-side phishing detection is enabled we will not,
370// by default, display an interstitial if we detected a phishing site.  Once
371// we are confident that the false-positive rate is as low as expected we can
372// remove this flag.
373const char kEnableClientSidePhishingInterstitial[] =
374    "enable-client-side-phishing-interstitial";
375
376// This flag enables UI for clearing server data.  Temporarily in place
377// until there's a server endpoint deployed.
378const char kEnableClearServerData[]         = "enable-clear-server-data";
379
380// Enable click-to-play for blocked plug-ins.
381const char kEnableClickToPlay[]             = "enable-click-to-play";
382
383// This applies only when the process type is "service". Enables the
384// Cloud Print Proxy component within the service process.
385const char kEnableCloudPrintProxy[]         = "enable-cloud-print-proxy";
386
387// Enables the Cloud Print dialog hosting code.
388const char kEnableCloudPrint[]              = "enable-cloud-print";
389
390// Enables compositing to texture instead of display.
391const char kEnableCompositeToTexture[]      = "enable-composite-to-texture";
392
393// Enables establishing a backup TCP connection if a specified timeout is
394// exceeded.
395const char kEnableConnectBackupJobs[]       = "enable-connect-backup-jobs";
396
397// Enables web developers to create apps for Chrome without using crx packages.
398const char kEnableCrxlessWebApps[]          = "enable-crxless-web-apps";
399
400// Enable DNS side checking of certificates. Still experimental, should only
401// be used by developers at the current time.
402const char kEnableDNSCertProvenanceChecking[] =
403     "enable-dns-cert-provenance-checking";
404
405const char kEnableDNSSECCerts[]             = "enable-dnssec-certs";
406
407// Enables app manifest features that are in development.
408const char kEnableExperimentalAppManifests[] =
409    "enable-experimental-app-manifests";
410
411// Enables extension APIs that are in development.
412const char kEnableExperimentalExtensionApis[] =
413    "enable-experimental-extension-apis";
414
415// Enable experimental timeline API.
416const char kEnableExtensionTimelineApi[]    = "enable-extension-timeline-api";
417
418// Enable the fastback page cache.
419const char kEnableFastback[]                = "enable-fastback";
420
421// By default, cookies are not allowed on file://. They are needed for
422// testing, for example page cycler and layout tests.  See bug 1157243.
423const char kEnableFileCookies[]             = "enable-file-cookies";
424
425// Enable the use of the HistoryQuickProvider for autocomplete results.
426const char kEnableHistoryQuickProvider[]    = "enable-history-quick-provider";
427
428// Enable the JavaScript Full Screen API.
429const char kEnableFullScreen[]              = "enable-fullscreen";
430
431// Enable the in-browser thumbnailing, which is more efficient than the
432// in-renderer thumbnailing, as we can use more information to determine
433// if we need to update thumbnails.
434const char kEnableInBrowserThumbnailing[]   = "enable-in-browser-thumbnailing";
435
436// Enable IPv6 support, even if probes suggest that it may not be fully
437// supported.  Some probes may require internet connections, and this flag will
438// allow support independent of application testing.
439// This flag overrides "disable-ipv6" which appears elswhere in this file.
440const char kEnableIPv6[]                    = "enable-ipv6";
441
442// Enables IP Pooling within the networks stack (SPDY only).  When a connection
443// is needed for a domain which shares an IP with an existing connection,
444// attempt to use the existing connection.
445const char kEnableIPPooling[]               = "enable-ip-pooling";
446
447// Allows reporting memory info (JS heap size) to page.
448const char kEnableMemoryInfo[]              = "enable-memory-info";
449
450// Runs the Native Client inside the renderer process and enables GPU plugin
451// (internally adds lEnableGpuPlugin to the command line).
452const char kEnableNaCl[]                    = "enable-nacl";
453
454// Enables debugging via RSP over a socket.
455const char kEnableNaClDebug[]               = "enable-nacl-debug";
456
457// This applies only when the process type is "service". Enables the
458// Chromoting Host Process within the service process.
459const char kEnableRemoting[]                = "enable-remoting";
460
461// Enable content settings based on host *and* plug-in.
462const char kEnableResourceContentSettings[] =
463    "enable-resource-content-settings";
464
465// Enable panels (always on-top docked pop-up windows).
466const char kEnablePanels[]                  = "enable-panels";
467
468// Enable speculative TCP/IP preconnection.
469const char kEnablePreconnect[]              = "enable-preconnect";
470
471// Enable print preview (work in progress).
472const char kEnablePrintPreview[]            = "enable-print-preview";
473
474// Enable the IsSearchProviderInstalled and InstallSearchProvider with an extra
475// parameter to indicate if the provider should be the default.
476const char kEnableSearchProviderApiV2[]     = "enable-search-provider-api-v2";
477
478// Enables 0-RTT HTTPS handshakes.
479const char kEnableSnapStart[]               = "enable-snap-start";
480
481// Enable syncing browser data to a Google Account.
482const char kEnableSync[]                    = "enable-sync";
483
484// Enable syncing browser autofill.
485const char kEnableSyncAutofill[]            = "enable-sync-autofill";
486
487// Enable syncing browser sessions.
488const char kEnableSyncSessions[]            = "enable-sync-sessions";
489
490// Enables context menu for selecting groups of tabs.
491const char kEnableTabGroupsContextMenu[]     = "enable-tab-groups-context-menu";
492
493// Enable syncing browser typed urls.
494const char kEnableSyncTypedUrls[]           = "enable-sync-typed-urls";
495
496// Enable use of experimental TCP sockets API for sending data in the
497// SYN packet.
498const char kEnableTcpFastOpen[]             = "enable-tcp-fastopen";
499
500// Enables the option to show tabs as a vertical stack down the side of the
501// browser window.
502const char kEnableVerticalTabs[]            = "enable-vertical-tabs";
503
504// Spawn threads to watch for excessive delays in specified message loops.
505// User should set breakpoints on Alarm() to examine problematic thread.
506// Usage:   -enable-watchdog=[ui][io]
507// Order of the listed sub-arguments does not matter.
508const char kEnableWatchdog[]                = "enable-watchdog";
509
510// Enables experimental features for Spellchecker. Right now, the first
511// experimental feature is auto spell correct, which corrects words which are
512// misppelled by typing the word with two consecutive letters swapped. The
513// features that will be added next are:
514// 1 - Allow multiple spellcheckers to work simultaneously.
515// 2 - Allow automatic detection of spell check language.
516// TODO(sidchat): Implement the above fetaures to work under this flag.
517const char kExperimentalSpellcheckerFeatures[] =
518    "experimental-spellchecker-features";
519
520// Explicitly allow additional ports using a comma separated list of port
521// numbers.
522const char kExplicitlyAllowedPorts[]        = "explicitly-allowed-ports";
523
524// Frequency in seconds for Extensions auto-update.
525const char kExtensionsUpdateFrequency[]     = "extensions-update-frequency";
526
527// These two flags are added around the switches about:flags adds to the
528// command line. This is useful to see which switches were added by about:flags
529// on about:version. They don't have any effect.
530const char kFlagSwitchesBegin[]             = "flag-switches-begin";
531const char kFlagSwitchesEnd[]               = "flag-switches-end";
532
533// Alternative feedback server to use when submitting user feedback
534const char kFeedbackServer[]                = "feedback-server";
535
536// The file descriptor limit is set to the value of this switch, subject to the
537// OS hard limits. Useful for testing that file descriptor exhaustion is handled
538// gracefully.
539const char kFileDescriptorLimit[]           = "file-descriptor-limit";
540
541// If true opening a url from the omnibox attepts to focus an existing tab.
542const char kFocusExistingTabOnOpen[]        = "focus-existing-tab-on-open";
543
544// Display the First Run experience when the browser is started, regardless of
545// whether or not it's actually the first run.
546const char kFirstRun[]                      = "first-run";
547
548// Forces the apps/webstore promo to be shown, independent of whether it has
549// timed out, etc. Useful for testing.
550const char kForceAppsPromoVisible[]         = "force-apps-promo-visible";
551
552// If accelerated compositing is supported, always enter compositing mode for
553// the base layer even when compositing is not strictly required.
554const char kForceCompositingMode[]          = "force-compositing-mode";
555
556// Force renderer accessibility to be on instead of enabling it on demand when
557// a screen reader is detected. The disable-renderer-accessibility switch
558// overrides this if present.
559const char kForceRendererAccessibility[]    = "force-renderer-accessibility";
560
561// Specifies a custom name for the GSSAPI library to load.
562const char kGSSAPILibraryName[]             = "gssapi-library-name";
563
564// These flags show the man page on Linux. They are equivalent to each
565// other.
566const char kHelp[]                          = "help";
567const char kHelpShort[]                     = "h";
568
569// Make Windows happy by allowing it to show "Enable access to this program"
570// checkbox in Add/Remove Programs->Set Program Access and Defaults. This
571// only shows an error box because the only way to hide Chrome is by
572// uninstalling it.
573const char kHideIcons[]                     = "hide-icons";
574
575// The value of this switch specifies which page will be displayed
576// in newly-opened tabs.  We need this for testing purposes so
577// that the UI tests don't depend on what comes up for http://google.com.
578const char kHomePage[]                      = "homepage";
579
580// Comma separated list of rules that control how hostnames are mapped.
581//
582// For example:
583//    "MAP * 127.0.0.1" --> Forces all hostnames to be mapped to 127.0.0.1
584//    "MAP *.google.com proxy" --> Forces all google.com subdomains to be
585//                                 resolved to "proxy".
586//    "MAP test.com [::1]:77 --> Forces "test.com" to resolve to IPv6 loopback.
587//                               Will also force the port of the resulting
588//                               socket address to be 77.
589//    "MAP * baz, EXCLUDE www.google.com" --> Remaps everything to "baz",
590//                                            except for "www.google.com".
591//
592// These mappings apply to the endpoint host in a net::URLRequest (the TCP
593// connect and host resolver in a direct connection, and the CONNECT in an http
594// proxy connection, and the endpoint host in a SOCKS proxy connection).
595const char kHostRules[]                     = "host-rules";
596
597// The maximum number of concurrent host resolve requests (i.e. DNS) to allow.
598const char kHostResolverParallelism[]       = "host-resolver-parallelism";
599
600// These mappings only apply to the host resolver.
601const char kHostResolverRules[]             = "host-resolver-rules";
602
603// Ignores GPU blacklist.
604const char kIgnoreGpuBlacklist[]            = "ignore-gpu-blacklist";
605
606// Perform importing from another browser. The value associated with this
607// setting encodes the target browser and what items to import.
608const char kImport[]                        = "import";
609
610// Perform bookmark importing from an HTML file. The value associated with this
611// setting encodes the file path. It may be used jointly with kImport.
612const char kImportFromFile[]                = "import-from-file";
613
614// Causes the browser to launch directly in incognito mode.
615const char kIncognito[]                     = "incognito";
616
617// URL to use for instant. If specified this overrides the url from the
618// TemplateURL.
619const char kInstantURL[]                    = "instant-url";
620
621// Used for testing - keeps browser alive after last browser window closes.
622const char kKeepAliveForTest[]              = "keep-alive-for-test";
623
624// Load an extension from the specified directory.
625const char kLoadExtension[]                 = "load-extension";
626
627// Load the opencryptoki library into NSS at startup.  This is only
628// needed temporarily for developers who need to work on WiFi/VPN
629// certificate code.
630// TODO(gspencer): Remove this switch once cryptohomed work is finished:
631// http://crosbug.com/12295 and http://crosbug.com/12304
632const char kLoadOpencryptoki[]              = "load-opencryptoki";
633
634// Uninstall an extension with the specified extension id.
635const char kUninstallExtension[]            = "uninstall-extension";
636
637// Make Chrome default browser
638const char kMakeDefaultBrowser[]            = "make-default-browser";
639
640// Forces the maximum disk space to be used by the media cache, in bytes.
641const char kMediaCacheSize[]                = "media-cache-size";
642
643// Enable dynamic loading of the Memory Profiler DLL, which will trace
644// all memory allocations during the run.
645const char kMemoryProfiling[]               = "memory-profile";
646
647// Enable histograming of tasks served by MessageLoop. See about:histograms/Loop
648// for results, which show frequency of messages on each thread, including APC
649// count, object signalling count, etc.
650const char kMessageLoopHistogrammer[]       = "message-loop-histogrammer";
651
652// Enables the recording of metrics reports but disables reporting.  In
653// contrast to kDisableMetrics, this executes all the code that a normal client
654// would use for reporting, except the report is dropped rather than sent to
655// the server. This is useful for finding issues in the metrics code during UI
656// and performance tests.
657const char kMetricsRecordingOnly[]          = "metrics-recording-only";
658
659// The minimum version of Flash that implements the NPP_ClearSiteData API.
660const char kMinClearSiteDataFlashVersion[]  = "min-clearsitedata-flash-version";
661
662// Enables multiprofile Chrome.
663const char kMultiProfiles[]                 = "multi-profiles";
664
665// Sets the default IP address (interface) for the stub (normally 127.0.0.1).
666const char kNaClDebugIP[]                   = "nacl-debug-ip";
667
668// Sets the default port range for debugging.
669const char kNaClDebugPorts[]                = "nacl-debug-ports";
670
671// Causes the process to run as a NativeClient broker
672// (used for launching NaCl loader processes on 64-bit Windows).
673const char kNaClBrokerProcess[]             = "nacl-broker";
674
675// Causes the Native Client process to display a dialog on launch.
676const char kNaClStartupDialog[]             = "nacl-startup-dialog";
677
678// Use the latest incarnation of the new tab page.
679const char kNewTabPage4[]                   = "new-tab-page-4";
680
681// Disables the default browser check. Useful for UI/browser tests where we
682// want to avoid having the default browser info-bar displayed.
683const char kNoDefaultBrowserCheck[]         = "no-default-browser-check";
684
685// Don't record/playback events when using record & playback.
686const char kNoEvents[]                      = "no-events";
687
688// Disables all experiments set on about:flags. Does not disable about:flags
689// itself. Useful if an experiment makes chrome crash at startup: One can start
690// chrome with --no-experiments, disable the problematic lab at about:flags and
691// then restart chrome without this switch again.
692const char kNoExperiments[]                 = "no-experiments";
693
694// whether or not it's actually the first run. Overrides kFirstRun in case
695// you're for some reason tempted to pass them both.
696const char kNoFirstRun[]                    = "no-first-run";
697
698// Don't send hyperlink auditing pings
699const char kNoPings[]                       = "no-pings";
700
701// Don't use a proxy server, always make direct connections. Overrides any
702// other proxy server flags that are passed.
703const char kNoProxyServer[]                 = "no-proxy-server";
704
705// Disables the service process from adding itself as an autorun process. This
706// does not delete existing autorun registrations, it just prevents the service
707// from registering a new one.
708const char kNoServiceAutorun[]               = "no-service-autorun";
709
710// Does not automatically open a browser window on startup (used when launching
711// Chrome for the purpose of hosting background apps).
712const char kNoStartupWindow[]               = "no-startup-window";
713
714// Show a desktop notification that the cloud print token has expired and
715// that user needs to re-authenticate.
716const char kNotifyCloudPrintTokenExpired[]  = "notify-cp-token-expired";
717
718// Specifies the maximum number of threads to use for running the Proxy
719// Autoconfig (PAC) script.
720const char kNumPacThreads[]                 = "num-pac-threads";
721
722// Launch URL in new browser window.
723const char kOpenInNewWindow[]               = "new-window";
724
725// Simulate an organic Chrome install.
726const char kOrganicInstall[]                = "organic";
727
728// Package an extension to a .crx installable file from a given directory.
729const char kPackExtension[]                 = "pack-extension";
730
731// Optional PEM private key is to use in signing packaged .crx.
732const char kPackExtensionKey[]              = "pack-extension-key";
733
734// Specifies the path to the user data folder for the parent profile.
735const char kParentProfile[]                 = "parent-profile";
736
737// Forces the PPAPI version of Flash (if it's being used) to run in the
738// renderer process rather than in a separate plugin process.
739const char kPpapiFlashInProcess[]          = "ppapi-flash-in-process";
740
741// Controls speculative prerendering of pages, and content prefetching.  Both
742// are dispatched from <link rel=prefetch href=...> elements.
743const char kPrerender[]                     = "prerender";
744// These are the values the switch may have, as in "--prerender=auto".
745//   auto: Allow field trial selection in both prerender and prefetch.
746const char kPrerenderSwitchValueAuto[]      = "auto";
747//   disabled: No prerendering or prefetching.
748const char kPrerenderSwitchValueDisabled[]  = "disabled";
749//   enabled: Both prerendering and prefetching.
750const char kPrerenderSwitchValueEnabled[]   = "enabled";
751//   prefetch_only: No prerendering, but enable prefetching.
752const char kPrerenderSwitchValuePrefetchOnly[] = "prefetch_only";
753
754// Prints the pages on the screen.
755const char kPrint[]                         = "print";
756
757// Output the product version information and quit. Used as an internal api to
758// detect the installed version of Chrome on Linux.
759const char kProductVersion[]                = "product-version";
760
761// Starts the sampling based profiler for the browser process at
762// startup. This will only work if chrome has been built with
763// the gyp variable profiling=1. The output will go to the value
764// of kProfilingFile.
765const char kProfilingAtStart[]              = "profiling-at-start";
766
767// Specifies a location for profiling output. This will only work if chrome
768// has been built with the gyp variable profiling=1.
769//   {pid} if present will be replaced by the pid of the process.
770//   {count} if present will be incremented each time a profile is generated
771//           for this process.
772// The default is chrome-profile-{pid}.
773const char kProfilingFile[]                 = "profiling-file";
774
775// Controls whether profile data is periodically flushed to a file.
776// Normally the data gets written on exit but cases exist where chrome
777// doesn't exit cleanly (especially when using single-process).
778// A time in seconds can be specified.
779const char kProfilingFlush[]                = "profiling-flush";
780
781// Force proxy auto-detection.
782const char kProxyAutoDetect[]               = "proxy-auto-detect";
783
784// Specify a list of hosts for whom we bypass proxy settings and use direct
785// connections. Ignored if --proxy-auto-detect or --no-proxy-server are
786// also specified.
787// This is a comma separated list of bypass rules. See:
788// "net/proxy/proxy_bypass_rules.h" for the format of these rules.
789const char kProxyBypassList[]               = "proxy-bypass-list";
790
791// Use the pac script at the given URL
792const char kProxyPacUrl[]                   = "proxy-pac-url";
793
794// Use a specified proxy server, overrides system settings. This switch only
795// affects HTTP and HTTPS requests.
796const char kProxyServer[]                   = "proxy-server";
797
798// Adds a "Purge memory" button to the Task Manager, which tries to dump as
799// much memory as possible.  This is mostly useful for testing how well the
800// MemoryPurger functionality works.
801//
802// NOTE: This is only implemented for Views.
803const char kPurgeMemoryButton[]             = "purge-memory-button";
804
805// Reload pages that have been killed when they are next focused by the user.
806const char kReloadKilledTabs[]              = "reload-killed-tabs";
807
808// Enable remote debug over HTTP on the specified port.
809const char kRemoteDebuggingPort[]           = "remote-debugging-port";
810
811// Enable remote debug / automation shell on the specified port.
812const char kRemoteShellPort[]               = "remote-shell-port";
813
814// Indicates the last session should be restored on startup. This overrides
815// the preferences value and is primarily intended for testing. The value of
816// this switch is the number of tabs to wait until loaded before
817// 'load completed' is sent to the ui_test.
818const char kRestoreLastSession[]            = "restore-last-session";
819
820// URL prefix used by safebrowsing to fetch hash, download data and
821// report malware.
822const char kSbInfoURLPrefix[] = "safebrowsing-info-url-prefix";
823
824// URL prefix used by safebrowsing to get MAC key.
825const char kSbMacKeyURLPrefix[] = "safebrowsing-mackey-url-prefix";
826
827// If present, safebrowsing only performs update when
828// SafeBrowsingProtocolManager::ForceScheduleNextUpdate() is explicitly called.
829// This is used for testing only.
830const char kSbDisableAutoUpdate[] = "safebrowsing-disable-auto-update";
831
832// TODO(lzheng): Remove this flag once the feature works fine
833// (http://crbug.com/74848).
834// This flag disables safebrowsing feature that checks download url and download
835// content's hash to make sure the content are not malicious.
836const char kSbDisableDownloadProtection[] =
837    "safebrowsing-disable-download-protection";
838
839// Enable support for SDCH filtering (dictionary based expansion of content).
840// Optional argument is *the* only domain name that will have SDCH suppport.
841// Default is  "-enable-sdch" to advertise SDCH on all domains.
842// Sample usage with argument: "-enable-sdch=.google.com"
843// SDCH is currently only supported server-side for searches on google.com.
844const char kSdchFilter[]                    = "enable-sdch";
845
846// Enables the showing of an info-bar instructing user they can search directly
847// from the omnibox.
848const char kSearchInOmniboxHint[]           = "search-in-omnibox-hint";
849
850// The LSID of the account to use for the service process.
851const char kServiceAccountLsid[]            = "service-account-lsid";
852
853// See kHideIcons.
854const char kShowIcons[]                     = "show-icons";
855
856// Renders a border around composited Render Layers to help debug and study
857// layer compositing.
858const char kShowCompositedLayerBorders[]    = "show-composited-layer-borders";
859
860// Draws a textual dump of the compositor layer tree to help debug and study
861// layer compositing.
862const char kShowCompositedLayerTree[]       = "show-composited-layer-tree";
863
864// Draws a FPS indicator
865const char kShowFPSCounter[]                = "show-fps-counter";
866
867// Change the DCHECKS to dump memory and continue instead of displaying error
868// dialog. This is valid only in Release mode when --enable-dcheck is
869// specified.
870const char kSilentDumpOnDCHECK[]            = "silent-dump-on-dcheck";
871
872// Replaces the buffered data source for <audio> and <video> with a simplified
873// resource loader that downloads the entire resource into memory.
874
875// Start the browser maximized, regardless of any previous settings.
876const char kStartMaximized[]                = "start-maximized";
877
878// Allow insecure XMPP connections for sync (for testing).
879const char kSyncAllowInsecureXmppConnection[] =
880    "sync-allow-insecure-xmpp-connection";
881
882// Invalidate any login info passed into sync's XMPP connection.
883const char kSyncInvalidateXmppLogin[]       = "sync-invalidate-xmpp-login";
884
885// Use the SyncerThread implementation that matches up with the old pthread
886// impl semantics, but using Chrome synchronization primitives.  The only
887// difference between this and the default is that we now have no timeout on
888// Stop().  Should only use if you experience problems with the default.
889const char kSyncerThreadTimedStop[]         = "syncer-thread-timed-stop";
890
891// Override the default notification method for sync.
892const char kSyncNotificationMethod[]        = "sync-notification-method";
893
894// Override the default host used for sync notifications.  Can be either
895// "host" or "host:port".
896const char kSyncNotificationHost[]          = "sync-notification-host";
897
898// Override the default server used for profile sync.
899const char kSyncServiceURL[]                = "sync-url";
900
901// Try to connect to XMPP using SSLTCP first (for testing).
902const char kSyncTrySsltcpFirstForXmpp[]     = "sync-try-ssltcp-first-for-xmpp";
903
904// Pass the name of the current running automated test to Chrome.
905const char kTestName[]                      = "test-name";
906
907// Runs the security test for the NaCl loader sandbox.
908const char kTestNaClSandbox[]               = "test-nacl-sandbox";
909
910// Pass the type of the current test harness ("browser" or "ui")
911const char kTestType[]                      = "test-type";
912
913// The value of this switch tells the app to listen for and broadcast
914// testing-related messages on IPC channel with the given ID.
915const char kTestingChannelID[]              = "testing-channel";
916
917// Excludes these plugins from the plugin sandbox.
918// This is a comma-separated list of plugin library names.
919const char kTrustedPlugins[]                = "trusted-plugins";
920
921// Experimental. Shows a dialog asking the user to try chrome. This flag
922// is to be used only by the upgrade process.
923const char kTryChromeAgain[]                = "try-chrome-again";
924
925// Runs un-installation steps that were done by chrome first-run.
926const char kUninstall[]                     = "uninstall";
927
928// Use Spdy for the transport protocol instead of HTTP.
929// This is a temporary testing flag.
930const char kUseSpdy[]                       = "use-spdy";
931
932// Ignore certificate related errors.
933const char kIgnoreCertificateErrors[]       = "ignore-certificate-errors";
934
935// Set the maximum SPDY sessions per domain.
936const char kMaxSpdySessionsPerDomain[]      = "max-spdy-sessions-per-domain";
937
938// Set the maximum concurrent streams over a SPDY session.
939const char kMaxSpdyConcurrentStreams[]      = "max-spdy-concurrent-streams";
940
941// Specifies the user data directory, which is where the browser will look
942// for all of its state.
943const char kUserDataDir[]                   = "user-data-dir";
944
945// directory to locate user scripts in as an over-ride of the default
946const char kUserScriptsDir[]                = "user-scripts-dir";
947
948// On POSIX only: the contents of this flag are prepended to the utility
949// process command line. Useful values might be "valgrind" or "xterm -e gdb
950// --args".
951const char kUtilityCmdPrefix[]              = "utility-cmd-prefix";
952
953// Print version information and quit.
954const char kVersion[]                       = "version";
955
956// Use WinHTTP to fetch and evaluate PAC scripts. Otherwise the default is
957// to use Chromium's network stack to fetch, and V8 to evaluate.
958const char kWinHttpProxyResolver[]          = "winhttp-proxy-resolver";
959
960#if defined(OS_CHROMEOS)
961// Enable DOM based login screens.
962const char kDOMLogin[]                      = "dom-login";
963
964// Enables device policy support on ChromeOS.
965const char kEnableDevicePolicy[]            = "enable-device-policy";
966
967// Enable all 802.1X EAP Wi-Fi connection modes, like EAP-TLS and LEAP.
968// TODO(jamescook): Remove this when all major 802.1X modes are supported
969// through the full network stack, specifically those that require TPM and
970// client-side certificates.
971const char kEnableExperimentalEap[]         = "enable-experimental-eap";
972
973// Enables VPN support on ChromeOS.
974const char kEnableVPN[]                     = "enable-vpn";
975
976// Enable the redirection of viewable document requests to the Google
977// Document Viewer.
978const char kEnableGView[]                   = "enable-gview";
979
980// Should we show the image based login?
981const char kEnableLoginImages[]             = "enable-login-images";
982
983// Enable Chrome-as-a-login-manager behavior.
984const char kLoginManager[]                  = "login-manager";
985
986// Allows to override the first login screen. The value should be the name
987// of the first login screen to show (see
988// chrome/browser/chromeos/login/login_wizard_view.cc for actual names).
989// Ignored if kLoginManager is not specified.
990// TODO(avayvod): Remove when the switch is no longer needed for testing.
991const char kLoginScreen[]                   = "login-screen";
992
993// Allows control over the initial login screen size. Pass width,height.
994const char kLoginScreenSize[]               = "login-screen-size";
995
996// Attempts to load libcros and validate it, then exits. A nonzero return code
997// means the library could not be loaded correctly.
998const char kTestLoadLibcros[]               = "test-load-libcros";
999
1000// Specifies the profile to use once a chromeos user is logged in.
1001const char kLoginProfile[]                  = "login-profile";
1002
1003// Specifies the user which is already logged in.
1004const char kLoginUser[]                     = "login-user";
1005// Specifies a password to be used to login (along with login-user).
1006const char kLoginPassword[]                 = "login-password";
1007
1008// Allows to emulate situation when user logins with new password.
1009const char kLoginUserWithNewPassword[]      = "login-user-with-new-password";
1010
1011// Attempts to perform Chrome OS offline and online login in parallel.
1012const char kParallelAuth[]                  = "parallel-auth";
1013
1014// Use the frame layout used in chromeos.
1015const char kChromeosFrame[]                 = "chromeos-frame";
1016
1017// Use the given language for UI in the input method candidate window.
1018const char kCandidateWindowLang[]           = "lang";
1019
1020// Indicates that the browser is in "browse without sign-in" (Guest session)
1021// mode. Should completely disable extensions, sync and bookmarks.
1022const char kGuestSession[]                  = "bwsi";
1023
1024// Indicates that stub implementations of the libcros library should be used.
1025// This is typically used to test the chromeos build of chrome on the desktop.
1026const char kStubCros[]                      = "stub-cros";
1027
1028// URL of the html page for Screen Saver.
1029const char kScreenSaverUrl[]                = "screen-saver-url";
1030
1031// Flag to trigger ChromeOS system log compression during feedback submit.
1032const char kCompressSystemFeedback[]        = "compress-sys-feedback";
1033
1034// Flag to skip loading ChromeOS specific component extensions. This one is
1035// needed to prevent these component interfering with the some of the tests.
1036// TODO(zelidrag): http://crosbug.com/14463 - we should remove this switch once
1037// get rid of ChromeOS component extensions with background pages.
1038const char kSkipChromeOSComponents[]        = "skip-chromeos-components";
1039
1040// Forces usage of libcros stub implementation. For testing purposes, this
1041// switch separates chrome code from the rest of ChromeOS.
1042const char kForceStubLibcros[]              = "force-stub-libcros";
1043
1044// Enables Advanced File System.
1045const char kEnableAdvancedFileSystem[]      = "enable-advanced-fs";
1046#endif
1047
1048#if defined(OS_LINUX)
1049// Specify the amount the trackpad should scroll by.
1050const char kScrollPixels[]                  = "scroll-pixels";
1051#endif
1052
1053#if defined(OS_MACOSX) || defined(OS_WIN)
1054// Use the system SSL library (Secure Transport on Mac, SChannel on Windows)
1055// instead of NSS for SSL.
1056const char kUseSystemSSL[]                  = "use-system-ssl";
1057#endif
1058
1059#if defined(OS_POSIX)
1060// A flag, generated internally by Chrome for renderer and other helper process
1061// command lines on Linux and Mac.  It tells the helper process to enable crash
1062// dumping and reporting, because helpers cannot access the profile or other
1063// files needed to make this decision.
1064const char kEnableCrashReporter[]           = "enable-crash-reporter";
1065
1066// Bypass the error dialog when the profile lock couldn't be attained.
1067// This switch is used during automated testing.
1068const char kNoProcessSingletonDialog[]      = "no-process-singleton-dialog";
1069
1070#if !defined(OS_MACOSX) && !defined(OS_CHROMEOS)
1071// Specifies which password store to use (detect, default, gnome, kwallet).
1072const char kPasswordStore[]                 = "password-store";
1073#endif
1074#endif
1075
1076#if defined(OS_MACOSX)
1077// Enables the tabs expose feature ( http://crbug.com/50307 ).
1078const char kEnableExposeForTabs[]           = "enable-expose-for-tabs";
1079#endif
1080
1081#if !defined(OS_MACOSX)
1082// Enable Kiosk mode.
1083const char kKioskMode[]                     = "kiosk";
1084#endif
1085
1086// Enables the experimental global gnome menu.
1087#if defined(TOOLKIT_GTK)
1088extern const char kGlobalGnomeMenu[]        = "global-gnome-menu";
1089#endif
1090
1091// Enables debug paint in views framework. Enabling this causes the damaged
1092// region being painted to flash in red.
1093#if defined(TOOLKIT_VIEWS)
1094const char kDebugViewsPaint[]               = "debug-views-paint";
1095#endif
1096
1097// Debug only switch to prevent the mouse cursor from disappearing when
1098// touch is enabled
1099#if defined(TOUCH_UI)
1100const char kKeepMouseCursor[]               = "keep-mouse-cursor";
1101#endif
1102
1103#ifndef NDEBUG
1104// Clear the token service before using it.  This allows simulating
1105// the expiration of credentials during testing.
1106const char kClearTokenService[]             = "clear-token-service";
1107
1108// Sets a token in the token service, for testing.
1109const char kSetToken[]                      = "set-token";
1110
1111// Debug only switch to specify which websocket live experiment host to be used.
1112// If host is specified, it also makes initial delay shorter (5 min to 5 sec)
1113// to make it faster to test websocket live experiment code.
1114const char kWebSocketLiveExperimentHost[]   = "websocket-live-experiment-host";
1115
1116// Debug only switch to give access to all private extension APIs to
1117// any non-component extension that is requesting it.
1118const char kExposePrivateExtensionApi[]   = "expose-private-extension-api";
1119#endif
1120
1121#if defined(HAVE_XINPUT2)
1122// Tells chrome to interpret events from these devices as touch events. Only
1123// available with XInput 2 (i.e. X server 1.8 or above). The id's of the devices
1124// can be retrieved from 'xinput list'.
1125const char kTouchDevices[]                  = "touch-devices";
1126#endif
1127
1128
1129// -----------------------------------------------------------------------------
1130// DO NOT ADD YOUR CRAP TO THE BOTTOM OF THIS FILE.
1131//
1132// You were going to just dump your switches here, weren't you? Instead,
1133// please put them in alphabetical order above, or in order inside the
1134// appropriate ifdef at the bottom. The order should match the header.
1135// -----------------------------------------------------------------------------
1136
1137}  // namespace switches
1138