Chromecast ATV: distinguish actual shutdown vs. lifecycle from sleep.
[chromium-blink-merge.git] / chromeos / chromeos_switches.cc
blob78f164ded7963da95c57d6702015d5db3bf36715
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.
5 #include "chromeos/chromeos_switches.h"
7 #include "base/command_line.h"
9 namespace chromeos {
10 namespace switches {
12 // Path for app's OEM manifest file.
13 const char kAppOemManifestFile[] = "app-mode-oem-manifest";
15 // When wallpaper boot animation is not disabled this switch
16 // is used to override OOBE/sign in WebUI init type.
17 // Possible values: parallel|postpone. Default: parallel.
18 const char kAshWebUIInit[] = "ash-webui-init";
20 // Specifies the URL of the consumer device management backend.
21 const char kConsumerDeviceManagementUrl[] = "consumer-device-management-url";
23 // Forces the stub implementation of dbus clients.
24 const char kDbusStub[] = "dbus-stub";
26 // Comma-spearated list of dbus clients that should be unstubbed.
27 // See chromeos/dbus/dbus_client_bundle.cc for the names of the dbus clients.
28 const char kDbusUnstubClients[] = "dbus-unstub-clients";
30 // Indicates that the wallpaper images specified by
31 // kAshDefaultWallpaper{Large,Small} are OEM-specific (i.e. they are not
32 // downloadable from Google).
33 const char kDefaultWallpaperIsOem[] = "default-wallpaper-is-oem";
35 // Default wallpaper to use (as paths to trusted, non-user-writable JPEG files).
36 const char kDefaultWallpaperLarge[] = "default-wallpaper-large";
37 const char kDefaultWallpaperSmall[] = "default-wallpaper-small";
39 // Time before a machine at OOBE is considered derelict.
40 const char kDerelictDetectionTimeout[] = "derelict-detection-timeout";
42 // Time before a derelict machines starts demo mode.
43 const char kDerelictIdleTimeout[] = "derelict-idle-timeout";
45 // Disables wallpaper boot animation (except of OOBE case).
46 const char kDisableBootAnimation[] = "disable-boot-animation";
48 // Disables the ChromeOS demo.
49 const char kDisableDemoMode[] = "disable-demo-mode";
51 // Disable HID-detection OOBE screen.
52 const char kDisableHIDDetectionOnOOBE[] = "disable-hid-detection-on-oobe";
54 // Avoid doing expensive animations upon login.
55 const char kDisableLoginAnimations[] = "disable-login-animations";
57 // Disable login/lock UI (user pods) scrolling into view on JS side when virtual
58 // keyboard is shown.
59 const char kDisableLoginScrollIntoView[] = "disable-login-scroll-into-view";
61 // Disable new channel switcher UI.
62 const char kDisableNewChannelSwitcherUI[] = "disable-new-channel-switcher-ui";
64 // Disables new Kiosk UI when kiosk apps are represented as user pods.
65 const char kDisableNewKioskUI[] = "disable-new-kiosk-ui";
67 // Disables the new File System Provider API based ZIP unpacker.
68 const char kDisableNewZIPUnpacker[] = "disable-new-zip-unpacker";
70 // Disable Office Editing for Docs, Sheets & Slides component app so handlers
71 // won't be registered, making it possible to install another version for
72 // testing.
73 const char kDisableOfficeEditingComponentApp[] =
74 "disable-office-editing-component-extension";
76 // Disables rollback option on reset screen.
77 const char kDisableRollbackOption[] = "disable-rollback-option";
79 // Disables volume adjust sound.
80 const char kDisableVolumeAdjustSound[] = "disable-volume-adjust-sound";
82 // Disables wake on wifi features.
83 const char kDisableWakeOnWifi[] = "disable-wake-on-wifi";
85 // Disables notifications about captive portals in session.
86 const char kDisableNetworkPortalNotification[] =
87 "disable-network-portal-notification";
89 // Enables switching between different cellular carriers from the UI.
90 const char kEnableCarrierSwitching[] = "enable-carrier-switching";
92 // Enables cloud backup feature.
93 const char kEnableCloudBackup[] = "enable-cloud-backup";
95 // Enables consumer management, which allows user to enroll, remotely lock and
96 // locate the device.
97 const char kEnableConsumerManagement[] = "enable-consumer-management";
99 // If this switch is set, the device cannot be remotely disabled by its owner.
100 const char kDisableDeviceDisabling[] = "disable-device-disabling";
102 // If this switch is set, Chrome OS login screen uses |EmbeddedSignin| endpoint
103 // of GAIA.
104 const char kEnableEmbeddedSignin[] = "enable-embedded-signin";
106 // If this switch is set, the new Korean IME will be available in
107 // chrome://settings/languages.
108 const char kEnableNewKoreanIme[] = "enable-new-korean-ime";
110 // If this switch is set, the input view keyboard will be in materia design.
111 const char kEnableNewQPInputView[] = "enable-new-qp-input-view";
113 // If this switch is set, the options for suggestions as typing on physical
114 // keyboard will be disabled.
115 const char kDisablePhysicalKeyboardAutocorrect[] =
116 "disable-physical-keyboard-autocorrect";
118 // If this switch is set, the voice input will be disabled.
119 const char kDisableVoiceInput[] = "disable-voice-input";
121 // Enabled sharing assets for installed default apps.
122 const char kEnableExtensionAssetsSharing[] = "enable-extension-assets-sharing";
124 // Enables notifications about captive portals in session.
125 const char kEnableNetworkPortalNotification[] =
126 "enable-network-portal-notification";
128 // Enables touchpad three-finger-click as middle button.
129 const char kEnableTouchpadThreeFingerClick[]
130 = "enable-touchpad-three-finger-click";
132 // Enables using screenshots in tests and seets mode.
133 const char kEnableScreenshotTestingWithMode[] =
134 "enable-screenshot-testing-with-mode";
136 // Enable Kiosk mode for ChromeOS. Note this switch refers to retail mode rather
137 // than the kiosk app mode.
138 const char kEnableKioskMode[] = "enable-kiosk-mode";
140 // Enables request of tablet site (via user agent override).
141 const char kEnableRequestTabletSite[] = "enable-request-tablet-site";
143 // Whether to enable forced enterprise re-enrollment.
144 const char kEnterpriseEnableForcedReEnrollment[] =
145 "enterprise-enable-forced-re-enrollment";
147 // Power of the power-of-2 initial modulus that will be used by the
148 // auto-enrollment client. E.g. "4" means the modulus will be 2^4 = 16.
149 const char kEnterpriseEnrollmentInitialModulus[] =
150 "enterprise-enrollment-initial-modulus";
152 // Power of the power-of-2 maximum modulus that will be used by the
153 // auto-enrollment client.
154 const char kEnterpriseEnrollmentModulusLimit[] =
155 "enterprise-enrollment-modulus-limit";
157 // Don't create robot account on enrollment. Used when testing device
158 // enrollment against YAPS or the Python test server.
159 const char kEnterpriseEnrollmentSkipRobotAuth[] =
160 "enterprise-enrollment-skip-robot-auth";
162 // Enables the chromecast support for video player app.
163 const char kEnableVideoPlayerChromecastSupport[] =
164 "enable-video-player-chromecast-support";
166 // Passed to Chrome the first time that it's run after the system boots.
167 // Not passed on restart after sign out.
168 const char kFirstExecAfterBoot[] = "first-exec-after-boot";
170 // Usually in browser tests the usual login manager bringup is skipped so that
171 // tests can change how it's brought up. This flag disables that.
172 const char kForceLoginManagerInTests[] = "force-login-manager-in-tests";
174 // Indicates that the browser is in "browse without sign-in" (Guest session)
175 // mode. Should completely disable extensions, sync and bookmarks.
176 const char kGuestSession[] = "bwsi";
178 // Wallpaper to use in guest mode (as paths to trusted, non-user-writable JPEG
179 // files).
180 const char kGuestWallpaperLarge[] = "guest-wallpaper-large";
181 const char kGuestWallpaperSmall[] = "guest-wallpaper-small";
183 // If true, the Chromebook has a Chrome OS keyboard. Don't use the flag for
184 // Chromeboxes.
185 const char kHasChromeOSKeyboard[] = "has-chromeos-keyboard";
187 // If true, the Chromebook has a keyboard with a diamond key.
188 const char kHasChromeOSDiamondKey[] = "has-chromeos-diamond-key";
190 // Defines user homedir. This defaults to primary user homedir.
191 const char kHomedir[] = "homedir";
193 // With this switch, start remora OOBE with the pairing screen.
194 const char kHostPairingOobe[] = "host-pairing-oobe";
196 // If true, profile selection in UserManager will always return active user's
197 // profile.
198 // TODO(nkostlyev): http://crbug.com/364604 - Get rid of this switch after we
199 // turn on multi-profile feature on ChromeOS.
200 const char kIgnoreUserProfileMappingForTests[] =
201 "ignore-user-profile-mapping-for-tests";
203 // Enables Chrome-as-a-login-manager behavior.
204 const char kLoginManager[] = "login-manager";
206 // Specifies the profile to use once a chromeos user is logged in.
207 // This parameter is ignored if user goes through login screen since user_id
208 // hash defines which profile directory to use.
209 // In case of browser restart within active session this parameter is used
210 // to pass user_id hash for primary user.
211 const char kLoginProfile[] = "login-profile";
213 // Specifies the user which is already logged in.
214 const char kLoginUser[] = "login-user";
216 // The memory pressure thresholds selection which is used to decide when a
217 // memory pressure event needs to get fired.
218 const char kMemoryPressureThresholds[] = "memory-pressure-thresholds";
220 // Enables natural scroll by default.
221 const char kNaturalScrollDefault[] = "enable-natural-scroll-default";
223 // Skips all other OOBE pages after user login.
224 const char kOobeSkipPostLogin[] = "oobe-skip-postlogin";
226 // Disable GAIA services such as enrollment and OAuth session restore. Used by
227 // 'fake' telemetry login.
228 const char kDisableGaiaServices[] = "disable-gaia-services";
230 // Interval at which we check for total time on OOBE.
231 const char kOobeTimerInterval[] = "oobe-timer-interval";
233 // Indicates that a guest session has been started before OOBE completion.
234 const char kOobeGuestSession[] = "oobe-guest-session";
236 // Specifies power stub behavior:
237 // 'cycle=2' - Cycles power states every 2 seconds.
238 // See FakeDBusThreadManager::ParsePowerCommandLineSwitch for full details.
239 const char kPowerStub[] = "power-stub";
241 // Overrides network stub behavior. By default, ethernet, wifi and vpn are
242 // enabled, and transitions occur instantaneously. Multiple options can be
243 // comma separated (no spaces). Note: all options are in the format 'foo=x'.
244 // See FakeShillManagerClient::SetInitialNetworkState for implementation.
245 // Examples:
246 // 'clear=1' - Clears all default configurations
247 // 'wifi=on' - A wifi network is initially connected ('1' also works)
248 // 'wifi=off' - Wifi networks are all initially disconnected ('0' also works)
249 // 'wifi=disabled' - Wifi is initially disabled
250 // 'wifi=none' - Wifi is unavailable
251 // 'wifi=portal' - Wifi connection will be in Portal state
252 // 'cellular=1' - Cellular is initially connected
253 // 'interactive=3' - Interactive mode, connect/scan/etc requests take 3 secs
254 const char kShillStub[] = "shill-stub";
256 // Sends test messages on first call to RequestUpdate (stub only).
257 const char kSmsTestMessages[] = "sms-test-messages";
259 // Indicates that a stub implementation of CrosSettings that stores settings in
260 // memory without signing should be used, treating current user as the owner.
261 // This option is for testing the chromeos build of chrome on the desktop only.
262 const char kStubCrosSettings[] = "stub-cros-settings";
264 // Indicates that the system is running in dev mode. The dev mode probing is
265 // done by session manager.
266 const char kSystemDevMode[] = "system-developer-mode";
268 // Enables animated transitions during first-run tutorial.
269 const char kEnableFirstRunUITransitions[] = "enable-first-run-ui-transitions";
271 // Forces first-run UI to be shown for every login.
272 const char kForceFirstRunUI[] = "force-first-run-ui";
274 // Enables testing for auto update UI.
275 const char kTestAutoUpdateUI[] = "test-auto-update-ui";
277 // Disable memory pressure checks on ChromeOS.
278 const char kDisableMemoryPressureSystemChromeOS[] =
279 "disable-memory-pressure-chromeos";
281 // Enables waking the device based on the receipt of some network packets.
282 const char kWakeOnPackets[] = "wake-on-packets";
284 // Screenshot testing: specifies the directory where the golden screenshots are
285 // stored.
286 const char kGoldenScreenshotsDir[] = "golden-screenshots-dir";
288 // Screenshot testing: specifies the directoru where artifacts will be stored.
289 const char kArtifactsDir[] = "artifacts-dir";
291 // Bypass proxy for captive portal authorization.
292 const char kEnableCaptivePortalBypassProxy[] =
293 "enable-captive-portal-bypass-proxy";
295 bool WakeOnWifiEnabled() {
296 return !base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableWakeOnWifi);
299 base::MemoryPressureObserverChromeOS::MemoryPressureThresholds
300 GetMemoryPressureThresholds() {
301 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
302 kMemoryPressureThresholds)) {
303 return base::MemoryPressureObserverChromeOS::THRESHOLD_DEFAULT;
305 const std::string option =
306 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
307 kMemoryPressureThresholds);
308 if (option == "1") {
309 return base::MemoryPressureObserverChromeOS::THRESHOLD_CONSERVATIVE;
311 if (option == "2") {
312 return base::MemoryPressureObserverChromeOS::
313 THRESHOLD_AGGRESSIVE_CACHE_DISCARD;
315 if (option == "3") {
316 return base::MemoryPressureObserverChromeOS::
317 THRESHOLD_AGGRESSIVE_TAB_DISCARD;
319 return base::MemoryPressureObserverChromeOS::THRESHOLD_AGGRESSIVE;
322 } // namespace switches
323 } // namespace chromeos