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

Unified Diff: chrome/browser/chromeos/system/ash_system_tray_delegate.cc

Issue 14678004: cros: Enable new cras audio handler by default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: chrome/browser/chromeos/system/ash_system_tray_delegate.cc
diff --git a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
index 5bd64e8ad6034f62ee6e02f2929810082c6698de..6e44a1fbd869c41b6a9b023fc09c1cd3028c0f9c 100644
--- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
+++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
@@ -118,6 +118,11 @@ const int kSessionLengthLimitMinMs = 30 * 1000; // 30 seconds.
// The maximum session length limit that can be set.
const int kSessionLengthLimitMaxMs = 24 * 60 * 60 * 1000; // 24 hours.
+bool UseNewAudioHandler() {
+ return !CommandLine::ForCurrentProcess()->
+ HasSwitch(ash::switches::kAshDisableNewAudioHandler);
+}
+
ash::NetworkIconInfo CreateNetworkIconInfo(const Network* network) {
ash::NetworkIconInfo info;
info.name = network->type() == TYPE_ETHERNET ?
@@ -300,8 +305,7 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
}
virtual void Initialize() OVERRIDE {
- if (!CommandLine::ForCurrentProcess()->
- HasSwitch(ash::switches::kAshEnableNewAudioHandler)) {
+ if (!UseNewAudioHandler()) {
AudioHandler::GetInstance()->AddVolumeObserver(this);
}
DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this);
@@ -364,9 +368,7 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
}
virtual ~SystemTrayDelegate() {
- if (!CommandLine::ForCurrentProcess()->
- HasSwitch(ash::switches::kAshEnableNewAudioHandler) &&
- AudioHandler::GetInstance()) {
+ if (!UseNewAudioHandler() && AudioHandler::GetInstance()) {
AudioHandler::GetInstance()->RemoveVolumeObserver(this);
}

Powered by Google App Engine
This is Rietveld 408576698