Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1784)

Unified Diff: ash/system/chromeos/audio/tray_audio.cc

Issue 14678004: cros: Enable new cras audio handler by default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang fix. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/ash_switches.cc ('k') | ash/test/ash_test_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/audio/tray_audio.cc
diff --git a/ash/system/chromeos/audio/tray_audio.cc b/ash/system/chromeos/audio/tray_audio.cc
index ea0cb94aa711ddbd7b4c980f9aadace94b68f616..246b082f54b1940226e192a2235cd7c0b3ff8c24 100644
--- a/ash/system/chromeos/audio/tray_audio.cc
+++ b/ash/system/chromeos/audio/tray_audio.cc
@@ -57,8 +57,15 @@ const int kNoAudioDeviceIcon = -1;
const int kVolumeLevels = 4;
bool UseNewAudioHandler() {
- return CommandLine::ForCurrentProcess()->
- HasSwitch(ash::switches::kAshEnableNewAudioHandler);
+ return !CommandLine::ForCurrentProcess()->
+ HasSwitch(ash::switches::kAshDisableNewAudioHandler);
+}
+
+// Returns true if we should show the audio device switching UI.
+bool ShowAudioDeviceMenu() {
+ return UseNewAudioHandler() &&
+ CommandLine::ForCurrentProcess()->
+ HasSwitch(ash::switches::kAshEnableAudioDeviceMenu);
}
bool IsAudioMuted() {
@@ -241,7 +248,7 @@ class VolumeView : public ActionableView,
private:
// Updates bar_, device_type_ icon, and more_ buttons.
void UpdateDeviceTypeAndMore() {
- if (!UseNewAudioHandler() || !is_default_view_) {
+ if (!ShowAudioDeviceMenu() || !is_default_view_) {
more_->SetVisible(false);
bar_->SetVisible(false);
device_type_->SetVisible(false);
@@ -504,7 +511,7 @@ views::View* TrayAudio::CreateDefaultView(user::LoginStatus status) {
}
views::View* TrayAudio::CreateDetailedView(user::LoginStatus status) {
- if (!UseNewAudioHandler() || pop_up_volume_view_) {
+ if (!ShowAudioDeviceMenu() || pop_up_volume_view_) {
volume_view_ = new tray::VolumeView(this, false);
return volume_view_;
} else {
« no previous file with comments | « ash/ash_switches.cc ('k') | ash/test/ash_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698