OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_PREF_HANDLER_IMPL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_PREF_HANDLER_IMPL_H_ |
| 7 |
| 8 #include "base/observer_list.h" |
| 9 #include "base/prefs/pref_change_registrar.h" |
| 10 #include "chromeos/audio/audio_pref_handler.h" |
| 11 |
| 12 class PrefRegistrySimple; |
| 13 class PrefService; |
| 14 |
| 15 namespace chromeos { |
| 16 |
| 17 class AudioPrefHandlerImpl : public AudioPrefHandler { |
| 18 public: |
| 19 explicit AudioPrefHandlerImpl(PrefService* local_state); |
| 20 |
| 21 // Overriden from AudioPreHandler. |
| 22 virtual double GetOutputVolumeValue() OVERRIDE; |
| 23 virtual void SetOutputVolumeValue(double volume_percent) OVERRIDE; |
| 24 virtual bool GetOutputMuteValue() OVERRIDE; |
| 25 virtual void SetOutputMuteValue(bool mute_on) OVERRIDE; |
| 26 virtual bool GetAudioCaptureAllowedValue() OVERRIDE; |
| 27 virtual bool GetAudioOutputAllowedValue() OVERRIDE; |
| 28 virtual void AddAudioPrefObserver(AudioPrefObserver* observer) OVERRIDE; |
| 29 virtual void RemoveAudioPrefObserver(AudioPrefObserver* observer) OVERRIDE; |
| 30 |
| 31 protected: |
| 32 virtual ~AudioPrefHandlerImpl(); |
| 33 |
| 34 private: |
| 35 // Initializes the observers for the policy prefs. |
| 36 void InitializePrefObservers(); |
| 37 |
| 38 // Notifies the AudioPrefObserver for audio policy pref changes. |
| 39 void NotifyAudioPolicyChange(); |
| 40 |
| 41 PrefService* local_state_; // not owned |
| 42 |
| 43 PrefChangeRegistrar pref_change_registrar_; |
| 44 |
| 45 ObserverList<AudioPrefObserver> observers_; |
| 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(AudioPrefHandlerImpl); |
| 48 }; |
| 49 |
| 50 } // namespace chromeos |
| 51 |
| 52 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_PREF_HANDLER_IMPL_H_ |
OLD | NEW |