Fix crash when JS alert from background page appears during lock screen
[chromium-blink-merge.git] / ash / ash_switches.cc
blob14e9064eabdc8ef3fa99b0b26785af903287ac8a
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 // Disable auto window maximization logic.
33 const char kAshDisableAutoMaximizing[] = "ash-disable-auto-maximizing";
35 // Disable support for auto window placement.
36 const char kAshDisableAutoWindowPlacement[] =
37 "ash-enable-auto-window-placement";
39 // Disables the limitter to throttle how quickly a user
40 // can change display settings.
41 const char kAshDisableDisplayChangeLimiter[] =
42 "ash-disable-display-change-limiter";
44 // Disable the new cras audio handler.
45 const char kAshDisableNewAudioHandler[] = "ash-disable-new-audio-handler";
47 // If present new lock animations are enabled.
48 const char kAshDisableNewLockAnimations[] = "ash-disable-new-lock-animations";
50 // Disable the per application grouping version of the launcher.
51 const char kAshDisablePerAppLauncher[] = "ash-disable-per-app-launcher";
53 // Disables display rotation.
54 const char kAshDisableDisplayRotation[] = "ash-disable-display-rotation";
56 // Disable immersive fullscreen mode, regardless of default setting.
57 const char kAshDisableImmersiveFullscreen[] =
58 "ash-disable-immersive-fullscreen";
60 // Disables ui scaling.
61 const char kAshDisableUIScaling[] = "ash-disable-ui-scaling";
63 // Extend the status tray volume item to allow the user to choose an audio
64 // input and output device.
65 const char kAshEnableAudioDeviceMenu[] =
66 "ash-enable-audio-device-menu";
68 // Enable advanced gestures (e.g. for window management).
69 const char kAshEnableAdvancedGestures[] = "ash-enable-advanced-gestures";
71 // Always enable brightness control. Used by machines that don't report their
72 // main monitor as internal.
73 const char kAshEnableBrightnessControl[] = "ash-enable-brightness-control";
75 // Enable immersive fullscreen mode, regardless of default setting.
76 const char kAshEnableImmersiveFullscreen[] = "ash-enable-immersive-fullscreen";
78 #if defined(OS_CHROMEOS)
79 // Enable compositor based mirroring.
80 const char kAshEnableSoftwareMirroring[] = "ash-enable-software-mirroring";
81 #endif
83 #if defined(OS_LINUX)
84 // Enable memory monitoring.
85 const char kAshEnableMemoryMonitor[] = "ash-enable-memory-monitor";
86 #endif
88 // Enables the Oak tree viewer.
89 const char kAshEnableOak[] = "ash-enable-oak";
91 // Enables "sticky" edges instead of "snap-to-edge"
92 const char kAshEnableStickyEdges[] = "ash-enable-sticky-edges";
94 // Enables showing the tray bubble by dragging on the shelf.
95 const char kAshEnableTrayDragging[] = "ash-enable-tray-dragging";
97 // Enable workspace switching via a three finger vertical scroll.
98 const char kAshEnableWorkspaceScrubbing[] = "ash-enable-workspace-scrubbing";
100 // Forces chrome to use mirror mode when an external display is connected.
101 const char kAshForceMirrorMode[] = "ash-force-mirror-mode";
103 // Sets a window size, optional position, and optional scale factor.
104 // "1024x768" creates a window of size 1024x768.
105 // "100+200-1024x768" positions the window at 100,200.
106 // "1024x768*2" sets the scale factor to 2 for a high DPI display.
107 const char kAshHostWindowBounds[] = "ash-host-window-bounds";
109 // Hides the small tab indicators at the top of the screen during immersive
110 // fullscreen mode.
111 const char kAshImmersiveHideTabIndicators[] =
112 "ash-immersive-hide-tab-indicators";
114 // Specifies the layout mode and offsets for the secondary display for
115 // testing. The format is "<t|r|b|l>,<offset>" where t=TOP, r=RIGHT,
116 // b=BOTTOM and L=LEFT. For example, 'r,-100' means the secondary display
117 // is positioned on the right with -100 offset. (above than primary)
118 const char kAshSecondaryDisplayLayout[] = "ash-secondary-display-layout";
120 // Enables the heads-up display for tracking touch points.
121 const char kAshTouchHud[] = "ash-touch-hud";
123 // Uses the 1st display in --ash-host-window-bounds as internal display.
124 // This is for debugging on linux desktop.
125 const char kAshUseFirstDisplayAsInternal[] =
126 "ash-use-first-display-as-internal";
128 // (Most) Chrome OS hardware reports ACPI power button releases correctly.
129 // Standard hardware reports releases immediately after presses. If set, we
130 // lock the screen or shutdown the system immediately in response to a press
131 // instead of displaying an interactive animation.
132 const char kAuraLegacyPowerButton[] = "aura-legacy-power-button";
134 #if defined(OS_WIN)
135 // Force Ash to open its root window on the desktop, even on Windows 8 where
136 // it would normally end up in metro.
137 const char kForceAshToDesktop[] = "ash-force-desktop";
139 #endif
141 // Disallow items to be dragged from the app launcher list into the launcher.
142 const char kAshDisableDragAndDropAppListToLauncher[] =
143 "ash-disable-drag-and-drop-applist-to-launcher";
145 // Enables a mode which enforces all browser & application windows to be created
146 // in maximized mode.
147 const char kForcedMaximizeMode[] = "forced-maximize-mode";
149 bool UseNewAudioHandler() {
150 return !CommandLine::ForCurrentProcess()->
151 HasSwitch(ash::switches::kAshDisableNewAudioHandler);
154 bool ShowAudioDeviceMenu() {
155 return ash::switches::UseNewAudioHandler() &&
156 CommandLine::ForCurrentProcess()->
157 HasSwitch(ash::switches::kAshEnableAudioDeviceMenu);
160 } // namespace switches
161 } // namespace ash