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 
5 #include "chromeos/constants/chromeos_switches.h"
6 
7 #include <string>
8 
9 #include "base/command_line.h"
10 #include "base/metrics/field_trial.h"
11 
12 namespace chromeos {
13 namespace switches {
14 
15 namespace {
16 
17 // The memory pressure thresholds selection which is used to decide whether and
18 // when a memory pressure event needs to get fired.
19 const char kMemoryPressureExperimentName[] = "ChromeOSMemoryPressureHandling";
20 const char kMemoryPressureHandlingOff[] = "memory-pressure-off";
21 
22 // Controls CrOS GaiaId migration for tests ("" is default).
23 const char kTestCrosGaiaIdMigration[] = "test-cros-gaia-id-migration";
24 
25 // Value for kTestCrosGaiaIdMigration indicating that migration is started (i.e.
26 // all stored user keys will be converted to GaiaId)
27 const char kTestCrosGaiaIdMigrationStarted[] = "started";
28 
29 }  // namespace
30 
31 // Please keep the order of these switches synchronized with the header file
32 // (i.e. in alphabetical order).
33 
34 const char kAggressiveCacheDiscardThreshold[] = "aggressive-cache-discard";
35 
36 const char kAggressiveTabDiscardThreshold[] = "aggressive-tab-discard";
37 
38 const char kAggressiveThreshold[] = "aggressive";
39 
40 // If this flag is passed, failed policy fetches will not cause profile
41 // initialization to fail. This is useful for tests because it means that
42 // tests don't have to mock out the policy infrastructure.
43 const char kAllowFailedPolicyFetchForTest[] =
44     "allow-failed-policy-fetch-for-test";
45 
46 // Allows remote attestation (RA) in dev mode for testing purpose. Usually RA
47 // is disabled in dev mode because it will always fail. However, there are cases
48 // in testing where we do want to go through the permission flow even in dev
49 // mode. This can be enabled by this flag.
50 const char kAllowRAInDevMode[] = "allow-ra-in-dev-mode";
51 
52 // Specifies whether an app launched in kiosk mode was auto launched with zero
53 // delay. Used in order to properly restore auto-launched state during session
54 // restore flow.
55 const char kAppAutoLaunched[] = "app-auto-launched";
56 
57 // Path for app's OEM manifest file.
58 const char kAppOemManifestFile[] = "app-mode-oem-manifest";
59 
60 // Signals ARC support status on this device. This can take one of the
61 // following three values.
62 // - none: ARC is not installed on this device. (default)
63 // - installed: ARC is installed on this device, but not officially supported.
64 //   Users can enable ARC only when Finch experiment is turned on.
65 // - officially-supported: ARC is installed and supported on this device. So
66 //   users can enable ARC via settings etc.
67 const char kArcAvailability[] = "arc-availability";
68 
69 // DEPRECATED: Please use --arc-availability=installed.
70 // Signals the availability of the ARC instance on this device.
71 const char kArcAvailable[] = "arc-available";
72 
73 // A JSON dictionary whose content is the same as cros config's
74 // /arc/build-properties.
75 const char kArcBuildProperties[] = "arc-build-properties";
76 
77 // Flag that forces ARC data be cleaned on each start.
78 const char kArcDataCleanupOnStart[] = "arc-data-cleanup-on-start";
79 
80 // Flag that disables ARC app sync flow that installs some apps silently. Used
81 // in autotests to resolve racy conditions.
82 const char kArcDisableAppSync[] = "arc-disable-app-sync";
83 
84 // Flag to enables an experiment to allow users to turn on 64-bit support in
85 // native bridge on systems that have such support available but not yet enabled
86 // by default.
87 const char kArcEnableNativeBridge64BitSupportExperiment[] =
88     "arc-enable-native-bridge-64bit-support-experiment";
89 
90 // Used in autotest to disable GMS-core caches which is on by default.
91 const char kArcDisableGmsCoreCache[] = "arc-disable-gms-core-cache";
92 
93 // Flag that disables ARC locale sync with Android container. Used in autotest
94 // to prevent conditions when certain apps, including Play Store may get
95 // restarted. Restarting Play Store may cause random test failures. Enabling
96 // this flag would also forces ARC container to use 'en-US' as a locale and
97 // 'en-US,en' as preferred languages.
98 const char kArcDisableLocaleSync[] = "arc-disable-locale-sync";
99 
100 // Used for development of Android app that are included into ARC++ as system
101 // default apps in order to be able to install them via adb.
102 const char kArcDisableSystemDefaultApps[] = "arc-disable-system-default-apps";
103 
104 // Flag that disables ARC Play Auto Install flow that installs set of predefined
105 // apps silently. Used in autotests to resolve racy conditions.
106 const char kArcDisablePlayAutoInstall[] = "arc-disable-play-auto-install";
107 
108 // Flag that forces ARC to cache icons for apps.
109 const char kArcForceCacheAppIcons[] = "arc-force-cache-app-icons";
110 
111 // Flag that forces the OptIn ui to be shown. Used in tests.
112 const char kArcForceShowOptInUi[] = "arc-force-show-optin-ui";
113 
114 // Used in autotest to specifies how to handle packages cache. Can be
115 // copy - copy resulting packages.xml to the temporary directory.
116 // skip-copy - skip initial packages cache setup and copy resulting packages.xml
117 //             to the temporary directory.
118 const char kArcPackagesCacheMode[] = "arc-packages-cache-mode";
119 
120 // Used in autotest to forces Play Store auto-update state. Can be
121 // on - auto-update is forced on.
122 // off - auto-update is forced off.
123 const char kArcPlayStoreAutoUpdate[] = "arc-play-store-auto-update";
124 
125 // Set the scale for ARC apps. This is in DPI. e.g. 280 DPI is ~ 1.75 device
126 // scale factor.
127 // See
128 // https://source.android.com/compatibility/android-cdd#3_7_runtime_compatibility
129 // for list of supported DPI values.
130 const char kArcScale[] = "arc-scale";
131 
132 // Defines how to start ARC. This can take one of the following values:
133 // - always-start automatically start with Play Store UI support.
134 // - always-start-with-no-play-store automatically start without Play Store UI.
135 // If it is not set, then ARC is started in default mode.
136 const char kArcStartMode[] = "arc-start-mode";
137 
138 // Sets ARC Terms Of Service hostname url for testing.
139 const char kArcTosHostForTests[] = "arc-tos-host-for-tests";
140 
141 // If this flag is present then the device had ARC M available and gets ARC N
142 // when updating.
143 // TODO(pmarko): Remove this when we assess that it's not necessary anymore:
144 // crbug.com/761348.
145 const char kArcTransitionMigrationRequired[] =
146     "arc-transition-migration-required";
147 
148 // If this flag is set, it indicates that this device is a "Cellular First"
149 // device. Cellular First devices use cellular telephone data networks as
150 // their primary means of connecting to the internet.
151 // Setting this flag has two consequences:
152 // 1. Cellular data roaming will be enabled by default.
153 // 2. UpdateEngine will be instructed to allow auto-updating over cellular
154 //    data connections.
155 const char kCellularFirst[] = "cellular-first";
156 
157 // Default large wallpaper to use for kids accounts (as path to trusted,
158 // non-user-writable JPEG file).
159 const char kChildWallpaperLarge[] = "child-wallpaper-large";
160 
161 // Default small wallpaper to use for kids accounts (as path to trusted,
162 // non-user-writable JPEG file).
163 const char kChildWallpaperSmall[] = "child-wallpaper-small";
164 
165 const char kConservativeThreshold[] = "conservative";
166 
167 // Forces CrOS region value.
168 const char kCrosRegion[] = "cros-region";
169 
170 // Control regions data load ("" is default).
171 const char kCrosRegionsMode[] = "cros-regions-mode";
172 
173 // "Hide" value for kCrosRegionsMode (VPD values are hidden).
174 const char kCrosRegionsModeHide[] = "hide";
175 
176 // "Override" value for kCrosRegionsMode (region's data is read first).
177 const char kCrosRegionsModeOverride[] = "override";
178 
179 // Indicates that the wallpaper images specified by
180 // kAshDefaultWallpaper{Large,Small} are OEM-specific (i.e. they are not
181 // downloadable from Google).
182 const char kDefaultWallpaperIsOem[] = "default-wallpaper-is-oem";
183 
184 // Default large wallpaper to use (as path to trusted, non-user-writable JPEG
185 // file).
186 const char kDefaultWallpaperLarge[] = "default-wallpaper-large";
187 
188 // Default small wallpaper to use (as path to trusted, non-user-writable JPEG
189 // file).
190 const char kDefaultWallpaperSmall[] = "default-wallpaper-small";
191 
192 // Time in seconds before a machine at OOBE is considered derelict.
193 const char kDerelictDetectionTimeout[] = "derelict-detection-timeout";
194 
195 // Time in seconds before a derelict machines starts demo mode.
196 const char kDerelictIdleTimeout[] = "derelict-idle-timeout";
197 
198 // Disables android user data wipe on opt out.
199 const char kDisableArcDataWipe[] = "disable-arc-data-wipe";
200 
201 // Disables ARC Opt-in verification process and ARC is enabled by default.
202 const char kDisableArcOptInVerification[] = "disable-arc-opt-in-verification";
203 
204 // Disables the Chrome OS demo.
205 const char kDisableDemoMode[] = "disable-demo-mode";
206 
207 // If this switch is set, the device cannot be remotely disabled by its owner.
208 const char kDisableDeviceDisabling[] = "disable-device-disabling";
209 
210 // Disable encryption migration for user's cryptohome to run latest Arc.
211 const char kDisableEncryptionMigration[] = "disable-encryption-migration";
212 
213 // Disables fine grained time zone detection.
214 const char kDisableFineGrainedTimeZoneDetection[] =
215     "disable-fine-grained-time-zone-detection";
216 
217 // Disables GAIA services such as enrollment and OAuth session restore. Used by
218 // 'fake' telemetry login.
219 const char kDisableGaiaServices[] = "disable-gaia-services";
220 
221 // Disables HID-detection OOBE screen.
222 const char kDisableHIDDetectionOnOOBEForTesting[] =
223     "disable-hid-detection-on-oobe";
224 
225 // Avoid doing expensive animations upon login.
226 const char kDisableLoginAnimations[] = "disable-login-animations";
227 
228 // Disables requests for an enterprise machine certificate during attestation.
229 const char kDisableMachineCertRequest[] = "disable-machine-cert-request";
230 
231 // Disables the multiple display layout UI.
232 const char kDisableMultiDisplayLayout[] = "disable-multi-display-layout";
233 
234 // Disables per-user timezone.
235 const char kDisablePerUserTimezone[] = "disable-per-user-timezone";
236 
237 // Disables rollback option on reset screen.
238 const char kDisableRollbackOption[] = "disable-rollback-option";
239 
240 // Disables client certificate authentication on the sign-in frame on the Chrome
241 // OS sign-in profile.
242 // TODO(https://crbug.com/844022): Remove this flag when reaching endpoints that
243 // request client certs does not hang anymore when there is no system token yet.
244 const char kDisableSigninFrameClientCerts[] =
245     "disable-signin-frame-client-certs";
246 
247 // Disables volume adjust sound.
248 const char kDisableVolumeAdjustSound[] = "disable-volume-adjust-sound";
249 
250 // Disables wake on wifi features.
251 const char kDisableWakeOnWifi[] = "disable-wake-on-wifi";
252 
253 // DEPRECATED. Please use --arc-availability=officially-supported.
254 // Enables starting the ARC instance upon session start.
255 const char kEnableArc[] = "enable-arc";
256 
257 // Enables ARC VM.
258 const char kEnableArcVm[] = "enable-arcvm";
259 
260 // Enables the Cast Receiver.
261 const char kEnableCastReceiver[] = "enable-cast-receiver";
262 
263 // Enables consumer kiosk mode for Chrome OS.
264 const char kEnableConsumerKiosk[] = "enable-consumer-kiosk";
265 
266 // Enables encryption migration for user's cryptohome to run latest Arc.
267 const char kEnableEncryptionMigration[] = "enable-encryption-migration";
268 
269 // Enables sharing assets for installed default apps.
270 const char kEnableExtensionAssetsSharing[] = "enable-extension-assets-sharing";
271 
272 // Enables the use of 32-bit Houdini library for ARM binary translation.
273 const char kEnableHoudini[] = "enable-houdini";
274 
275 // Enables the use of 64-bit Houdini library for ARM binary translation.
276 const char kEnableHoudini64[] = "enable-houdini64";
277 
278 // Enables the use of 32-bit NDK translation library for ARM binary translation.
279 const char kEnableNdkTranslation[] = "enable-ndk-translation";
280 
281 // Enables the use of 64-bit NDK translation library for ARM binary translation.
282 const char kEnableNdkTranslation64[] = "enable-ndk-translation64";
283 
284 // Enables request of tablet site (via user agent override).
285 const char kEnableRequestTabletSite[] = "enable-request-tablet-site";
286 
287 // Enables tablet form factor.
288 const char kEnableTabletFormFactor[] = "enable-tablet-form-factor";
289 
290 // Enables the touch calibration option in MD settings UI for valid touch
291 // displays.
292 const char kEnableTouchCalibrationSetting[] =
293     "enable-touch-calibration-setting";
294 
295 // Enables touchpad three-finger-click as middle button.
296 const char kEnableTouchpadThreeFingerClick[] =
297     "enable-touchpad-three-finger-click";
298 
299 // Disables ARC for managed accounts.
300 const char kEnterpriseDisableArc[] = "enterprise-disable-arc";
301 
302 // Whether to enable forced enterprise re-enrollment.
303 const char kEnterpriseEnableForcedReEnrollment[] =
304     "enterprise-enable-forced-re-enrollment";
305 
306 // Whether to enable initial enterprise enrollment.
307 const char kEnterpriseEnableInitialEnrollment[] =
308     "enterprise-enable-initial-enrollment";
309 
310 // Whether to enable private set membership queries.
311 const char kEnterpriseEnablePrivateSetMembership[] = "enterprise-enable-psm";
312 
313 // Enables the zero-touch enterprise enrollment flow.
314 const char kEnterpriseEnableZeroTouchEnrollment[] =
315     "enterprise-enable-zero-touch-enrollment";
316 
317 // Power of the power-of-2 initial modulus that will be used by the
318 // auto-enrollment client. E.g. "4" means the modulus will be 2^4 = 16.
319 const char kEnterpriseEnrollmentInitialModulus[] =
320     "enterprise-enrollment-initial-modulus";
321 
322 // Power of the power-of-2 maximum modulus that will be used by the
323 // auto-enrollment client.
324 const char kEnterpriseEnrollmentModulusLimit[] =
325     "enterprise-enrollment-modulus-limit";
326 
327 // Interval in seconds between Chrome reading external metrics from
328 // /var/lib/metrics/uma-events.
329 const char kExternalMetricsCollectionInterval[] =
330     "external-metrics-collection-interval";
331 
332 // An absolute path to the chroot hosting the DriveFS to use. This is only used
333 // when running on Linux, i.e. when IsRunningOnChromeOS() returns false.
334 const char kFakeDriveFsLauncherChrootPath[] =
335     "fake-drivefs-launcher-chroot-path";
336 
337 // A relative path to socket to communicat with the fake DriveFS launcher within
338 // the chroot specified by kFakeDriveFsLauncherChrootPath. This is only used
339 // when running on Linux, i.e. when IsRunningOnChromeOS() returns false.
340 const char kFakeDriveFsLauncherSocketPath[] =
341     "fake-drivefs-launcher-socket-path";
342 
343 // Specifies number of recommended (fake) ARC apps during user onboarding.
344 // App descriptions are generated locally instead of being fetched from server.
345 // Limited to ChromeOS-on-linux and test images only.
346 const char kFakeArcRecommendedAppsForTesting[] =
347     "fake-arc-recommended-apps-for-testing";
348 
349 // Fingerprint sensor location indicates the physical sensor's location. The
350 // value is a string with possible values: "power-button-top-left",
351 // "keyboard-bottom-left", keyboard-bottom-right", "keyboard-top-right".
352 const char kFingerprintSensorLocation[] = "fingerprint-sensor-location";
353 
354 // Forces Chrome to use CertVerifyProcBuiltin for verification of server
355 // certificates, ignoring the status of
356 // net::features::kCertVerifierBuiltinFeature.
357 const char kForceCertVerifierBuiltin[] = "force-cert-verifier-builtin";
358 
359 // Passed to Chrome the first time that it's run after the system boots.
360 // Not passed on restart after sign out.
361 const char kFirstExecAfterBoot[] = "first-exec-after-boot";
362 
363 // Forces developer tools availability, no matter what values the enterprise
364 // policies DeveloperToolsDisabled and DeveloperToolsAvailability are set to.
365 const char kForceDevToolsAvailable[] = "force-devtools-available";
366 
367 // Forces first-run UI to be shown for every login.
368 const char kForceFirstRunUI[] = "force-first-run-ui";
369 
370 // Force enables the Happiness Tracking System for the device. This ignores
371 // user profile check and time limits and shows the notification every time
372 // for any type of user. Should be used only for testing.
373 const char kForceHappinessTrackingSystem[] = "force-happiness-tracking-system";
374 
375 // Forces Hardware ID check (happens during OOBE) to fail. Should be used only
376 // for testing.
377 const char kForceHWIDCheckFailureForTest[] =
378     "force-hwid-check-failure-for-test";
379 
380 // Usually in browser tests the usual login manager bringup is skipped so that
381 // tests can change how it's brought up. This flag disables that.
382 const char kForceLoginManagerInTests[] = "force-login-manager-in-tests";
383 
384 // Force system compositor mode when set.
385 const char kForceSystemCompositorMode[] = "force-system-compositor-mode";
386 
387 // Indicates that the browser is in "browse without sign-in" (Guest session)
388 // mode. Should completely disable extensions, sync and bookmarks.
389 const char kGuestSession[] = "bwsi";
390 
391 // Large wallpaper to use in guest mode (as path to trusted, non-user-writable
392 // JPEG file).
393 const char kGuestWallpaperLarge[] = "guest-wallpaper-large";
394 
395 // Small wallpaper to use in guest mode (as path to trusted, non-user-writable
396 // JPEG file).
397 const char kGuestWallpaperSmall[] = "guest-wallpaper-small";
398 
399 // If set, the system is a Chromebook with a "standard Chrome OS keyboard",
400 // which generally means one with a Search key in the standard Caps Lock
401 // location above the Left Shift key. It should be unset for Chromebooks with
402 // both Search and Caps Lock keys (e.g. stout) and for devices like Chromeboxes
403 // that only use external keyboards.
404 const char kHasChromeOSKeyboard[] = "has-chromeos-keyboard";
405 
406 // Defines user homedir. This defaults to primary user homedir.
407 const char kHomedir[] = "homedir";
408 
409 // If set, the "ignore_dev_conf" field in StartArcVmRequest message will
410 // consequently be set such that all development configuration directives in
411 // /usr/local/vms/etc/arcvm_dev.conf will be ignored during ARCVM start.
412 const char kIgnoreArcVmDevConf[] = "ignore-arcvm-dev-conf";
413 
414 // If true, profile selection in UserManager will always return active user's
415 // profile.
416 // TODO(nkostlyev): http://crbug.com/364604 - Get rid of this switch after we
417 // turn on multi-profile feature on ChromeOS.
418 const char kIgnoreUserProfileMappingForTests[] =
419     "ignore-user-profile-mapping-for-tests";
420 
421 // If set, the Chrome settings will not expose the option to enable crostini
422 // unless the enable-experimental-kernel-vm-support flag is set in
423 // chrome://flags
424 const char kKernelnextRestrictVMs[] = "kernelnext-restrict-vms";
425 
426 // If this switch is set, then ash-chrome will pass additional arguments when
427 // launching lacros-chrome. The string '####' is used as a delimiter. Example:
428 // --lacros-chrome-additional-args="--foo=5####--bar=/tmp/dir name". Will
429 // result in two arguments passed to lacros-chrome:
430 //   --foo=5
431 //   --bar=/tmp/dir name
432 const char kLacrosChromeAdditionalArgs[] = "lacros-chrome-additional-args";
433 
434 // If this switch is set, then ash-chrome will exec the lacros-chrome binary
435 // from the indicated path rather than from component updater. Note that the
436 // path should be to a directory that contains a binary named 'chrome'.
437 const char kLacrosChromePath[] = "lacros-chrome-path";
438 
439 // If set, ash-chrome will drop a Unix domain socket to wait for a process to
440 // connect to it, and the connection will be used to request file descriptors
441 // from ash-chrome, and when the process forks to start a lacros-chrome, the
442 // obtained file descriptor will be used by lacros-chrome to set up the mojo
443 // connection with ash-chrome. There are mainly two use cases:
444 // 1. Test launcher to run browser tests in testing environment.
445 // 2. A terminal to start lacros-chrome with a debugger.
446 const char kLacrosMojoSocketForTesting[] = "lacros-mojo-socket-for-testing";
447 
448 // Enables Chrome-as-a-login-manager behavior.
449 const char kLoginManager[] = "login-manager";
450 
451 // Specifies the profile to use once a chromeos user is logged in.
452 // This parameter is ignored if user goes through login screen since user_id
453 // hash defines which profile directory to use.
454 // In case of browser restart within active session this parameter is used
455 // to pass user_id hash for primary user.
456 const char kLoginProfile[] = "login-profile";
457 
458 // Specifies the user which is already logged in.
459 const char kLoginUser[] = "login-user";
460 
461 // Determines the URL to be used when calling the backend.
462 const char kMarketingOptInUrl[] = "marketing-opt-in-url";
463 
464 // Enables natural scroll by default.
465 const char kNaturalScrollDefault[] = "enable-natural-scroll-default";
466 
467 // If present, the device needs to check the policy to see if the migration to
468 // ext4 for ARC is allowed. It should be present only on devices that have been
469 // initially issued with ecrypfs encryption and have ARC (N+) available. For the
470 // devices in other categories this flag must be missing.
471 const char kNeedArcMigrationPolicyCheck[] = "need-arc-migration-policy-check";
472 
473 // An optional comma-separated list of IDs of apps that can be used to take
474 // notes. If unset, a hardcoded list is used instead.
475 const char kNoteTakingAppIds[] = "note-taking-app-ids";
476 
477 // Forces OOBE/login to force show a comma-separated list of screens from
478 // chromeos::kScreenNames in oobe_screen.cc. Supported screens are:
479 //   user-image
480 const char kOobeForceShowScreen[] = "oobe-force-show-screen";
481 
482 // Allows the eula url to be overridden for tests.
483 const char kOobeEulaUrlForTests[] = "oobe-eula-url-for-tests";
484 
485 // Indicates that the first user run flow (sequence of OOBE screens after the
486 // first user login) should show tablet mode centric screens, even if the device
487 // is not in tablet mode.
488 const char kOobeForceTabletFirstRun[] = "oobe-force-tablet-first-run";
489 
490 // Indicates that a guest session has been started before OOBE completion.
491 const char kOobeGuestSession[] = "oobe-guest-session";
492 
493 // Skips all other OOBE pages after user login.
494 const char kOobeSkipPostLogin[] = "oobe-skip-postlogin";
495 
496 // Skip to login screen.
497 const char kOobeSkipToLogin[] = "oobe-skip-to-login";
498 
499 // Interval at which we check for total time on OOBE.
500 const char kOobeTimerInterval[] = "oobe-timer-interval";
501 
502 // Allows the timezone to be overridden on the marketing opt-in screen.
503 const char kOobeTimezoneOverrideForTests[] = "oobe-timezone-override-for-tests";
504 
505 // SAML assertion consumer URL, used to detect when Gaia-less SAML flows end
506 // (e.g. for SAML managed guest sessions)
507 // TODO(984021): Remove when URL is sent by DMServer.
508 const char kPublicAccountsSamlAclUrl[] = "public-accounts-saml-acl-url";
509 
510 // If set to "true", the profile requires policy during restart (policy load
511 // must succeed, otherwise session restart should fail).
512 const char kProfileRequiresPolicy[] = "profile-requires-policy";
513 
514 // Redirects libassistant logging to /var/log/chrome/.
515 const char kRedirectLibassistantLogging[] = "redirect-libassistant-logging";
516 
517 // The rlz ping delay (in seconds) that overwrites the default value.
518 const char kRlzPingDelay[] = "rlz-ping-delay";
519 
520 // The switch added by session_manager daemon when chrome crashes 3 times or
521 // more within the first 60 seconds on start.
522 // See BrowserJob::ExportArgv in platform2/login_manager/browser_job.cc.
523 const char kSafeMode[] = "safe-mode";
524 
525 // Password change url for SAML users.
526 // TODO(941489): Remove when the bug is fixed.
527 const char kSamlPasswordChangeUrl[] = "saml-password-change-url";
528 
529 // New modular design for the shelf with apps separated into a hotseat UI and
530 // smaller shelf in clamshell mode.
531 const char kShelfHotseat[] = "shelf-hotseat";
532 
533 // App window previews when hovering over the shelf.
534 const char kShelfHoverPreviews[] = "shelf-hover-previews";
535 
536 // The name of the per-model directory which contains per-region
537 // subdirectories with regulatory label files for this model.
538 // The per-model directories (if there are any) are located under
539 // "/usr/share/chromeos-assets/regulatory_labels/".
540 const char kRegulatoryLabelDir[] = "regulatory-label-dir";
541 
542 // If true, the developer tool overlay will be shown for the login/lock screen.
543 // This makes it easier to test layout logic.
544 const char kShowLoginDevOverlay[] = "show-login-dev-overlay";
545 
546 // Enables OOBE UI Debugger for ease of navigation between screens during manual
547 // testing. Limited to ChromeOS-on-linux and test images only.
548 const char kShowOobeDevOverlay[] = "show-oobe-dev-overlay";
549 
550 // Specifies directory for screenshots taken with OOBE UI Debugger.
551 const char kOobeScreenshotDirectory[] = "oobe-screenshot-dir";
552 
553 // Specifies directory for the Telemetry System Web Extension.
554 const char kTelemetryExtensionDirectory[] = "telemetry-extension-dir";
555 
556 // Enables testing for encryption migration UI.
557 const char kTestEncryptionMigrationUI[] = "test-encryption-migration-ui";
558 
559 // Enables the wallpaper picker to fetch images from the test server.
560 const char kTestWallpaperServer[] = "test-wallpaper-server";
561 
562 // Overrides Tether with stub service. Provide integer arguments for the number
563 // of fake networks desired, e.g. 'tether-stub=2'.
564 const char kTetherStub[] = "tether-stub";
565 
566 // Tells the Chromebook to scan for a tethering host even if there is already a
567 // wired connection. This allows end-to-end tests to be deployed over ethernet
568 // without that connection preventing scans and thereby blocking the testing of
569 // cases with no preexisting connection. Should be used only for testing.
570 const char kTetherHostScansIgnoreWiredConnections[] =
571     "tether-host-scans-ignore-wired-connections";
572 
573 // Shows all Bluetooth devices in UI (System Tray/Settings Page.)
574 const char kUnfilteredBluetoothDevices[] = "unfiltered-bluetooth-devices";
575 
576 // Used to tell the policy infrastructure to not let profile initialization
577 // complete until policy is manually set by a test. This is used to provide
578 // backward compatibility with a few tests that incorrectly use the
579 // synchronously-initialized login profile to run their tests - do not add new
580 // uses of this flag.
581 const char kWaitForInitialPolicyFetchForTest[] =
582     "wait-for-initial-policy-fetch-for-test";
583 
584 // Prevents any CPU restrictions being set on the ARC container. Only meant to
585 // be used by tests as some tests may time out if the ARC container is
586 // throttled.
587 const char kDisableArcCpuRestriction[] = "disable-arc-cpu-restriction";
588 
589 // If this switch is passed, the device policy DeviceMinimumVersion
590 // assumes that the device has reached Auto Update Expiration. This is useful
591 // for testing the policy behaviour on the DUT.
592 const char kUpdateRequiredAueForTest[] = "aue-reached-for-update-required-test";
593 
WakeOnWifiEnabled()594 bool WakeOnWifiEnabled() {
595   return !base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableWakeOnWifi);
596 }
597 
MemoryPressureHandlingEnabled()598 bool MemoryPressureHandlingEnabled() {
599   if (base::FieldTrialList::FindFullName(kMemoryPressureExperimentName) ==
600       kMemoryPressureHandlingOff) {
601     return false;
602   }
603   return true;
604 }
605 
IsGaiaIdMigrationStarted()606 bool IsGaiaIdMigrationStarted() {
607   base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
608   if (!command_line->HasSwitch(kTestCrosGaiaIdMigration))
609     return false;
610 
611   return command_line->GetSwitchValueASCII(kTestCrosGaiaIdMigration) ==
612          kTestCrosGaiaIdMigrationStarted;
613 }
614 
IsCellularFirstDevice()615 bool IsCellularFirstDevice() {
616   return base::CommandLine::ForCurrentProcess()->HasSwitch(kCellularFirst);
617 }
618 
IsSigninFrameClientCertsEnabled()619 bool IsSigninFrameClientCertsEnabled() {
620   return !base::CommandLine::ForCurrentProcess()->HasSwitch(
621       kDisableSigninFrameClientCerts);
622 }
623 
ShouldShowShelfHoverPreviews()624 bool ShouldShowShelfHoverPreviews() {
625   return base::CommandLine::ForCurrentProcess()->HasSwitch(kShelfHoverPreviews);
626 }
627 
ShouldTetherHostScansIgnoreWiredConnections()628 bool ShouldTetherHostScansIgnoreWiredConnections() {
629   return base::CommandLine::ForCurrentProcess()->HasSwitch(
630       kTetherHostScansIgnoreWiredConnections);
631 }
632 
ShouldSkipOobePostLogin()633 bool ShouldSkipOobePostLogin() {
634   return base::CommandLine::ForCurrentProcess()->HasSwitch(kOobeSkipPostLogin);
635 }
636 
IsTabletFormFactor()637 bool IsTabletFormFactor() {
638   return base::CommandLine::ForCurrentProcess()->HasSwitch(
639       kEnableTabletFormFactor);
640 }
641 
IsGaiaServicesDisabled()642 bool IsGaiaServicesDisabled() {
643   return base::CommandLine::ForCurrentProcess()->HasSwitch(
644       kDisableGaiaServices);
645 }
646 
IsArcCpuRestrictionDisabled()647 bool IsArcCpuRestrictionDisabled() {
648   return base::CommandLine::ForCurrentProcess()->HasSwitch(
649       kDisableArcCpuRestriction);
650 }
651 
IsUnfilteredBluetoothDevicesEnabled()652 bool IsUnfilteredBluetoothDevicesEnabled() {
653   return base::CommandLine::ForCurrentProcess()->HasSwitch(
654       kUnfilteredBluetoothDevices);
655 }
656 
ShouldOobeUseTabletModeFirstRun()657 bool ShouldOobeUseTabletModeFirstRun() {
658   return base::CommandLine::ForCurrentProcess()->HasSwitch(
659       kOobeForceTabletFirstRun);
660 }
661 
IsAueReachedForUpdateRequiredForTest()662 bool IsAueReachedForUpdateRequiredForTest() {
663   return base::CommandLine::ForCurrentProcess()->HasSwitch(
664       kUpdateRequiredAueForTest);
665 }
666 
667 }  // namespace switches
668 }  // namespace chromeos
669