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