Index: chrome/browser/chromeos/audio/audio_pref_handler_impl.h |
diff --git a/chrome/browser/chromeos/audio/audio_pref_handler_impl.h b/chrome/browser/chromeos/audio/audio_pref_handler_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..454180fe579de890d96c055bf4a15b7e3276e1c0 |
--- /dev/null |
+++ b/chrome/browser/chromeos/audio/audio_pref_handler_impl.h |
@@ -0,0 +1,57 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_PREF_HANDLER_IMPL_H_ |
+#define CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_PREF_HANDLER_IMPL_H_ |
+ |
+#include "base/observer_list.h" |
+#include "base/prefs/pref_change_registrar.h" |
+#include "chromeos/audio/audio_pref_handler.h" |
+ |
+class PrefRegistrySimple; |
+class PrefService; |
+ |
+namespace chromeos { |
+ |
+// Class which implements AudioPrefHandler interface and register audio |
Daniel Erat
2013/04/18 20:55:22
nit: s/register/registers/
saying "which implemen
|
+// preferences as well. |
+class AudioPrefHandlerImpl : public AudioPrefHandler { |
+ public: |
+ explicit AudioPrefHandlerImpl(PrefService* local_state); |
+ |
+ // Overriden from AudioPreHandler. |
+ virtual double GetOutputVolumeValue() OVERRIDE; |
+ virtual void SetOutputVolumeValue(double volume_percent) OVERRIDE; |
+ virtual bool GetOutputMuteValue() OVERRIDE; |
+ virtual void SetOutputMuteValue(bool mute_on) OVERRIDE; |
+ virtual bool GetAudioCaptureAllowedValue() OVERRIDE; |
+ virtual bool GetAudioOutputAllowedValue() OVERRIDE; |
+ virtual void AddAudioPrefObserver(AudioPrefObserver* observer) OVERRIDE; |
+ virtual void RemoveAudioPrefObserver(AudioPrefObserver* observer) OVERRIDE; |
+ |
+ // Registers volume and mute preferences. |
+ static void RegisterPrefs(PrefRegistrySimple* registry); |
+ |
+ protected: |
+ virtual ~AudioPrefHandlerImpl(); |
+ |
+ private: |
+ // Initializes the observers for the policy prefs. |
+ void InitializePrefObservers(); |
+ |
+ // Notifies the AudioPrefObserver for audio policy pref changes. |
+ void NotifyAudioPolicyChange(); |
+ |
+ PrefService* local_state_; // not owned |
+ |
+ PrefChangeRegistrar pref_change_registrar_; |
+ |
+ ObserverList<AudioPrefObserver> observers_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(AudioPrefHandlerImpl); |
+}; |
+ |
+} // namespace chromeos |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_PREF_HANDLER_IMPL_H_ |