diff options
author | rnk@chromium.org <rnk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-17 12:07:31 +0000 |
---|---|---|
committer | rnk@chromium.org <rnk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-17 12:07:31 +0000 |
commit | 749959fa491bea3417622854702481196085b18b (patch) | |
tree | a59608c219c840e6e05fd2d4b0628fc11a78d32b /ash/ash_switches.cc | |
parent | 0e6eff04c83c16a8d7899dc90850c0463e4662bc (diff) | |
download | chromium_src-749959fa491bea3417622854702481196085b18b.zip chromium_src-749959fa491bea3417622854702481196085b18b.tar.gz chromium_src-749959fa491bea3417622854702481196085b18b.tar.bz2 |
Revert 211846 "Enable ash tray audio device selection menu by de..."
> Enable ash tray audio device selection menu by default.
>
> BUG=259989
> TBR=jamescook@chromium.org
>
> Review URL: https://codereview.chromium.org/18470005
This flag enables code that reads uninitialized memory.
In this code:
// Show output device icon if necessary.
chromeos::AudioDevice device;
audio_handler->GetActiveOutputDevice(&device);
1. AudioDevice() does not default initialize its type field.
2. GetActiveOutputDevice() can fail by returning false, not initializing its
out param.
In this code:
bool CrasAudioHandler::GetActiveOutputDevice(AudioDevice* device) const {
const AudioDevice* active_device = GetDeviceFromId(active_output_node_id_);
if (!device)
return false;
*device = *active_device;
return true;
}
GetDeviceFromId can return NULL, and all the other code in this file is
checking for it except this code. That's probably a bug.
TBR=jennyz@chromium.org
Review URL: https://codereview.chromium.org/19570002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212016 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/ash_switches.cc')
-rw-r--r-- | ash/ash_switches.cc | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/ash/ash_switches.cc b/ash/ash_switches.cc index 373bd1b..d66c15b 100644 --- a/ash/ash_switches.cc +++ b/ash/ash_switches.cc @@ -44,13 +44,6 @@ 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"; @@ -63,10 +56,8 @@ 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"; @@ -93,6 +84,11 @@ 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"; @@ -185,12 +181,6 @@ 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); @@ -198,10 +188,16 @@ bool UseNewAudioHandler() { bool ShowAudioDeviceMenu() { return ash::switches::UseNewAudioHandler() && - !CommandLine::ForCurrentProcess()-> - HasSwitch(ash::switches::kAshDisableAudioDeviceMenu); + CommandLine::ForCurrentProcess()-> + HasSwitch(ash::switches::kAshEnableAudioDeviceMenu); +} + +bool UseAlternateShelfLayout() { + return CommandLine::ForCurrentProcess()-> + HasSwitch(ash::switches::kAshUseAlternateShelfLayout); } +#if defined(OS_CHROMEOS) bool UseUsbChargerNotification() { return !CommandLine::ForCurrentProcess()-> HasSwitch(ash::switches::kAshDisableUsbChargerNotification); |