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

Unified Diff: chrome/browser/chromeos/system_key_event_listener.cc

Issue 9310018: Revert 119948 - Support for showing/hiding status area volume controls in desktop devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 11 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/chromeos/system_key_event_listener.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/system_key_event_listener.cc
===================================================================
--- chrome/browser/chromeos/system_key_event_listener.cc (revision 120018)
+++ chrome/browser/chromeos/system_key_event_listener.cc (working copy)
@@ -152,6 +152,13 @@
stopped_ = true;
}
+AudioHandler* SystemKeyEventListener::GetAudioHandler() const {
+ AudioHandler* audio_handler = AudioHandler::GetInstance();
+ if (!audio_handler || !audio_handler->IsInitialized())
+ return NULL;
+ return audio_handler;
+}
+
void SystemKeyEventListener::AddCapsLockObserver(CapsLockObserver* observer) {
caps_lock_observers_.AddObserver(observer);
}
@@ -206,7 +213,7 @@
}
void SystemKeyEventListener::OnVolumeMute() {
- AudioHandler* audio_handler = AudioHandler::GetInstanceIfInitialized();
+ AudioHandler* audio_handler = GetAudioHandler();
if (!audio_handler)
return;
@@ -220,7 +227,7 @@
}
void SystemKeyEventListener::OnVolumeDown() {
- AudioHandler* audio_handler = AudioHandler::GetInstanceIfInitialized();
+ AudioHandler* audio_handler = GetAudioHandler();
if (!audio_handler)
return;
@@ -235,7 +242,7 @@
}
void SystemKeyEventListener::OnVolumeUp() {
- AudioHandler* audio_handler = AudioHandler::GetInstanceIfInitialized();
+ AudioHandler* audio_handler = GetAudioHandler();
if (!audio_handler)
return;
@@ -253,13 +260,12 @@
}
void SystemKeyEventListener::OnCapsLock(bool enabled) {
- FOR_EACH_OBSERVER(CapsLockObserver,
- caps_lock_observers_,
- OnCapsLockChange(enabled));
+ FOR_EACH_OBSERVER(
+ CapsLockObserver, caps_lock_observers_, OnCapsLockChange(enabled));
}
void SystemKeyEventListener::ShowVolumeBubble() {
- AudioHandler* audio_handler = AudioHandler::GetInstanceIfInitialized();
+ AudioHandler* audio_handler = GetAudioHandler();
if (audio_handler) {
VolumeBubble::GetInstance()->ShowBubble(
audio_handler->GetVolumePercent(),
« no previous file with comments | « chrome/browser/chromeos/system_key_event_listener.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698