Chromium Code Reviews| Index: chrome/browser/chromeos/audio/audio_handler.h |
| diff --git a/chrome/browser/chromeos/audio/audio_handler.h b/chrome/browser/chromeos/audio/audio_handler.h |
| index a66ea4d104e39385ebd036003cee3e60811c36f5..cc327c0175c711eb97f16e45894056e30bd9e248 100644 |
| --- a/chrome/browser/chromeos/audio/audio_handler.h |
| +++ b/chrome/browser/chromeos/audio/audio_handler.h |
| @@ -9,16 +9,22 @@ |
| #include "base/observer_list.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/threading/thread.h" |
| +#include "chrome/browser/api/prefs/pref_change_registrar.h" |
| +#include "content/public/browser/notification_details.h" |
| +#include "content/public/browser/notification_observer.h" |
| +#include "content/public/browser/notification_registrar.h" |
| +#include "content/public/browser/notification_source.h" |
| template <typename T> struct DefaultSingletonTraits; |
| +class PrefChangeRegistrar; |
| class PrefService; |
| namespace chromeos { |
| class AudioMixer; |
| -class AudioHandler { |
| +class AudioHandler : content::NotificationObserver { |
|
Mattias Nissler (ping if slow)
2012/08/31 08:06:51
public
pastarmovj
2012/09/03 09:53:56
Done.
|
| public: |
| class VolumeObserver { |
| public: |
| @@ -58,9 +64,20 @@ class AudioHandler { |
| // Mutes or unmutes all audio. |
| void SetMuted(bool do_mute); |
| + // Is the capture volume currently muted? |
| + bool IsCaptureMuted(); |
| + |
| + // Mutes or unmutes all capture devices. |
| + void SetCaptureMuted(bool do_mute); |
| + |
| void AddVolumeObserver(VolumeObserver* observer); |
| void RemoveVolumeObserver(VolumeObserver* observer); |
| + // Overridden from content::NotificationObserver: |
| + virtual void Observe(int type, |
| + const content::NotificationSource& source, |
| + const content::NotificationDetails& details) OVERRIDE; |
| + |
| private: |
| // Defines the delete on exit Singleton traits we like. Best to have this |
| // and constructor/destructor private as recommended for Singletons. |
| @@ -70,11 +87,21 @@ class AudioHandler { |
| explicit AudioHandler(AudioMixer* mixer); |
| virtual ~AudioHandler(); |
| + // Initializes the observers for the policy prefs. |
| + void InitializePrefObservers(); |
| + |
| + // Applies the audio muting policies whenever the user logs in or policy |
| + // change notification is received. |
| + void ApplyAudioPolicy(); |
| + |
| scoped_ptr<AudioMixer> mixer_; |
| ObserverList<VolumeObserver> volume_observers_; |
| - PrefService* prefs_; // not owned |
| + PrefService* local_state_; // not owned |
| + |
| + PrefChangeRegistrar pref_change_registrar_; |
| + content::NotificationRegistrar registrar_; |
| DISALLOW_COPY_AND_ASSIGN(AudioHandler); |
| }; |