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