Disable view source for Developer Tools.
[chromium-blink-merge.git] / ash / ash_switches.cc
blob87fb8d5739eed0aa0ce7fd0812a801f4c74aaa85
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 "ash/ash_switches.h"
7 #include "base/command_line.h"
9 namespace ash {
10 namespace switches {
12 // Enables an animated transition from the boot splash screen (Chrome logo on a
13 // white background) to the login screen. Implies
14 // |kAshCopyHostBackgroundAtBoot| and doesn't make much sense if used in
15 // conjunction with |kDisableBootAnimation| (since the transition begins at the
16 // same time as the white/grayscale login screen animation).
17 const char kAshAnimateFromBootSplashScreen[] =
18 "ash-animate-from-boot-splash-screen";
20 // Constrains the pointer movement within a root window on desktop.
21 const char kAshConstrainPointerToRoot[] = "ash-constrain-pointer-to-root";
23 // Copies the host window's content to the system background layer at startup.
24 // Can make boot slightly slower, but also hides an even-longer awkward period
25 // where we display a white background if the login wallpaper takes a long time
26 // to load.
27 const char kAshCopyHostBackgroundAtBoot[] = "ash-copy-host-background-at-boot";
29 // Enable keyboard shortcuts useful for debugging.
30 const char kAshDebugShortcuts[] = "ash-debug-shortcuts";
32 // UI to show preferred networks in the status area (for testing).
33 const char kAshDebugShowPreferredNetworks[] =
34 "ash-debug-show-preferred-networks";
36 // Indicates that the wallpaper images specified by
37 // kAshDefaultWallpaper{Large,Small} are OEM-specific (i.e. they are not
38 // downloadable from Google).
39 const char kAshDefaultWallpaperIsOem[] = "ash-default-wallpaper-is-oem";
41 // Default wallpaper to use (as paths to trusted, non-user-writable JPEG files).
42 const char kAshDefaultWallpaperLarge[] = "ash-default-wallpaper-large";
43 const char kAshDefaultWallpaperSmall[] = "ash-default-wallpaper-small";
45 // Use the normal visual style for the caption buttons (minimize, maximize,
46 // restore, close).
47 const char kAshDisableAlternateFrameCaptionButtonStyle[] =
48 "ash-disable-alternate-caption-button";
50 // Disable the alternate shelf layout.
51 const char kAshDisableAlternateShelfLayout[] =
52 "ash-disable-alternate-shelf-layout";
54 #if defined(OS_CHROMEOS)
55 // Disable the status tray volume menu for allowing the user to choose an audio
56 // input and output device.
57 const char kAshDisableAudioDeviceMenu[] =
58 "ash-disable-audio-device-menu";
59 #endif
61 // Disable auto window maximization logic.
62 const char kAshDisableAutoMaximizing[] = "ash-disable-auto-maximizing";
64 // Disables the limitter to throttle how quickly a user
65 // can change display settings.
66 const char kAshDisableDisplayChangeLimiter[] =
67 "ash-disable-display-change-limiter";
69 // Disable ability to dock windows at the desktop edge.
70 const char kAshDisableDockedWindows[] = "ash-disable-docked-windows";
72 // Disallow items to be dragged from the app launcher list into the launcher.
73 const char kAshDisableDragAndDropAppListToLauncher[] =
74 "ash-disable-drag-and-drop-applist-to-launcher";
76 // Disable dragging items off the shelf to unpin them.
77 const char kAshDisableDragOffShelf[] = "ash-disable-drag-off-shelf";
79 // Disables overview mode for window switching.
80 const char kAshDisableOverviewMode[] = "ash-disable-overview-mode";
82 #if defined(OS_CHROMEOS)
83 // Disable the notification when a low-power USB charger is connected.
84 const char kAshDisableUsbChargerNotification[] =
85 "ash-disable-usb-charger-notification";
87 // TODO(jamescook): Remove this unused flag. It exists only to allow the
88 // "Enable audio device menu" about:flags item to have the tri-state
89 // default/enabled/disabled UI.
90 const char kAshEnableAudioDeviceMenu[] = "ash-enable-audio-device-menu";
91 #endif // defined(OS_CHROMEOS)
93 // Enable advanced gestures (e.g. for window management).
94 const char kAshEnableAdvancedGestures[] = "ash-enable-advanced-gestures";
96 // Use alternate visual style for the caption buttons (minimize, maximize,
97 // restore, close). The alternate style:
98 // - Adds a dedicated button for minimize.
99 // - Removes the maximize button's help bubble.
100 const char kAshEnableAlternateFrameCaptionButtonStyle[] =
101 "ash-enable-alternate-caption-button";
103 // Always enable brightness control. Used by machines that don't report their
104 // main monitor as internal.
105 const char kAshEnableBrightnessControl[] = "ash-enable-brightness-control";
107 // Enables putting all windows into immersive fullscreen via <F4>.
108 const char kAshEnableImmersiveFullscreenForAllWindows[] =
109 "ash-enable-immersive-all-windows";
111 // Enables putting only browser windows into immersive fullscreen via <F4>.
112 // <F4> puts all other windows into non-immersive fullscreen.
113 const char kAshEnableImmersiveFullscreenForBrowserOnly[] =
114 "ash-enable-immersive-browser-only";
116 #if defined(OS_CHROMEOS)
117 // Enables the "full multi profile mode" - as it was in M-31.
118 const char kAshEnableFullMultiProfileMode[] =
119 "ash-enable-full-multi-profile-mode";
120 #endif
122 #if defined(OS_LINUX)
123 // Enable memory monitoring.
124 const char kAshEnableMemoryMonitor[] = "ash-enable-memory-monitor";
125 #endif
127 #if defined(OS_CHROMEOS)
128 // Enables the multi user icons in the system tray.
129 const char kAshEnableMultiUserTray[] = "ash-enable-multi-user-tray";
130 #endif
132 // Enables the Oak tree viewer.
133 const char kAshEnableOak[] = "ash-enable-oak";
135 // Enables software based mirroring.
136 const char kAshEnableSoftwareMirroring[] = "ash-enable-software-mirroring";
138 // Enables "sticky" edges instead of "snap-to-edge"
139 const char kAshEnableStickyEdges[] = "ash-enable-sticky-edges";
141 // When this flag is set, system sounds will be played whether the
142 // ChromeVox is enabled or not.
143 const char kAshEnableSystemSounds[] = "ash-enable-system-sounds";
145 // Enables showing the tray bubble by dragging on the shelf.
146 const char kAshEnableTrayDragging[] = "ash-enable-tray-dragging";
148 // Forces chrome to use mirror mode when an external display is connected.
149 const char kAshForceMirrorMode[] = "ash-force-mirror-mode";
151 // Wallpaper to use in guest mode (as paths to trusted, non-user-writable JPEG
152 // files).
153 const char kAshGuestWallpaperLarge[] = "ash-guest-wallpaper-large";
154 const char kAshGuestWallpaperSmall[] = "ash-guest-wallpaper-small";
156 // Hides notifications that are irrelevant to Chrome OS device factory testing,
157 // such as battery level updates.
158 const char kAshHideNotificationsForFactory[] =
159 "ash-hide-notifications-for-factory";
161 // Sets a window size, optional position, and optional scale factor.
162 // "1024x768" creates a window of size 1024x768.
163 // "100+200-1024x768" positions the window at 100,200.
164 // "1024x768*2" sets the scale factor to 2 for a high DPI display.
165 const char kAshHostWindowBounds[] = "ash-host-window-bounds";
167 // Specifies the delay in milliseconds before beginning overview mode after
168 // getting an alt tab keypress.
169 const char kAshOverviewDelayOnAltTab[] = "ash-overview-delay-on-alt-tab";
171 // Specifies the layout mode and offsets for the secondary display for
172 // testing. The format is "<t|r|b|l>,<offset>" where t=TOP, r=RIGHT,
173 // b=BOTTOM and L=LEFT. For example, 'r,-100' means the secondary display
174 // is positioned on the right with -100 offset. (above than primary)
175 const char kAshSecondaryDisplayLayout[] = "ash-secondary-display-layout";
177 // Use the old behavior where the user can pick the width of a side maximized
178 // window. The user selects the width of the side maximized window based on how
179 // far off the edge of the work area they drag the window.
180 const char kAshMultipleSnapWindowWidths[] = "ash-multiple-snap-window-widths";
182 // Enables the heads-up display for tracking touch points.
183 const char kAshTouchHud[] = "ash-touch-hud";
185 // Use alternate layout of the shelf for testing a new look and feel:
186 // Slightly smaller profile, only 2 states for the "bar highlight" on
187 // launcher buttons, app list icon with more visible state indication,
188 // app list icon repositionable and defaulting as 1st item in shelf,
189 // more visible state indication for background on status area.
190 // crbug's [244983, 244990, 244994, 245005, 245012]
191 const char kAshUseAlternateShelfLayout[] = "ash-use-alternate-shelf";
193 // Uses the 1st display in --ash-host-window-bounds as internal display.
194 // This is for debugging on linux desktop.
195 const char kAshUseFirstDisplayAsInternal[] =
196 "ash-use-first-display-as-internal";
198 // (Most) Chrome OS hardware reports ACPI power button releases correctly.
199 // Standard hardware reports releases immediately after presses. If set, we
200 // lock the screen or shutdown the system immediately in response to a press
201 // instead of displaying an interactive animation.
202 const char kAuraLegacyPowerButton[] = "aura-legacy-power-button";
204 #if defined(OS_WIN)
205 // Force Ash to open its root window on the desktop, even on Windows 8 where
206 // it would normally end up in metro.
207 const char kForceAshToDesktop[] = "ash-force-desktop";
209 #endif
211 // Flags explicitly show or hide the shelf alignment menu.
212 const char kShowShelfAlignmentMenu[] = "show-launcher-alignment-menu";
213 const char kHideShelfAlignmentMenu[] = "hide-launcher-alignment-menu";
215 bool UseAlternateFrameCaptionButtonStyle() {
216 // For the sake of simplicity, the alternate caption button style is only
217 // used if snapped windows are always 50% of the screen's width.
218 CommandLine* command_line = CommandLine::ForCurrentProcess();
219 return command_line->HasSwitch(kAshEnableAlternateFrameCaptionButtonStyle) &&
220 !command_line->HasSwitch(kAshMultipleSnapWindowWidths);
223 bool UseAlternateShelfLayout() {
224 return !CommandLine::ForCurrentProcess()->
225 HasSwitch(kAshDisableAlternateShelfLayout);
228 bool UseDragOffShelf() {
229 return !CommandLine::ForCurrentProcess()->
230 HasSwitch(kAshDisableDragOffShelf);
233 bool UseImmersiveFullscreenForAllWindows() {
234 return !CommandLine::ForCurrentProcess()->HasSwitch(
235 kAshEnableImmersiveFullscreenForBrowserOnly);
238 bool ShowShelfAlignmentMenu() {
239 return !CommandLine::ForCurrentProcess()->
240 HasSwitch(kHideShelfAlignmentMenu);
243 // Returns true if the full multi profile mode (M-31 version) is active.
244 bool UseFullMultiProfileMode() {
245 #if defined(OS_CHROMEOS)
246 return CommandLine::ForCurrentProcess()->
247 HasSwitch(kAshEnableFullMultiProfileMode);
248 #else
249 return false;
250 #endif
253 bool UseMultiUserTray() {
254 #if defined(OS_CHROMEOS)
255 // TODO(skuhne): If this gets removed for good, remove also
256 // |SystemTray::user_items_| and the use of it.
257 return CommandLine::ForCurrentProcess()->HasSwitch(kAshEnableMultiUserTray);
258 #else
259 return false;
260 #endif
263 bool UseOverviewMode() {
264 return !CommandLine::ForCurrentProcess()->HasSwitch(kAshDisableOverviewMode);
267 bool UseDockedWindows() {
268 return !CommandLine::ForCurrentProcess()->HasSwitch(kAshDisableDockedWindows);
271 #if defined(OS_CHROMEOS)
272 bool ShowAudioDeviceMenu() {
273 return !CommandLine::ForCurrentProcess()->
274 HasSwitch(kAshDisableAudioDeviceMenu);
277 bool UseUsbChargerNotification() {
278 return !CommandLine::ForCurrentProcess()->
279 HasSwitch(kAshDisableUsbChargerNotification);
281 #endif
283 } // namespace switches
284 } // namespace ash