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

Unified Diff: chrome/browser/chromeos/audio/audio_handler.h

Issue 10873085: Implement two new policies to control muting the audio I/O. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to ToT. Created 8 years, 3 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/app/policy/policy_templates.json ('k') | chrome/browser/chromeos/audio/audio_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c54142d2be99f48098ce84a67afd2132df54d535 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 : public content::NotificationObserver {
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);
};
« no previous file with comments | « chrome/app/policy/policy_templates.json ('k') | chrome/browser/chromeos/audio/audio_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698