chrome_switches.cc 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  1. // Copyright (c) 2012 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. #include "chrome/common/chrome_switches.h"
  5. #include "build/build_config.h"
  6. #include "build/chromeos_buildflags.h"
  7. #include "ppapi/buildflags/buildflags.h"
  8. #include "printing/buildflags/buildflags.h"
  9. namespace switches {
  10. // -----------------------------------------------------------------------------
  11. // Can't find the switch you are looking for? Try looking in:
  12. // ash/constants/ash_switches.cc
  13. // base/base_switches.cc
  14. // etc.
  15. //
  16. // When commenting your switch, please use the same voice as surrounding
  17. // comments. Imagine "This switch..." at the beginning of the phrase, and it'll
  18. // all work out.
  19. // -----------------------------------------------------------------------------
  20. // Specifies Accept-Language to send to servers and expose to JavaScript via the
  21. // navigator.language DOM property. language[-country] where language is the 2
  22. // letter code from ISO-639.
  23. const char kAcceptLang[] = "accept-lang";
  24. // Allows third-party content included on a page to prompt for a HTTP basic
  25. // auth username/password pair.
  26. const char kAllowCrossOriginAuthPrompt[] = "allow-cross-origin-auth-prompt";
  27. // Allow non-secure origins to use the screen capture API and the desktopCapture
  28. // extension API.
  29. const char kAllowHttpScreenCapture[] = "allow-http-screen-capture";
  30. // Allows profiles to be created outside of the user data dir.
  31. // TODO(https://crbug.com/1060366): Various places in Chrome assume that all
  32. // profiles are within the user data dir. Some tests need to violate that
  33. // assumption. The switch should be removed after this workaround is no longer
  34. // needed.
  35. const char kAllowProfilesOutsideUserDir[] = "allow-profiles-outside-user-dir";
  36. // By default, an https page cannot run JavaScript, CSS or plugins from http
  37. // URLs. This provides an override to get the old insecure behavior.
  38. const char kAllowRunningInsecureContent[] = "allow-running-insecure-content";
  39. // Allows Web Push notifications that do not show a notification.
  40. const char kAllowSilentPush[] = "allow-silent-push";
  41. // Specifies that the associated value should be launched in "application"
  42. // mode.
  43. const char kApp[] = "app";
  44. // Specifies that the extension-app with the specified id should be launched
  45. // according to its configuration.
  46. const char kAppId[] = "app-id";
  47. // Overrides the launch url of an app with the specified url. This is used
  48. // along with kAppId to launch a given app with the url corresponding to an item
  49. // in the app's shortcuts menu.
  50. const char kAppLaunchUrlForShortcutsMenuItem[] =
  51. "app-launch-url-for-shortcuts-menu-item";
  52. // Value of GAIA auth code for --force-app-mode.
  53. const char kAppModeAuthCode[] = "app-mode-auth-code";
  54. // Value of OAuth2 refresh token for --force-app-mode.
  55. const char kAppModeOAuth2Token[] = "app-mode-oauth-token";
  56. // This is used along with kAppId to indicate an app was launched during
  57. // OS login, and which mode the app was launched in.
  58. const char kAppRunOnOsLoginMode[] = "app-run-on-os-login-mode";
  59. // The URL that the webstore APIs download extensions from.
  60. // Note: the URL must contain one '%s' for the extension ID.
  61. const char kAppsGalleryDownloadURL[] = "apps-gallery-download-url";
  62. // The update url used by gallery/webstore extensions.
  63. const char kAppsGalleryUpdateURL[] = "apps-gallery-update-url";
  64. // The URL to use for the gallery link in the app launcher.
  65. const char kAppsGalleryURL[] = "apps-gallery-url";
  66. // Allowlist for Negotiate Auth servers
  67. const char kAuthServerAllowlist[] = "auth-server-allowlist";
  68. const char kAuthServerAllowlistDeprecated[] =
  69. "auth-server-whitelist"; // nocheck
  70. // This flag makes Chrome auto-open DevTools window for each tab. It is
  71. // intended to be used by developers and automation to not require user
  72. // interaction for opening DevTools.
  73. const char kAutoOpenDevToolsForTabs[] = "auto-open-devtools-for-tabs";
  74. // This flag makes Chrome auto-select the provided choice when an extension asks
  75. // permission to start desktop capture. Should only be used for tests. For
  76. // instance, --auto-select-desktop-capture-source="Entire screen" will
  77. // automatically select sharing the entire screen in English locales. The switch
  78. // value only needs to be substring of the capture source name, i.e. "display"
  79. // would match "Built-in display" and "External display", whichever comes first.
  80. const char kAutoSelectDesktopCaptureSource[] =
  81. "auto-select-desktop-capture-source";
  82. // This flag makes Chrome auto-select a tab with the provided title when
  83. // the media-picker should otherwise be displayed to the user. This switch
  84. // is very similar to kAutoSelectDesktopCaptureSource, but limits selection
  85. // to tabs. This solves the issue of kAutoSelectDesktopCaptureSource being
  86. // liable to accidentally capturing the Chromium window instead of the tab,
  87. // as both have the same title if the tab is focused.
  88. const char kAutoSelectTabCaptureSourceByTitle[] =
  89. "auto-select-tab-capture-source-by-title";
  90. // How often (in seconds) to check for updates. Should only be used for testing
  91. // purposes.
  92. const char kCheckForUpdateIntervalSec[] = "check-for-update-interval";
  93. // Comma-separated list of SSL cipher suites to disable.
  94. const char kCipherSuiteBlacklist[] = "cipher-suite-blacklist";
  95. // Comma-separated list of BrowserThreads that cause browser process to crash if
  96. // the given browser thread is not responsive. UI/IO are the BrowserThreads that
  97. // are supported.
  98. //
  99. // For example:
  100. // --crash-on-hang-threads=UI:18,IO:18 --> Crash the browser if UI or IO is
  101. // not responsive for 18 seconds while the other browser thread is
  102. // responsive.
  103. const char kCrashOnHangThreads[] = "crash-on-hang-threads";
  104. // Some platforms like ChromeOS default to empty desktop.
  105. // Browser tests may need to add this switch so that at least one browser
  106. // instance is created on startup.
  107. // TODO(nkostylev): Investigate if this switch could be removed.
  108. // (http://crbug.com/148675)
  109. const char kCreateBrowserOnStartupForTests[] =
  110. "create-browser-on-startup-for-tests";
  111. // Prints licensing information (same content as found in about:credits) and
  112. // quits.
  113. const char kCredits[] = "credits";
  114. // Specifies the http:// endpoint which will be used to serve
  115. // devtools://devtools/custom/<path>
  116. // Or a file:// URL to specify a custom file path to load from for
  117. // devtools://devtools/bundled/<path>
  118. const char kCustomDevtoolsFrontend[] = "custom-devtools-frontend";
  119. // Enables a frame context menu item that toggles the frame in and out of glass
  120. // mode (Windows Vista and up only).
  121. const char kDebugEnableFrameToggle[] = "debug-enable-frame-toggle";
  122. // Adds debugging entries such as Inspect Element to context menus of packed
  123. // apps.
  124. const char kDebugPackedApps[] = "debug-packed-apps";
  125. // Passes command line parameters to the DevTools front-end.
  126. const char kDevToolsFlags[] = "devtools-flags";
  127. // Triggers a plethora of diagnostic modes.
  128. const char kDiagnostics[] = "diagnostics";
  129. // Sets the output format for diagnostic modes enabled by diagnostics flag.
  130. const char kDiagnosticsFormat[] = "diagnostics-format";
  131. // Tells the diagnostics mode to do the requested recovery step(s).
  132. const char kDiagnosticsRecovery[] = "diagnostics-recovery";
  133. #if BUILDFLAG(IS_CHROMEOS)
  134. // Disables the auto maximize feature on ChromeOS so that a browser window
  135. // always starts in normal state. This is used by tests that do not want this
  136. // auto maximizing behavior.
  137. const char kDisableAutoMaximizeForTests[] = "disable-auto-maximize-for-tests";
  138. #endif
  139. // Disable several subsystems which run network requests in the background.
  140. // This is for use when doing network performance testing to avoid noise in the
  141. // measurements.
  142. const char kDisableBackgroundNetworking[] = "disable-background-networking";
  143. // Disable default component extensions with background pages - useful for
  144. // performance tests where these pages may interfere with perf results.
  145. const char kDisableComponentExtensionsWithBackgroundPages[] =
  146. "disable-component-extensions-with-background-pages";
  147. const char kDisableComponentUpdate[] = "disable-component-update";
  148. // Disables installation of default apps on first run. This is used during
  149. // automated testing.
  150. const char kDisableDefaultApps[] = "disable-default-apps";
  151. // Disables Domain Reliability Monitoring.
  152. const char kDisableDomainReliability[] = "disable-domain-reliability";
  153. // Disable extensions.
  154. const char kDisableExtensions[] = "disable-extensions";
  155. // Disable extensions except those specified in a comma-separated list.
  156. const char kDisableExtensionsExcept[] = "disable-extensions-except";
  157. // Disable checking for user opt-in for extensions that want to inject script
  158. // into file URLs (ie, always allow it). This is used during automated testing.
  159. const char kDisableExtensionsFileAccessCheck[] =
  160. "disable-extensions-file-access-check";
  161. // Disables print preview (For testing, and for users who don't like us. :[ )
  162. const char kDisablePrintPreview[] = "disable-print-preview";
  163. // Normally when the user attempts to navigate to a page that was the result of
  164. // a post we prompt to make sure they want to. This switch may be used to
  165. // disable that check. This switch is used during automated testing.
  166. const char kDisablePromptOnRepost[] = "disable-prompt-on-repost";
  167. // Disable stack profiling. Stack profiling may change performance. Disabling
  168. // stack profiling is beneficial when comparing performance metrics with a
  169. // build that has it disabled by default.
  170. const char kDisableStackProfiler[] = "disable-stack-profiler";
  171. // Some tests seem to require the application to close when the last
  172. // browser window is closed. Thus, we need a switch to force this behavior
  173. // for ChromeOS Aura, disable "zero window mode".
  174. // TODO(pkotwicz): Investigate if this bug can be removed.
  175. // (http://crbug.com/119175)
  176. const char kDisableZeroBrowsersOpenForTests[] =
  177. "disable-zero-browsers-open-for-tests";
  178. // Use a specific disk cache location, rather than one derived from the
  179. // UserDatadir.
  180. const char kDiskCacheDir[] = "disk-cache-dir";
  181. // Forces the maximum disk space to be used by the disk cache, in bytes.
  182. const char kDiskCacheSize[] = "disk-cache-size";
  183. // Requests that a running browser process dump its collected histograms to a
  184. // given file. The file is overwritten if it exists.
  185. const char kDumpBrowserHistograms[] = "dump-browser-histograms";
  186. // If the WebRTC logging private API is active, enables audio debug recordings.
  187. const char kEnableAudioDebugRecordingsFromExtension[] =
  188. "enable-audio-debug-recordings-from-extension";
  189. // Enables the multi-level undo system for bookmarks.
  190. const char kEnableBookmarkUndo[] = "enable-bookmark-undo";
  191. // This applies only when the process type is "service". Enables the Cloud Print
  192. // Proxy component within the service process.
  193. const char kEnableCloudPrintProxy[] = "enable-cloud-print-proxy";
  194. // Enables CriticalPersistedTabData - redesign/replacement for TabState
  195. const char kEnableCriticalPersistedTabData[] =
  196. "enable-critical-persisted-tab-data";
  197. // Enables Domain Reliability Monitoring.
  198. const char kEnableDomainReliability[] = "enable-domain-reliability";
  199. // Enables logging for extension activity.
  200. const char kEnableExtensionActivityLogging[] =
  201. "enable-extension-activity-logging";
  202. const char kEnableExtensionActivityLogTesting[] =
  203. "enable-extension-activity-log-testing";
  204. // Force enabling HangoutServicesExtension.
  205. const char kEnableHangoutServicesExtensionForTesting[] =
  206. "enable-hangout-services-extension-for-testing";
  207. // Runs the Native Client inside the renderer process and enables GPU plugin
  208. // (internally adds lEnableGpuPlugin to the command line).
  209. const char kEnableNaCl[] = "enable-nacl";
  210. // Enables the network-related benchmarking extensions.
  211. const char kEnableNetBenchmarking[] = "enable-net-benchmarking";
  212. // Enables a number of potentially annoying security features (strict mixed
  213. // content mode, powerful feature restrictions, etc.)
  214. const char kEnablePotentiallyAnnoyingSecurityFeatures[] =
  215. "enable-potentially-annoying-security-features";
  216. // Allows overriding the list of restricted ports by passing a comma-separated
  217. // list of port numbers.
  218. const char kExplicitlyAllowedPorts[] = "explicitly-allowed-ports";
  219. // Name of the command line flag to force content verification to be on in one
  220. // of various modes.
  221. const char kExtensionContentVerification[] = "extension-content-verification";
  222. // Values for the kExtensionContentVerification flag.
  223. // See ContentVerifierDelegate::Mode for more explanation.
  224. const char kExtensionContentVerificationBootstrap[] = "bootstrap";
  225. const char kExtensionContentVerificationEnforce[] = "enforce";
  226. const char kExtensionContentVerificationEnforceStrict[] = "enforce_strict";
  227. // Turns on extension install verification if it would not otherwise have been
  228. // turned on.
  229. const char kExtensionsInstallVerification[] = "extensions-install-verification";
  230. // Specifies a comma-separated list of extension ids that should be forced to
  231. // be treated as not from the webstore when doing install verification.
  232. const char kExtensionsNotWebstore[] = "extensions-not-webstore";
  233. // Forces application mode. This hides certain system UI elements and forces
  234. // the app to be installed if it hasn't been already.
  235. const char kForceAppMode[] = "force-app-mode";
  236. // Displays the First Run experience when the browser is started, regardless of
  237. // whether or not it's actually the First Run (this overrides kNoFirstRun).
  238. const char kForceFirstRun[] = "force-first-run";
  239. // Displays the What's New experience when the browser is started if it has not
  240. // yet been shown for the current milestone (this overrides kNoFirstRun, without
  241. // showing the First Run experience).
  242. const char kForceWhatsNew[] = "force-whats-new";
  243. // Does not show the crash restore bubble when the browser is started during the
  244. // system startup phase in ChromeOS, if the ChromeOS full restore feature is
  245. // enabled, because the ChromeOS full restore notification is shown for the user
  246. // to select restore or not.
  247. const char kHideCrashRestoreBubble[] = "hide-crash-restore-bubble";
  248. // Specifies which page will be displayed in newly-opened tabs. We need this
  249. // for testing purposes so that the UI tests don't depend on what comes up for
  250. // http://google.com.
  251. const char kHomePage[] = "homepage";
  252. // Causes the browser to launch directly in incognito mode.
  253. const char kIncognito[] = "incognito";
  254. #if BUILDFLAG(IS_CHROMEOS_LACROS)
  255. // Manually sets the initial preferences file. This is required to change the
  256. // initial preferences when the default file is read-only (eg. on lacros).
  257. // Passing this flag will reset the preferences regardless of whether this is
  258. // the first run.
  259. const char kInitialPreferencesFile[] = "initial-preferences-file";
  260. #endif
  261. // Installs an autogenerated theme based on the given RGB value.
  262. // The format is "r,g,b", where r, g, b are a numeric values from 0 to 255.
  263. const char kInstallAutogeneratedTheme[] = "install-autogenerated-theme";
  264. // Causes Chrome to initiate an installation flow for the given app.
  265. const char kInstallChromeApp[] = "install-chrome-app";
  266. const char kInstallIsolatedAppsAtStartup[] = "install-isolated-apps-at-startup";
  267. // Marks a renderer as an Instant process.
  268. const char kInstantProcess[] = "instant-process";
  269. // Used for testing - keeps browser alive after last browser window closes.
  270. const char kKeepAliveForTest[] = "keep-alive-for-test";
  271. // Enable kiosk mode. Please note this is not Chrome OS kiosk mode.
  272. const char kKioskMode[] = "kiosk";
  273. // Enable automatically pressing the print button in print preview.
  274. const char kKioskModePrinting[] = "kiosk-printing";
  275. // Makes Chrome default browser
  276. const char kMakeDefaultBrowser[] = "make-default-browser";
  277. // Allows setting a different destination ID for connection-monitoring GCM
  278. // messages. Useful when running against a non-prod management server.
  279. const char kMonitoringDestinationID[] = "monitoring-destination-id";
  280. // Requests a native messaging connection be established between the native
  281. // messaging host named by this switch and the extension with ID specified by
  282. // kNativeMessagingConnectExtension.
  283. const char kNativeMessagingConnectHost[] = "native-messaging-connect-host";
  284. // Requests a native messaging connection be established between the extension
  285. // with ID specified by this switch and the native messaging host named by the
  286. // kNativeMessagingConnectHost switch.
  287. const char kNativeMessagingConnectExtension[] =
  288. "native-messaging-connect-extension";
  289. // If set when kNativeMessagingConnectHost and kNativeMessagingConnectExtension
  290. // are specified, is reflected to the native messaging host as a command line
  291. // parameter.
  292. const char kNativeMessagingConnectId[] = "native-messaging-connect-id";
  293. // Disables the default browser check. Useful for UI/browser tests where we
  294. // want to avoid having the default browser info-bar displayed.
  295. const char kNoDefaultBrowserCheck[] = "no-default-browser-check";
  296. // Disables all experiments set on about:flags. Does not disable about:flags
  297. // itself. Useful if an experiment makes chrome crash at startup: One can start
  298. // chrome with --no-experiments, disable the problematic lab at about:flags and
  299. // then restart chrome without this switch again.
  300. const char kNoExperiments[] = "no-experiments";
  301. // Skip First Run tasks, whether or not it's actually the First Run, and the
  302. // What's New page. Overridden by kForceFirstRun (for FRE) and kForceWhatsNew
  303. // (for What's New). This does not drop the First Run sentinel and thus doesn't
  304. // prevent first run from occurring the next time chrome is launched without
  305. // this flag. It also does not update the last What's New milestone, so does not
  306. // prevent What's New from occurring the next time chrome is launched without
  307. // this flag.
  308. const char kNoFirstRun[] = "no-first-run";
  309. // Don't send hyperlink auditing pings
  310. const char kNoPings[] = "no-pings";
  311. // Don't use a proxy server, always make direct connections. Overrides any
  312. // other proxy server flags that are passed.
  313. const char kNoProxyServer[] = "no-proxy-server";
  314. // Disables the service process from adding itself as an autorun process. This
  315. // does not delete existing autorun registrations, it just prevents the service
  316. // from registering a new one.
  317. const char kNoServiceAutorun[] = "no-service-autorun";
  318. // Does not automatically open a browser window on startup (used when
  319. // launching Chrome for the purpose of hosting background apps).
  320. const char kNoStartupWindow[] = "no-startup-window";
  321. // Calculate the hash of an MHTML file as it is being saved.
  322. // The browser process will write the serialized MHTML contents to a file and
  323. // calculate its hash as it is streamed back from the renderer via a Mojo data
  324. // pipe.
  325. const char kOnTheFlyMhtmlHashComputation[] =
  326. "on-the-fly-mhtml-hash-computation";
  327. // Launches URL in new browser window.
  328. const char kOpenInNewWindow[] = "new-window";
  329. // Packages an extension to a .crx installable file from a given directory.
  330. const char kPackExtension[] = "pack-extension";
  331. // Optional PEM private key to use in signing packaged .crx.
  332. const char kPackExtensionKey[] = "pack-extension-key";
  333. // Causes the browser process to crash very early in startup, just before
  334. // crashpad (or breakpad) is initialized.
  335. const char kPreCrashpadCrashTest[] = "pre-crashpad-crash-test";
  336. // Used to mock the response received from the Web Permission Prediction
  337. // Service. Used for testing.
  338. const char kPredictionServiceMockLikelihood[] =
  339. "prediction-service-mock-likelihood";
  340. // A directory where Chrome looks for json files describing default/preinstalled
  341. // web apps. This overrides any default directory to load preinstalled web apps
  342. // from.
  343. const char kPreinstalledWebAppsDir[] = "preinstalled-web-apps-dir";
  344. // Use IPv6 only for privet HTTP.
  345. const char kPrivetIPv6Only[] = "privet-ipv6-only";
  346. // Outputs the product version information and quit. Used as an internal api to
  347. // detect the installed version of Chrome on Linux.
  348. const char kProductVersion[] = "product-version";
  349. // Selects directory of profile to associate with the first browser launched.
  350. const char kProfileDirectory[] = "profile-directory";
  351. // Like kProfileDirectory, but selects the profile by email address. If the
  352. // email is not found in any existing profile, this switch has no effect. If
  353. // both kProfileDirectory and kProfileUserName are specified, kProfileDirectory
  354. // takes priority.
  355. const char kProfileEmail[] = "profile-email";
  356. // Forces proxy auto-detection.
  357. const char kProxyAutoDetect[] = "proxy-auto-detect";
  358. // Specifies a list of hosts for whom we bypass proxy settings and use direct
  359. // connections. Ignored if --proxy-auto-detect or --no-proxy-server are also
  360. // specified. This is a comma-separated list of bypass rules. See:
  361. // "net/proxy_resolution/proxy_bypass_rules.h" for the format of these rules.
  362. const char kProxyBypassList[] = "proxy-bypass-list";
  363. // Uses the pac script at the given URL
  364. const char kProxyPacUrl[] = "proxy-pac-url";
  365. // Porvides a list of addresses to discover DevTools remote debugging targets.
  366. // The format is <host>:<port>,...,<host>:port.
  367. const char kRemoteDebuggingTargets[] = "remote-debugging-targets";
  368. // Indicates the last session should be restored on startup. This overrides the
  369. // preferences value. Note that this does not force automatic session restore
  370. // following a crash, so as to prevent a crash loop. This switch is used to
  371. // implement support for OS-specific "continue where you left off" functionality
  372. // on OS X and Windows.
  373. const char kRestoreLastSession[] = "restore-last-session";
  374. // Disable saving pages as HTML-only, disable saving pages as HTML Complete
  375. // (with a directory of sub-resources). Enable only saving pages as MHTML.
  376. // See http://crbug.com/120416 for how to remove this switch.
  377. const char kSavePageAsMHTML[] = "save-page-as-mhtml";
  378. // Does not show an infobar when an extension attaches to a page using
  379. // chrome.debugger page. Required to attach to extension background pages.
  380. const char kSilentDebuggerExtensionAPI[] = "silent-debugger-extension-api";
  381. // Causes Chrome to launch without opening any windows by default. Useful if
  382. // one wishes to use Chrome as an ash server.
  383. const char kSilentLaunch[] = "silent-launch";
  384. // Simulates a critical update being available.
  385. const char kSimulateCriticalUpdate[] = "simulate-critical-update";
  386. // Simulates that elevation is needed to recover upgrade channel.
  387. const char kSimulateElevatedRecovery[] = "simulate-elevated-recovery";
  388. // Simulates that current version is outdated.
  389. const char kSimulateOutdated[] = "simulate-outdated";
  390. // Simulates that current version is outdated and auto-update is off.
  391. const char kSimulateOutdatedNoAU[] = "simulate-outdated-no-au";
  392. // Simulates an update being available.
  393. const char kSimulateUpgrade[] = "simulate-upgrade";
  394. // Specifies the maximum SSL/TLS version ("tls1.2" or "tls1.3").
  395. const char kSSLVersionMax[] = "ssl-version-max";
  396. // Specifies the minimum SSL/TLS version ("tls1.2" or "tls1.3").
  397. const char kSSLVersionMin[] = "ssl-version-min";
  398. // TLS 1.2 mode for |kSSLVersionMax| and |kSSLVersionMin| switches.
  399. const char kSSLVersionTLSv12[] = "tls1.2";
  400. // TLS 1.3 mode for |kSSLVersionMax| and |kSSLVersionMin| switches.
  401. const char kSSLVersionTLSv13[] = "tls1.3";
  402. // Starts the browser maximized, regardless of any previous settings.
  403. const char kStartMaximized[] = "start-maximized";
  404. // Starts the stack sampling profiler in the child process.
  405. const char kStartStackProfiler[] = "start-stack-profiler";
  406. // Browser test mode for the |kStartStackProfiler| switch. Limits the profile
  407. // durations to be significantly less than the test timeout.
  408. const char kStartStackProfilerBrowserTest[] = "browser-test";
  409. // Interval, in minutes, used for storage pressure notification throttling.
  410. // Useful for developers testing applications that might use non-trivial
  411. // amounts of disk space.
  412. const char kStoragePressureNotificationInterval[] =
  413. "storage-pressure-notification-interval";
  414. // Sets the supervised user ID for any loaded or newly created profile to the
  415. // given value. Pass an empty string to mark the profile as non-supervised.
  416. // Used for testing.
  417. const char kSupervisedUserId[] = "managed-user-id";
  418. // Frequency in Milliseconds for system log uploads. Should only be used for
  419. // testing purposes.
  420. const char kSystemLogUploadFrequency[] = "system-log-upload-frequency";
  421. // This flag makes Chrome auto-accept/reject requests to capture the current
  422. // tab. It should only be used for tests.
  423. const char kThisTabCaptureAutoAccept[] = "auto-accept-this-tab-capture";
  424. const char kThisTabCaptureAutoReject[] = "auto-reject-this-tab-capture";
  425. // Passes the name of the current running automated test to Chrome.
  426. const char kTestName[] = "test-name";
  427. // Identifies a list of download sources as trusted, but only if proper group
  428. // policy is set.
  429. const char kTrustedDownloadSources[] = "trusted-download-sources";
  430. // Experimental. Shows a dialog asking the user to try chrome. This flag is to
  431. // be used only by the upgrade process.
  432. const char kTryChromeAgain[] = "try-chrome-again";
  433. // Overrides per-origin quota settings to unlimited storage for any
  434. // apps/origins. This should be used only for testing purpose.
  435. const char kUnlimitedStorage[] = "unlimited-storage";
  436. // Specifies the user data directory, which is where the browser will look for
  437. // all of its state.
  438. const char kUserDataDir[] = "user-data-dir";
  439. // Uses WinHttp to resolve proxies instead of using Chromium's normal proxy
  440. // resolution logic. This is only supported in Windows.
  441. //
  442. // TODO(https://crbug.com/1032820): Only use WinHttp whenever Chrome is
  443. // exclusively using system proxy configs.
  444. const char kUseSystemProxyResolver[] = "use-system-proxy-resolver";
  445. // Examines a .crx for validity and prints the result.
  446. const char kValidateCrx[] = "validate-crx";
  447. // Prints version information and quits.
  448. const char kVersion[] = "version";
  449. // Sets the delay (in seconds) between proactive prunings of remote-bound
  450. // WebRTC event logs which are pending upload.
  451. // All positive values are legal.
  452. // All negative values are illegal, and ignored.
  453. // If set to 0, the meaning is "no proactive pruning".
  454. const char kWebRtcRemoteEventLogProactivePruningDelta[] =
  455. "webrtc-event-log-proactive-pruning-delta";
  456. // WebRTC event logs will only be uploaded if the conditions hold for this
  457. // many milliseconds.
  458. const char kWebRtcRemoteEventLogUploadDelayMs[] =
  459. "webrtc-event-log-upload-delay-ms";
  460. // Normally, remote-bound WebRTC event logs are uploaded only when no
  461. // peer connections are active. With this flag, the upload is never suppressed.
  462. const char kWebRtcRemoteEventLogUploadNoSuppression[] =
  463. "webrtc-event-log-upload-no-suppression";
  464. // Override WebRTC IP handling policy to mimic the behavior when WebRTC IP
  465. // handling policy is specified in Preferences.
  466. const char kWebRtcIPHandlingPolicy[] = "webrtc-ip-handling-policy";
  467. // Specify the initial window position: --window-position=x,y
  468. const char kWindowPosition[] = "window-position";
  469. // Specify the initial window size: --window-size=w,h
  470. const char kWindowSize[] = "window-size";
  471. // Specify the initial window workspace: --window-workspace=id
  472. const char kWindowWorkspace[] = "window-workspace";
  473. // Uses WinHTTP to fetch and evaluate PAC scripts. Otherwise the default is to
  474. // use Chromium's network stack to fetch, and V8 to evaluate.
  475. const char kWinHttpProxyResolver[] = "winhttp-proxy-resolver";
  476. // Specifies which category option was clicked in the Windows Jumplist that
  477. // resulted in a browser startup.
  478. const char kWinJumplistAction[] = "win-jumplist-action";
  479. #if BUILDFLAG(IS_ANDROID)
  480. // Android authentication account type for SPNEGO authentication
  481. const char kAuthAndroidNegotiateAccountType[] = "auth-spnego-account-type";
  482. // Enable the accessibility tab switcher.
  483. const char kEnableAccessibilityTabSwitcher[] =
  484. "enable-accessibility-tab-switcher";
  485. // Enables a hung renderer InfoBar allowing the user to close or wait on
  486. // unresponsive web content.
  487. const char kEnableHungRendererInfoBar[] = "enable-hung-renderer-infobar";
  488. // Forces the device to report being owned by an enterprise. This mimics the
  489. // presence of an app signaling device ownerhsip.
  490. const char kForceDeviceOwnership[] = "force-device-ownership";
  491. // Forces the night mode to be enabled.
  492. const char kForceEnableNightMode[] = "force-enable-night-mode";
  493. // Forces the update menu badge to show.
  494. const char kForceShowUpdateMenuBadge[] = "force-show-update-menu-badge";
  495. // Forces signin FRE flow.
  496. const char kForceEnableSigninFRE[] = "force-enable-signin-fre";
  497. // Forces the FRE to go through the legacy sync consent flow for testing.
  498. const char kForceDisableSigninFRE[] = "force-disable-signin-fre";
  499. // Forces the update menu type to a specific type.
  500. const char kForceUpdateMenuType[] = "force-update-menu-type";
  501. // Forces a custom summary to be displayed below the update menu item.
  502. const char kForceShowUpdateMenuItemCustomSummary[] = "custom_summary";
  503. // Sets the market URL for Chrome for use in testing.
  504. const char kMarketUrlForTesting[] = "market-url-for-testing";
  505. #endif // BUILDFLAG(IS_ANDROID)
  506. #if BUILDFLAG(IS_CHROMEOS_ASH)
  507. // Custom crosh command.
  508. const char kCroshCommand[] = "crosh-command";
  509. // Disables logging redirect for testing.
  510. const char kDisableLoggingRedirect[] = "disable-logging-redirect";
  511. // Disables apps on the login screen. By default, they are allowed and can be
  512. // installed through policy.
  513. const char kDisableLoginScreenApps[] = "disable-login-screen-apps";
  514. // Use a short (1 second) timeout for merge session loader throttle testing.
  515. const char kShortMergeSessionTimeoutForTest[] =
  516. "short-merge-session-timeout-for-test";
  517. // Selects the scheduler configuration specified in the parameter.
  518. const char kSchedulerConfiguration[] = "scheduler-configuration";
  519. const char kSchedulerConfigurationConservative[] = "conservative";
  520. const char kSchedulerConfigurationPerformance[] = "performance";
  521. // Specifies what the default scheduler configuration value is if the user does
  522. // not set one.
  523. const char kSchedulerConfigurationDefault[] = "scheduler-configuration-default";
  524. #endif // BUILDFLAG(IS_CHROMEOS_ASH)
  525. #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_CHROMEOS_ASH)
  526. // These flags show the man page on Linux. They are equivalent to each
  527. // other.
  528. const char kHelp[] = "help";
  529. const char kHelpShort[] = "h";
  530. // Specifies which encryption storage backend to use. Possible values are
  531. // kwallet, kwallet5, gnome, gnome-keyring, gnome-libsecret, basic. Any other
  532. // value will lead to Chrome detecting the best backend automatically.
  533. // TODO(crbug.com/571003): Once PasswordStore no longer uses the Keyring or
  534. // KWallet for storing passwords, rename this flag to stop referencing
  535. // passwords. Do not rename it sooner, though; developers and testers might
  536. // rely on it keeping large amounts of testing passwords out of their Keyrings
  537. // or KWallets.
  538. const char kPasswordStore[] = "password-store";
  539. // Enables the feature of allowing the user to disable the backend via a
  540. // setting.
  541. const char kEnableEncryptionSelection[] = "enable-encryption-selection";
  542. // The same as the --class argument in X applications. Overrides the WM_CLASS
  543. // window property with the given value.
  544. const char kWmClass[] = "class";
  545. #endif
  546. #if BUILDFLAG(IS_MAC)
  547. // Prevents Chrome from quitting when Chrome Apps are open.
  548. const char kAppsKeepChromeAliveInTests[] = "apps-keep-chrome-alive-in-tests";
  549. // Enable user metrics from within the installer.
  550. const char kEnableUserMetrics[] = "enable-user-metrics";
  551. // This is how the metrics client ID is passed from the browser process to its
  552. // children. With Crashpad, the metrics client ID is distinct from the crash
  553. // client ID.
  554. const char kMetricsClientID[] = "metrics-client-id";
  555. // A process type (switches::kProcessType) that relaunches the browser. See
  556. // chrome/browser/mac/relauncher.h.
  557. const char kRelauncherProcess[] = "relauncher";
  558. // When switches::kProcessType is switches::kRelauncherProcess, if this switch
  559. // is also present, the relauncher process will unmount and eject a mounted disk
  560. // image and move its disk image file to the trash. The argument's value must
  561. // be a BSD device name of the form "diskN" or "diskNsM".
  562. const char kRelauncherProcessDMGDevice[] = "dmg-device";
  563. // Indicates whether Chrome should be set as the default browser during
  564. // installation.
  565. const char kMakeChromeDefault[] = "make-chrome-default";
  566. #endif // BUILDFLAG(IS_MAC)
  567. #if BUILDFLAG(IS_WIN)
  568. // Disables custom-drawing the window titlebar on Windows 10.
  569. const char kDisableWindows10CustomTitlebar[] =
  570. "disable-windows10-custom-titlebar";
  571. // Force-enables the profile shortcut manager. This is needed for tests since
  572. // they use a custom-user-data-dir which disables this.
  573. const char kEnableProfileShortcutManager[] = "enable-profile-shortcut-manager";
  574. // Indicates that this launch of the browser originated from the installer
  575. // (i.e., following a successful new install or over-install). This triggers
  576. // browser behaviors for this specific launch, such as a welcome announcement
  577. // for accessibility software (see https://crbug.com/1072735).
  578. extern const char kFromInstaller[] = "from-installer";
  579. // Makes Windows happy by allowing it to show "Enable access to this program"
  580. // checkbox in Add/Remove Programs->Set Program Access and Defaults. This only
  581. // shows an error box because the only way to hide Chrome is by uninstalling
  582. // it.
  583. const char kHideIcons[] = "hide-icons";
  584. // Whether or not the browser should warn if the profile is on a network share.
  585. // This flag is only relevant for Windows currently.
  586. const char kNoNetworkProfileWarning[] = "no-network-profile-warning";
  587. // Used in combination with kNotificationLaunchId to specify the inline reply
  588. // entered in the toast in the Windows Action Center.
  589. const char kNotificationInlineReply[] = "notification-inline-reply";
  590. // Used for launching Chrome when a toast displayed in the Windows Action Center
  591. // has been activated. Should contain the launch ID encoded by Chrome.
  592. const char kNotificationLaunchId[] = "notification-launch-id";
  593. // /prefetch:# arguments for the browser process launched in background mode and
  594. // for the watcher process. Use profiles 5, 6 and 7 as documented on
  595. // kPrefetchArgument* in content_switches.cc.
  596. const char kPrefetchArgumentBrowserBackground[] = "/prefetch:5";
  597. // /prefetch:6 was formerly used by the watcher but is no longer used.
  598. // /prefetch:7 is used by crashpad, which can't depend on constants defined
  599. // here. See crashpad_win.cc for more details.
  600. // See kHideIcons.
  601. const char kShowIcons[] = "show-icons";
  602. // Runs un-installation steps that were done by chrome first-run.
  603. const char kUninstall[] = "uninstall";
  604. // Specifies that the WebApp with the specified id should be uninstalled.
  605. const char kUninstallAppId[] = "uninstall-app-id";
  606. // Specifies the version of the Progressive-Web-App launcher that launched
  607. // Chrome, used to determine whether to update all launchers.
  608. // NOTE: changing this switch requires adding legacy handling for the previous
  609. // method, as older PWA launchers still using this switch will rely on Chrome to
  610. // update them to use the new method.
  611. const char kPwaLauncherVersion[] = "pwa-launcher-version";
  612. #endif // BUILDFLAG(IS_WIN)
  613. #if BUILDFLAG(ENABLE_PRINT_PREVIEW) && !defined(OFFICIAL_BUILD)
  614. // Enables support to debug printing subsystem.
  615. const char kDebugPrint[] = "debug-print";
  616. #endif
  617. #if BUILDFLAG(ENABLE_PLUGINS)
  618. // Specifies comma-separated list of extension ids or hosts to grant
  619. // access to CRX file system APIs.
  620. const char kAllowNaClCrxFsAPI[] = "allow-nacl-crxfs-api";
  621. // Specifies comma-separated list of extension ids or hosts to grant
  622. // access to file handle APIs.
  623. const char kAllowNaClFileHandleAPI[] = "allow-nacl-file-handle-api";
  624. // Specifies comma-separated list of extension ids or hosts to grant
  625. // access to TCP/UDP socket APIs.
  626. const char kAllowNaClSocketAPI[] = "allow-nacl-socket-api";
  627. #endif
  628. #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
  629. BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA)
  630. const char kEnableNewAppMenuIcon[] = "enable-new-app-menu-icon";
  631. // Causes the browser to launch directly in guest mode.
  632. const char kGuest[] = "guest";
  633. #endif
  634. #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
  635. // Writes open and installed web apps for each profile to the specified file
  636. // without launching a new browser window or tab. Pass a absolute file path to
  637. // specify where to output the information. Can be used together with optional
  638. // --profile-base-name switch to only write information for a given profile.
  639. const char kListApps[] = "list-apps";
  640. // Pass the basename of the profile directory to specify which profile to get
  641. // information. Only relevant when used with --list-apps switch.
  642. const char kProfileBaseName[] = "profile-base-name";
  643. #endif
  644. #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_ANDROID)
  645. // Custom WebAPK server URL for the sake of testing.
  646. const char kWebApkServerUrl[] = "webapk-server-url";
  647. #endif
  648. #if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_ANDROID)
  649. // Uses the system default printer as the initially selected destination in
  650. // print preview, instead of the most recently used destination.
  651. const char kUseSystemDefaultPrinter[] = "use-system-default-printer";
  652. #endif
  653. #if BUILDFLAG(ENABLE_DOWNGRADE_PROCESSING)
  654. // Indicates that this process is the product of a relaunch following migration
  655. // of User Data.
  656. const char kUserDataMigrated[] = "user-data-migrated";
  657. #endif
  658. // -----------------------------------------------------------------------------
  659. // DO NOT ADD YOUR VERY NICE FLAGS TO THE BOTTOM OF THIS FILE.
  660. //
  661. // You were going to just dump your switches here, weren't you? Instead, please
  662. // put them in alphabetical order above, or in order inside the appropriate
  663. // ifdef at the bottom. The order should match the header.
  664. // -----------------------------------------------------------------------------
  665. } // namespace switches