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

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

Issue 9169033: Support for showing/hiding status area volume controls in desktop devices (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: lint errors 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
Index: chrome/browser/chromeos/system_key_event_listener.h
===================================================================
--- chrome/browser/chromeos/system_key_event_listener.h (revision 118753)
+++ chrome/browser/chromeos/system_key_event_listener.h (working copy)
@@ -28,7 +28,17 @@
class CapsLockObserver {
public:
virtual void OnCapsLockChange(bool enabled) = 0;
+ protected:
+ virtual ~CapsLockObserver() {}
};
+
+ class StatusAreaVolumeObserver {
+ public:
+ virtual void ShowStatusAreaVolume(bool show) = 0;
+ protected:
+ virtual ~StatusAreaVolumeObserver() {}
+ };
+
static void Initialize();
static void Shutdown();
// GetInstance returns NULL if not initialized or if already shutdown.
@@ -39,6 +49,9 @@
void AddCapsLockObserver(CapsLockObserver* observer);
void RemoveCapsLockObserver(CapsLockObserver* observer);
+ void AddStatusAreaVolumeObserver(StatusAreaVolumeObserver* observer);
+ void RemoveStatusAreaVolumeObserver(StatusAreaVolumeObserver* observer);
+
private:
// Defines the delete on exit Singleton traits we like. Best to have this
// and const/dest private as recommended for Singletons.
@@ -78,6 +91,7 @@
void OnVolumeDown();
void OnVolumeUp();
void OnCapsLock(bool enabled);
+ void ShowStatusAreaVolume(bool show);
// Displays the volume bubble for the current volume and muting status.
// Also hides the brightness bubble if it's being shown.
@@ -99,10 +113,14 @@
bool stopped_;
+ bool show_status_area_volume_;
xiyuan 2012/01/25 04:43:12 Add a comment that this controls whether or not to
achuithb 2012/01/25 10:46:06 Done.
+
const unsigned int num_lock_mask_;
bool num_lock_is_on_;
bool caps_lock_is_on_;
+
ObserverList<CapsLockObserver> caps_lock_observers_;
+ ObserverList<StatusAreaVolumeObserver> status_area_volume_observers_;
// Base X ID for events from the XKB extension.
int xkb_event_base_;

Powered by Google App Engine
This is Rietveld 408576698