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

Unified Diff: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc

Issue 163953007: Refactor the TrayAudio code so that it can be used by other platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/ui/ash/system_tray_delegate_chromeos.cc
diff --git a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
index 202ca5b41ad063146e27fd46bfa3535c585138c1..c50ebdbf67d229dd6398d751b25396d696d35a04 100644
--- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
@@ -89,6 +89,7 @@
#include "chrome/browser/upgrade_detector.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
+#include "chromeos/audio/cras_audio_handler.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/session_manager_client.h"
@@ -292,6 +293,8 @@ SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS()
this,
chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_VIRTUAL_KEYBOARD,
content::NotificationService::AllSources());
+
+ CrasAudioHandler::Get()->AddAudioObserver(this);
}
void SystemTrayDelegateChromeOS::Initialize() {
@@ -369,6 +372,8 @@ SystemTrayDelegateChromeOS::~SystemTrayDelegateChromeOS() {
// Stop observing Drive operations.
UnobserveDriveUpdates();
+ CrasAudioHandler::Get()->RemoveAudioObserver(this);
+
policy::BrowserPolicyConnectorChromeOS* connector =
g_browser_process->platform_part()->browser_policy_connector_chromeos();
policy::DeviceCloudPolicyManagerChromeOS* policy_manager =
@@ -1202,6 +1207,33 @@ void SystemTrayDelegateChromeOS::InputMethodPropertyChanged(
GetSystemTrayNotifier()->NotifyRefreshIME(false);
}
+// Overridden from CrasAudioHandler::AudioObserver.
+void SystemTrayDelegateChromeOS::OnOutputVolumeChanged() {
+ GetSystemTrayNotifier()->NotifyAudioOutputVolumeChanged();
+}
+
+void SystemTrayDelegateChromeOS::OnOutputMuteChanged() {
+ GetSystemTrayNotifier()->NotifyAudioOutputMuteChanged();
+}
+
+void SystemTrayDelegateChromeOS::OnInputGainChanged() {
+}
+
+void SystemTrayDelegateChromeOS::OnInputMuteChanged() {
+}
+
+void SystemTrayDelegateChromeOS::OnAudioNodesChanged() {
+ GetSystemTrayNotifier()->NotifyAudioNodesChanged();
+}
+
+void SystemTrayDelegateChromeOS::OnActiveOutputNodeChanged() {
+ GetSystemTrayNotifier()->NotifyAudioActiveOutputNodeChanged();
+}
+
+void SystemTrayDelegateChromeOS::OnActiveInputNodeChanged() {
+ GetSystemTrayNotifier()->NotifyAudioActiveInputNodeChanged();
+}
+
// drive::JobListObserver overrides.
void SystemTrayDelegateChromeOS::OnJobAdded(const drive::JobInfo& job_info) {
OnJobUpdated(job_info);

Powered by Google App Engine
This is Rietveld 408576698