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 which implements AudioPrefHandler interface and register audio | |
Daniel Erat
2013/04/18 20:55:22
nit: s/register/registers/
saying "which implemen
| |
18 // preferences as well. | |
19 class AudioPrefHandlerImpl : public AudioPrefHandler { | |
20 public: | |
21 explicit AudioPrefHandlerImpl(PrefService* local_state); | |
22 | |
23 // Overriden from AudioPreHandler. | |
24 virtual double GetOutputVolumeValue() OVERRIDE; | |
25 virtual void SetOutputVolumeValue(double volume_percent) OVERRIDE; | |
26 virtual bool GetOutputMuteValue() OVERRIDE; | |
27 virtual void SetOutputMuteValue(bool mute_on) OVERRIDE; | |
28 virtual bool GetAudioCaptureAllowedValue() OVERRIDE; | |
29 virtual bool GetAudioOutputAllowedValue() OVERRIDE; | |
30 virtual void AddAudioPrefObserver(AudioPrefObserver* observer) OVERRIDE; | |
31 virtual void RemoveAudioPrefObserver(AudioPrefObserver* observer) OVERRIDE; | |
32 | |
33 // Registers volume and mute preferences. | |
34 static void RegisterPrefs(PrefRegistrySimple* registry); | |
35 | |
36 protected: | |
37 virtual ~AudioPrefHandlerImpl(); | |
38 | |
39 private: | |
40 // Initializes the observers for the policy prefs. | |
41 void InitializePrefObservers(); | |
42 | |
43 // Notifies the AudioPrefObserver for audio policy pref changes. | |
44 void NotifyAudioPolicyChange(); | |
45 | |
46 PrefService* local_state_; // not owned | |
47 | |
48 PrefChangeRegistrar pref_change_registrar_; | |
49 | |
50 ObserverList<AudioPrefObserver> observers_; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(AudioPrefHandlerImpl); | |
53 }; | |
54 | |
55 } // namespace chromeos | |
56 | |
57 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_PREF_HANDLER_IMPL_H_ | |
OLD | NEW |