Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 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 | |
Torne (Richard Coles) | a93a17c | 2013-05-15 11:34:50 +0100 | [diff] [blame] | 7 | #include "base/command_line.h" |
| 8 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 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 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 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 | |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 32 | // UI to show preferred networks in the status area (for testing). |
| 33 | const char kAshDebugShowPreferredNetworks[] = |
| 34 | "ash-debug-show-preferred-networks"; |
| 35 | |
Torne (Richard Coles) | f2477e0 | 2013-11-28 11:55:43 +0000 | [diff] [blame] | 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"; |
| 40 | |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 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"; |
| 44 | |
Torne (Richard Coles) | 58537e2 | 2013-09-12 12:10:22 +0100 | [diff] [blame] | 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"; |
| 49 | |
| 50 | // Disable the alternate shelf layout. |
| 51 | const char kAshDisableAlternateShelfLayout[] = |
| 52 | "ash-disable-alternate-shelf-layout"; |
| 53 | |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 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 |
| 60 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 61 | // Disable auto window maximization logic. |
| 62 | const char kAshDisableAutoMaximizing[] = "ash-disable-auto-maximizing"; |
| 63 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 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"; |
| 68 | |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame^] | 69 | // Disable ability to dock windows at the desktop edge. |
| 70 | const char kAshDisableDockedWindows[] = "ash-disable-docked-windows"; |
| 71 | |
| 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"; |
| 75 | |
| 76 | // Disable dragging items off the shelf to unpin them. |
| 77 | const char kAshDisableDragOffShelf[] = "ash-disable-drag-off-shelf"; |
| 78 | |
| 79 | // Disables overview mode for window switching. |
| 80 | const char kAshDisableOverviewMode[] = "ash-disable-overview-mode"; |
| 81 | |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 82 | #if defined(OS_CHROMEOS) |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 83 | // Disable the notification when a low-power USB charger is connected. |
| 84 | const char kAshDisableUsbChargerNotification[] = |
| 85 | "ash-disable-usb-charger-notification"; |
Ben Murdoch | 58e6fbe | 2013-07-26 10:20:38 +0100 | [diff] [blame] | 86 | |
| 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) |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 92 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 93 | // Enable advanced gestures (e.g. for window management). |
| 94 | const char kAshEnableAdvancedGestures[] = "ash-enable-advanced-gestures"; |
| 95 | |
Torne (Richard Coles) | 58537e2 | 2013-09-12 12:10:22 +0100 | [diff] [blame] | 96 | // Use alternate visual style for the caption buttons (minimize, maximize, |
| 97 | // restore, close). The alternate style: |
| 98 | // - Adds a dedicated button for minimize. |
Torne (Richard Coles) | 58537e2 | 2013-09-12 12:10:22 +0100 | [diff] [blame] | 99 | // - Removes the maximize button's help bubble. |
Torne (Richard Coles) | 58537e2 | 2013-09-12 12:10:22 +0100 | [diff] [blame] | 100 | const char kAshEnableAlternateFrameCaptionButtonStyle[] = |
| 101 | "ash-enable-alternate-caption-button"; |
| 102 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 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"; |
| 106 | |
Torne (Richard Coles) | f2477e0 | 2013-11-28 11:55:43 +0000 | [diff] [blame] | 107 | // Enables putting all windows into immersive fullscreen via <F4>. |
| 108 | const char kAshEnableImmersiveFullscreenForAllWindows[] = |
| 109 | "ash-enable-immersive-all-windows"; |
| 110 | |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame^] | 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"; |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 115 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 116 | #if defined(OS_LINUX) |
| 117 | // Enable memory monitoring. |
| 118 | const char kAshEnableMemoryMonitor[] = "ash-enable-memory-monitor"; |
| 119 | #endif |
Torne (Richard Coles) | f2477e0 | 2013-11-28 11:55:43 +0000 | [diff] [blame] | 120 | |
| 121 | #if defined(OS_CHROMEOS) |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame^] | 122 | // Enables key bindings to scroll magnified screen. |
| 123 | const char kAshEnableMagnifierKeyScroller[] = |
| 124 | "ash-enable-magnifier-key-scroller"; |
| 125 | |
Torne (Richard Coles) | f2477e0 | 2013-11-28 11:55:43 +0000 | [diff] [blame] | 126 | // Enables the multi user icons in the system tray. |
| 127 | const char kAshEnableMultiUserTray[] = "ash-enable-multi-user-tray"; |
| 128 | #endif |
| 129 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 130 | // Enables the Oak tree viewer. |
| 131 | const char kAshEnableOak[] = "ash-enable-oak"; |
| 132 | |
Torne (Richard Coles) | 68043e1 | 2013-09-26 13:24:57 +0100 | [diff] [blame] | 133 | // Enables software based mirroring. |
| 134 | const char kAshEnableSoftwareMirroring[] = "ash-enable-software-mirroring"; |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 135 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 136 | // Enables "sticky" edges instead of "snap-to-edge" |
| 137 | const char kAshEnableStickyEdges[] = "ash-enable-sticky-edges"; |
| 138 | |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame^] | 139 | // When this flag is set, system sounds will be played whether the |
| 140 | // ChromeVox is enabled or not. |
| 141 | const char kAshEnableSystemSounds[] = "ash-enable-system-sounds"; |
| 142 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 143 | // Enables showing the tray bubble by dragging on the shelf. |
| 144 | const char kAshEnableTrayDragging[] = "ash-enable-tray-dragging"; |
| 145 | |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 146 | // Forces chrome to use mirror mode when an external display is connected. |
| 147 | const char kAshForceMirrorMode[] = "ash-force-mirror-mode"; |
| 148 | |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 149 | // Wallpaper to use in guest mode (as paths to trusted, non-user-writable JPEG |
| 150 | // files). |
| 151 | const char kAshGuestWallpaperLarge[] = "ash-guest-wallpaper-large"; |
| 152 | const char kAshGuestWallpaperSmall[] = "ash-guest-wallpaper-small"; |
| 153 | |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 154 | // Hides notifications that are irrelevant to Chrome OS device factory testing, |
| 155 | // such as battery level updates. |
| 156 | const char kAshHideNotificationsForFactory[] = |
| 157 | "ash-hide-notifications-for-factory"; |
| 158 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 159 | // Sets a window size, optional position, and optional scale factor. |
| 160 | // "1024x768" creates a window of size 1024x768. |
| 161 | // "100+200-1024x768" positions the window at 100,200. |
| 162 | // "1024x768*2" sets the scale factor to 2 for a high DPI display. |
| 163 | const char kAshHostWindowBounds[] = "ash-host-window-bounds"; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 164 | |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 165 | // Specifies the delay in milliseconds before beginning overview mode after |
| 166 | // getting an alt tab keypress. |
| 167 | const char kAshOverviewDelayOnAltTab[] = "ash-overview-delay-on-alt-tab"; |
| 168 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 169 | // Specifies the layout mode and offsets for the secondary display for |
| 170 | // testing. The format is "<t|r|b|l>,<offset>" where t=TOP, r=RIGHT, |
| 171 | // b=BOTTOM and L=LEFT. For example, 'r,-100' means the secondary display |
| 172 | // is positioned on the right with -100 offset. (above than primary) |
| 173 | const char kAshSecondaryDisplayLayout[] = "ash-secondary-display-layout"; |
| 174 | |
Torne (Richard Coles) | f2477e0 | 2013-11-28 11:55:43 +0000 | [diff] [blame] | 175 | // Use the old behavior where the user can pick the width of a side maximized |
| 176 | // window. The user selects the width of the side maximized window based on how |
| 177 | // far off the edge of the work area they drag the window. |
| 178 | const char kAshMultipleSnapWindowWidths[] = "ash-multiple-snap-window-widths"; |
| 179 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 180 | // Enables the heads-up display for tracking touch points. |
| 181 | const char kAshTouchHud[] = "ash-touch-hud"; |
| 182 | |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 183 | // Use alternate layout of the shelf for testing a new look and feel: |
| 184 | // Slightly smaller profile, only 2 states for the "bar highlight" on |
| 185 | // launcher buttons, app list icon with more visible state indication, |
| 186 | // app list icon repositionable and defaulting as 1st item in shelf, |
| 187 | // more visible state indication for background on status area. |
| 188 | // crbug's [244983, 244990, 244994, 245005, 245012] |
| 189 | const char kAshUseAlternateShelfLayout[] = "ash-use-alternate-shelf"; |
| 190 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 191 | // Uses the 1st display in --ash-host-window-bounds as internal display. |
| 192 | // This is for debugging on linux desktop. |
| 193 | const char kAshUseFirstDisplayAsInternal[] = |
| 194 | "ash-use-first-display-as-internal"; |
| 195 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 196 | // (Most) Chrome OS hardware reports ACPI power button releases correctly. |
| 197 | // Standard hardware reports releases immediately after presses. If set, we |
| 198 | // lock the screen or shutdown the system immediately in response to a press |
| 199 | // instead of displaying an interactive animation. |
| 200 | const char kAuraLegacyPowerButton[] = "aura-legacy-power-button"; |
| 201 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 202 | #if defined(OS_WIN) |
| 203 | // Force Ash to open its root window on the desktop, even on Windows 8 where |
| 204 | // it would normally end up in metro. |
| 205 | const char kForceAshToDesktop[] = "ash-force-desktop"; |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 206 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 207 | #endif |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 208 | |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame^] | 209 | // Flags explicitly show or hide the shelf alignment menu. |
| 210 | const char kShowShelfAlignmentMenu[] = "show-launcher-alignment-menu"; |
| 211 | const char kHideShelfAlignmentMenu[] = "hide-launcher-alignment-menu"; |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 212 | |
Torne (Richard Coles) | 58537e2 | 2013-09-12 12:10:22 +0100 | [diff] [blame] | 213 | bool UseAlternateFrameCaptionButtonStyle() { |
Torne (Richard Coles) | a3f6a49 | 2013-12-18 16:25:09 +0000 | [diff] [blame] | 214 | // For the sake of simplicity, the alternate caption button style is only |
| 215 | // used if snapped windows are always 50% of the screen's width. |
| 216 | CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 217 | return command_line->HasSwitch(kAshEnableAlternateFrameCaptionButtonStyle) && |
| 218 | !command_line->HasSwitch(kAshMultipleSnapWindowWidths); |
Torne (Richard Coles) | 58537e2 | 2013-09-12 12:10:22 +0100 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | bool UseAlternateShelfLayout() { |
| 222 | return !CommandLine::ForCurrentProcess()-> |
| 223 | HasSwitch(kAshDisableAlternateShelfLayout); |
Torne (Richard Coles) | 3551c9c | 2013-08-23 16:39:15 +0100 | [diff] [blame] | 224 | } |
| 225 | |
Torne (Richard Coles) | 424c4d7 | 2013-08-30 15:14:49 +0100 | [diff] [blame] | 226 | bool UseDragOffShelf() { |
Torne (Richard Coles) | 58537e2 | 2013-09-12 12:10:22 +0100 | [diff] [blame] | 227 | return !CommandLine::ForCurrentProcess()-> |
| 228 | HasSwitch(kAshDisableDragOffShelf); |
Torne (Richard Coles) | 424c4d7 | 2013-08-30 15:14:49 +0100 | [diff] [blame] | 229 | } |
| 230 | |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame^] | 231 | bool UseImmersiveFullscreenForAllWindows() { |
| 232 | return !CommandLine::ForCurrentProcess()->HasSwitch( |
| 233 | kAshEnableImmersiveFullscreenForBrowserOnly); |
| 234 | } |
| 235 | |
Torne (Richard Coles) | 3551c9c | 2013-08-23 16:39:15 +0100 | [diff] [blame] | 236 | bool ShowShelfAlignmentMenu() { |
Torne (Richard Coles) | 58537e2 | 2013-09-12 12:10:22 +0100 | [diff] [blame] | 237 | return !CommandLine::ForCurrentProcess()-> |
| 238 | HasSwitch(kHideShelfAlignmentMenu); |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 239 | } |
| 240 | |
Torne (Richard Coles) | f2477e0 | 2013-11-28 11:55:43 +0000 | [diff] [blame] | 241 | bool UseMultiUserTray() { |
| 242 | #if defined(OS_CHROMEOS) |
| 243 | // TODO(skuhne): If this gets removed for good, remove also |
| 244 | // |SystemTray::user_items_| and the use of it. |
| 245 | return CommandLine::ForCurrentProcess()->HasSwitch(kAshEnableMultiUserTray); |
| 246 | #else |
| 247 | return false; |
| 248 | #endif |
| 249 | } |
| 250 | |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 251 | bool UseOverviewMode() { |
| 252 | return !CommandLine::ForCurrentProcess()->HasSwitch(kAshDisableOverviewMode); |
| 253 | } |
| 254 | |
Torne (Richard Coles) | f2477e0 | 2013-11-28 11:55:43 +0000 | [diff] [blame] | 255 | bool UseDockedWindows() { |
| 256 | return !CommandLine::ForCurrentProcess()->HasSwitch(kAshDisableDockedWindows); |
| 257 | } |
| 258 | |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 259 | #if defined(OS_CHROMEOS) |
Torne (Richard Coles) | a93a17c | 2013-05-15 11:34:50 +0100 | [diff] [blame] | 260 | bool ShowAudioDeviceMenu() { |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 261 | return !CommandLine::ForCurrentProcess()-> |
Torne (Richard Coles) | 58537e2 | 2013-09-12 12:10:22 +0100 | [diff] [blame] | 262 | HasSwitch(kAshDisableAudioDeviceMenu); |
Torne (Richard Coles) | a93a17c | 2013-05-15 11:34:50 +0100 | [diff] [blame] | 263 | } |
| 264 | |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 265 | bool UseUsbChargerNotification() { |
| 266 | return !CommandLine::ForCurrentProcess()-> |
Torne (Richard Coles) | 58537e2 | 2013-09-12 12:10:22 +0100 | [diff] [blame] | 267 | HasSwitch(kAshDisableUsbChargerNotification); |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 268 | } |
| 269 | #endif |
| 270 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 271 | } // namespace switches |
| 272 | } // namespace ash |