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

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: Fix memory leak by using scoped_ptr in TrayAudio 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
« no previous file with comments | « chrome/browser/ui/ash/system_tray_delegate_chromeos.h ('k') | chromeos/audio/cras_audio_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d28de2cdea5c14b194adb08ad9ce6b4d6c2ed509..1b5784d8cc775308b82b53d47a0c3d4a87eb2bd0 100644
--- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
@@ -311,6 +311,9 @@ void SystemTrayDelegateChromeOS::Initialize() {
if (LoginState::IsInitialized())
LoginState::Get()->AddObserver(this);
+
+ if (CrasAudioHandler::IsInitialized())
+ CrasAudioHandler::Get()->AddAudioObserver(this);
}
void SystemTrayDelegateChromeOS::Shutdown() {
@@ -365,7 +368,10 @@ SystemTrayDelegateChromeOS::~SystemTrayDelegateChromeOS() {
->RemoveSessionStateObserver(this);
LoginState::Get()->RemoveObserver(this);
- // Stop observing Drive operations.
+ if (CrasAudioHandler::IsInitialized())
+ CrasAudioHandler::Get()->RemoveAudioObserver(this);
+
+// Stop observing Drive operations.
UnobserveDriveUpdates();
policy::BrowserPolicyConnectorChromeOS* connector =
@@ -1206,6 +1212,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);
« no previous file with comments | « chrome/browser/ui/ash/system_tray_delegate_chromeos.h ('k') | chromeos/audio/cras_audio_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698