- add sources.
[platform/framework/web/crosswalk.git] / src / ash / ash_switches.cc
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 "ash/ash_switches.h"
6
7 #include "base/command_line.h"
8
9 namespace ash {
10 namespace switches {
11
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";
19
20 // Constrains the pointer movement within a root window on desktop.
21 const char kAshConstrainPointerToRoot[] = "ash-constrain-pointer-to-root";
22
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";
28
29 // Enable keyboard shortcuts useful for debugging.
30 const char kAshDebugShortcuts[] = "ash-debug-shortcuts";
31
32 // UI to show preferred networks in the status area (for testing).
33 const char kAshDebugShowPreferredNetworks[] =
34     "ash-debug-show-preferred-networks";
35
36 // Default wallpaper to use (as paths to trusted, non-user-writable JPEG files).
37 const char kAshDefaultWallpaperLarge[] = "ash-default-wallpaper-large";
38 const char kAshDefaultWallpaperSmall[] = "ash-default-wallpaper-small";
39
40 // Use the normal visual style for the caption buttons (minimize, maximize,
41 // restore, close).
42 const char kAshDisableAlternateFrameCaptionButtonStyle[] =
43     "ash-disable-alternate-caption-button";
44
45 // Disable the alternate shelf layout.
46 const char kAshDisableAlternateShelfLayout[] =
47     "ash-disable-alternate-shelf-layout";
48
49 #if defined(OS_CHROMEOS)
50 // Disable the status tray volume menu for allowing the user to choose an audio
51 // input and output device.
52 const char kAshDisableAudioDeviceMenu[] =
53     "ash-disable-audio-device-menu";
54 #endif
55
56 // Disable auto window maximization logic.
57 const char kAshDisableAutoMaximizing[] = "ash-disable-auto-maximizing";
58
59 // Disables the limitter to throttle how quickly a user
60 // can change display settings.
61 const char kAshDisableDisplayChangeLimiter[] =
62     "ash-disable-display-change-limiter";
63
64 #if defined(OS_CHROMEOS)
65 // Disable the notification when a low-power USB charger is connected.
66 const char kAshDisableUsbChargerNotification[] =
67     "ash-disable-usb-charger-notification";
68
69 // TODO(jamescook): Remove this unused flag. It exists only to allow the
70 // "Enable audio device menu" about:flags item to have the tri-state
71 // default/enabled/disabled UI.
72 const char kAshEnableAudioDeviceMenu[] = "ash-enable-audio-device-menu";
73 #endif  // defined(OS_CHROMEOS)
74
75 // Enable advanced gestures (e.g. for window management).
76 const char kAshEnableAdvancedGestures[] = "ash-enable-advanced-gestures";
77
78 // Use alternate visual style for the caption buttons (minimize, maximize,
79 // restore, close). The alternate style:
80 // - Adds a dedicated button for minimize.
81 // - Increases the height of the maximized header.
82 // - Removes the maximize button's help bubble.
83 // - Switches snapping a window left/right to be always 50%.
84 const char kAshEnableAlternateFrameCaptionButtonStyle[] =
85     "ash-enable-alternate-caption-button";
86
87 // Always enable brightness control. Used by machines that don't report their
88 // main monitor as internal.
89 const char kAshEnableBrightnessControl[] = "ash-enable-brightness-control";
90
91 // Enable the dock area on a desktop.
92 const char kAshEnableDockedWindows[] = "ash-enable-docked-windows";
93
94 // Disable dragging items off the shelf to unpin them.
95 const char kAshDisableDragOffShelf[] = "ash-disable-drag-off-shelf";
96
97 #if defined(OS_CHROMEOS)
98 // Enables the "full multi profile mode" - as it was in M-31.
99 const char kAshEnableFullMultiProfileMode[] =
100     "ash-enable-full-multi-profile-mode";
101 #endif
102
103 #if defined(OS_LINUX)
104 // Enable memory monitoring.
105 const char kAshEnableMemoryMonitor[] = "ash-enable-memory-monitor";
106 #endif
107 // Enables the Oak tree viewer.
108 const char kAshEnableOak[] = "ash-enable-oak";
109
110 // Disables overview mode for window switching.
111 const char kAshDisableOverviewMode[] = "ash-disable-overview-mode";
112
113 // Enables software based mirroring.
114 const char kAshEnableSoftwareMirroring[] = "ash-enable-software-mirroring";
115
116 // Enables "sticky" edges instead of "snap-to-edge"
117 const char kAshEnableStickyEdges[] = "ash-enable-sticky-edges";
118
119 // Enables showing the tray bubble by dragging on the shelf.
120 const char kAshEnableTrayDragging[] = "ash-enable-tray-dragging";
121
122 // Forces chrome to use mirror mode when an external display is connected.
123 const char kAshForceMirrorMode[] = "ash-force-mirror-mode";
124
125 // Wallpaper to use in guest mode (as paths to trusted, non-user-writable JPEG
126 // files).
127 const char kAshGuestWallpaperLarge[] = "ash-guest-wallpaper-large";
128 const char kAshGuestWallpaperSmall[] = "ash-guest-wallpaper-small";
129
130 // Hides notifications that are irrelevant to Chrome OS device factory testing,
131 // such as battery level updates.
132 const char kAshHideNotificationsForFactory[] =
133     "ash-hide-notifications-for-factory";
134
135 // Sets a window size, optional position, and optional scale factor.
136 // "1024x768" creates a window of size 1024x768.
137 // "100+200-1024x768" positions the window at 100,200.
138 // "1024x768*2" sets the scale factor to 2 for a high DPI display.
139 const char kAshHostWindowBounds[] = "ash-host-window-bounds";
140
141 // OEM-supplied wallpaper (as paths to trusted, non-user-writable JPEG files).
142 const char kAshOemWallpaperLarge[] = "ash-oem-wallpaper-large";
143 const char kAshOemWallpaperSmall[] = "ash-oem-wallpaper-small";
144
145 // Specifies the delay in milliseconds before beginning overview mode after
146 // getting an alt tab keypress.
147 const char kAshOverviewDelayOnAltTab[] = "ash-overview-delay-on-alt-tab";
148
149 // Specifies the layout mode and offsets for the secondary display for
150 // testing. The format is "<t|r|b|l>,<offset>" where t=TOP, r=RIGHT,
151 // b=BOTTOM and L=LEFT. For example, 'r,-100' means the secondary display
152 // is positioned on the right with -100 offset. (above than primary)
153 const char kAshSecondaryDisplayLayout[] = "ash-secondary-display-layout";
154
155 // Enables the heads-up display for tracking touch points.
156 const char kAshTouchHud[] = "ash-touch-hud";
157
158 // Use alternate layout of the shelf for testing a new look and feel:
159 // Slightly smaller profile, only 2 states for the "bar highlight" on
160 // launcher buttons, app list icon with more visible state indication,
161 // app list icon repositionable and defaulting as 1st item in shelf,
162 // more visible state indication for background on status area.
163 // crbug's [244983, 244990, 244994, 245005, 245012]
164 const char kAshUseAlternateShelfLayout[] = "ash-use-alternate-shelf";
165
166 // Flags explicitly show or hide the shelf alignment menu.
167 const char kShowShelfAlignmentMenu[] = "show-launcher-alignment-menu";
168 const char kHideShelfAlignmentMenu[] = "hide-launcher-alignment-menu";
169
170 // Uses the 1st display in --ash-host-window-bounds as internal display.
171 // This is for debugging on linux desktop.
172 const char kAshUseFirstDisplayAsInternal[] =
173     "ash-use-first-display-as-internal";
174
175 // (Most) Chrome OS hardware reports ACPI power button releases correctly.
176 // Standard hardware reports releases immediately after presses.  If set, we
177 // lock the screen or shutdown the system immediately in response to a press
178 // instead of displaying an interactive animation.
179 const char kAuraLegacyPowerButton[] = "aura-legacy-power-button";
180
181 #if defined(OS_WIN)
182 // Force Ash to open its root window on the desktop, even on Windows 8 where
183 // it would normally end up in metro.
184 const char kForceAshToDesktop[] = "ash-force-desktop";
185
186 #endif
187
188 // Disallow items to be dragged from the app launcher list into the launcher.
189 const char kAshDisableDragAndDropAppListToLauncher[] =
190     "ash-disable-drag-and-drop-applist-to-launcher";
191
192 bool UseAlternateFrameCaptionButtonStyle() {
193   return CommandLine::ForCurrentProcess()->
194       HasSwitch(kAshEnableAlternateFrameCaptionButtonStyle);
195 }
196
197 bool UseAlternateShelfLayout() {
198   return !CommandLine::ForCurrentProcess()->
199       HasSwitch(kAshDisableAlternateShelfLayout);
200 }
201
202 bool UseDragOffShelf() {
203   return !CommandLine::ForCurrentProcess()->
204       HasSwitch(kAshDisableDragOffShelf);
205 }
206
207 bool ShowShelfAlignmentMenu() {
208   return !CommandLine::ForCurrentProcess()->
209       HasSwitch(kHideShelfAlignmentMenu);
210 }
211
212 // Returns true if the full multi profile mode (M-31 version) is active.
213 bool UseFullMultiProfileMode() {
214 #if defined(OS_CHROMEOS)
215   return CommandLine::ForCurrentProcess()->
216       HasSwitch(kAshEnableFullMultiProfileMode);
217 #else
218   return false;
219 #endif
220 }
221
222 bool UseOverviewMode() {
223   return !CommandLine::ForCurrentProcess()->HasSwitch(kAshDisableOverviewMode);
224 }
225
226 #if defined(OS_CHROMEOS)
227 bool ShowAudioDeviceMenu() {
228   return !CommandLine::ForCurrentProcess()->
229       HasSwitch(kAshDisableAudioDeviceMenu);
230 }
231
232 bool UseUsbChargerNotification() {
233   return !CommandLine::ForCurrentProcess()->
234       HasSwitch(kAshDisableUsbChargerNotification);
235 }
236 #endif
237
238 }  // namespace switches
239 }  // namespace ash