diff options
-rw-r--r-- | ash/ash_switches.cc | 30 | ||||
-rw-r--r-- | ash/ash_switches.h | 6 | ||||
-rw-r--r-- | ash/system/chromeos/audio/tray_audio.cc | 3 | ||||
-rw-r--r-- | chrome/browser/about_flags.cc | 2 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/chrome_restart_request.cc | 4 | ||||
-rw-r--r-- | chromeos/audio/audio_device.cc | 2 |
6 files changed, 30 insertions, 17 deletions
diff --git a/ash/ash_switches.cc b/ash/ash_switches.cc index d66c15b..373bd1b 100644 --- a/ash/ash_switches.cc +++ b/ash/ash_switches.cc @@ -44,6 +44,13 @@ const char kAshDefaultGuestWallpaperSmall[] = const char kAshDefaultWallpaperLarge[] = "ash-default-wallpaper-large"; const char kAshDefaultWallpaperSmall[] = "ash-default-wallpaper-small"; +#if defined(OS_CHROMEOS) +// Disable the status tray volume menu for allowing the user to choose an audio +// input and output device. +const char kAshDisableAudioDeviceMenu[] = + "ash-disable-audio-device-menu"; +#endif + // Disable auto window maximization logic. const char kAshDisableAutoMaximizing[] = "ash-disable-auto-maximizing"; @@ -56,8 +63,10 @@ const char kAshDisableAutoWindowPlacement[] = const char kAshDisableDisplayChangeLimiter[] = "ash-disable-display-change-limiter"; +#if defined(OS_CHROMEOS) // Disable the new cras audio handler. const char kAshDisableNewAudioHandler[] = "ash-disable-new-audio-handler"; +#endif // If present new lock animations are enabled. const char kAshDisableNewLockAnimations[] = "ash-disable-new-lock-animations"; @@ -84,11 +93,6 @@ const char kAshDisableUsbChargerNotification[] = "ash-disable-usb-charger-notification"; #endif -// Extend the status tray volume item to allow the user to choose an audio -// input and output device. -const char kAshEnableAudioDeviceMenu[] = - "ash-enable-audio-device-menu"; - // Enable advanced gestures (e.g. for window management). const char kAshEnableAdvancedGestures[] = "ash-enable-advanced-gestures"; @@ -181,6 +185,12 @@ const char kAshDisableDragAndDropAppListToLauncher[] = // in maximized mode. const char kForcedMaximizeMode[] = "forced-maximize-mode"; +bool UseAlternateShelfLayout() { + return CommandLine::ForCurrentProcess()-> + HasSwitch(ash::switches::kAshUseAlternateShelfLayout); +} + +#if defined(OS_CHROMEOS) bool UseNewAudioHandler() { return !CommandLine::ForCurrentProcess()-> HasSwitch(ash::switches::kAshDisableNewAudioHandler); @@ -188,16 +198,10 @@ bool UseNewAudioHandler() { bool ShowAudioDeviceMenu() { return ash::switches::UseNewAudioHandler() && - CommandLine::ForCurrentProcess()-> - HasSwitch(ash::switches::kAshEnableAudioDeviceMenu); -} - -bool UseAlternateShelfLayout() { - return CommandLine::ForCurrentProcess()-> - HasSwitch(ash::switches::kAshUseAlternateShelfLayout); + !CommandLine::ForCurrentProcess()-> + HasSwitch(ash::switches::kAshDisableAudioDeviceMenu); } -#if defined(OS_CHROMEOS) bool UseUsbChargerNotification() { return !CommandLine::ForCurrentProcess()-> HasSwitch(ash::switches::kAshDisableUsbChargerNotification); diff --git a/ash/ash_switches.h b/ash/ash_switches.h index c209992..429291c 100644 --- a/ash/ash_switches.h +++ b/ash/ash_switches.h @@ -26,11 +26,16 @@ ASH_EXPORT extern const char kAshDefaultGuestWallpaperLarge[]; ASH_EXPORT extern const char kAshDefaultGuestWallpaperSmall[]; ASH_EXPORT extern const char kAshDefaultWallpaperLarge[]; ASH_EXPORT extern const char kAshDefaultWallpaperSmall[]; +#if defined(OS_CHROMEOS) +ASH_EXPORT extern const char kAshDisableAudioDeviceMenu[]; +#endif ASH_EXPORT extern const char kAshDisableAutoMaximizing[]; ASH_EXPORT extern const char kAshDisableAutoWindowPlacement[]; ASH_EXPORT extern const char kAshDisableDisplayChangeLimiter[]; ASH_EXPORT extern const char kAshDisableImmersiveFullscreen[]; +#if defined(OS_CHROMEOS) ASH_EXPORT extern const char kAshDisableNewAudioHandler[]; +#endif ASH_EXPORT extern const char kAshDisableNewLockAnimations[]; ASH_EXPORT extern const char kAshDisablePerAppLauncher[]; ASH_EXPORT extern const char kAshDisableUIScaling[]; @@ -40,7 +45,6 @@ ASH_EXPORT extern const char kAshDisableDragAndDropAppListToLauncher[]; ASH_EXPORT extern const char kAshDisableSoftwareMirroring[]; ASH_EXPORT extern const char kAshDisableUsbChargerNotification[]; #endif -ASH_EXPORT extern const char kAshEnableAudioDeviceMenu[]; ASH_EXPORT extern const char kAshEnableAdvancedGestures[]; ASH_EXPORT extern const char kAshEnableBrightnessControl[]; ASH_EXPORT extern const char kAshEnableDockedWindows[]; diff --git a/ash/system/chromeos/audio/tray_audio.cc b/ash/system/chromeos/audio/tray_audio.cc index 2e81e3a..e9fe6dc 100644 --- a/ash/system/chromeos/audio/tray_audio.cc +++ b/ash/system/chromeos/audio/tray_audio.cc @@ -259,7 +259,8 @@ class VolumeView : public ActionableView, // Show output device icon if necessary. chromeos::AudioDevice device; - audio_handler->GetActiveOutputDevice(&device); + if (!audio_handler->GetActiveOutputDevice(&device)) + return; int device_icon = GetAudioDeviceIconId(device.type); if (device_icon != kNoAudioDeviceIcon) { device_type_->SetVisible(true); diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index cfafecc..823d2a5 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -1227,7 +1227,7 @@ const Experiment kExperiments[] = { IDS_FLAGS_ASH_AUDIO_DEVICE_MENU_NAME, IDS_FLAGS_ASH_AUDIO_DEVICE_MENU_DESCRIPTION, kOsCrOS, - SINGLE_VALUE_TYPE(ash::switches::kAshEnableAudioDeviceMenu) + ENABLE_DISABLE_VALUE_TYPE("", ash::switches::kAshDisableAudioDeviceMenu) }, { "enable-carrier-switching", diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc index b2106f3..48f66b1 100644 --- a/chrome/browser/chromeos/login/chrome_restart_request.cc +++ b/chrome/browser/chromeos/login/chrome_restart_request.cc @@ -139,8 +139,10 @@ std::string DeriveCommandLine(const GURL& start_url, ash::switches::kAshDefaultGuestWallpaperSmall, ash::switches::kAshDefaultWallpaperLarge, ash::switches::kAshDefaultWallpaperSmall, +#if defined(OS_CHROMEOS) + ash::switches::kAshDisableAudioDeviceMenu, ash::switches::kAshDisableNewAudioHandler, - ash::switches::kAshEnableAudioDeviceMenu, +#endif ash::switches::kAshHostWindowBounds, ash::switches::kAshTouchHud, ash::switches::kAuraLegacyPowerButton, diff --git a/chromeos/audio/audio_device.cc b/chromeos/audio/audio_device.cc index 6e1f1b3..5e3aeb8 100644 --- a/chromeos/audio/audio_device.cc +++ b/chromeos/audio/audio_device.cc @@ -82,6 +82,8 @@ namespace chromeos { AudioDevice::AudioDevice() : is_input(false), id(0), + display_name(""), + type(AUDIO_TYPE_OTHER), priority(0), active(false), plugged_time(0) { |