| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_IMPL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_IMPL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
| 9 #include "base/prefs/pref_change_registrar.h" | 9 #include "base/prefs/pref_change_registrar.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 #include "chromeos/audio/audio_devices_pref_handler.h" | 11 #include "chromeos/audio/audio_devices_pref_handler.h" |
| 12 | 12 |
| 13 class PrefRegistrySimple; | 13 class PrefRegistrySimple; |
| 14 class PrefService; | 14 class PrefService; |
| 15 | 15 |
| 16 namespace chromeos { | 16 namespace chromeos { |
| 17 | 17 |
| 18 // Class which implements AudioDevicesPrefHandler interface and register audio | 18 // Class which implements AudioDevicesPrefHandler interface and register audio |
| 19 // preferences as well. | 19 // preferences as well. |
| 20 class AudioDevicesPrefHandlerImpl : public AudioDevicesPrefHandler { | 20 class AudioDevicesPrefHandlerImpl : public AudioDevicesPrefHandler { |
| 21 public: | 21 public: |
| 22 explicit AudioDevicesPrefHandlerImpl(PrefService* local_state); | 22 explicit AudioDevicesPrefHandlerImpl(PrefService* local_state); |
| 23 | 23 |
| 24 // Overridden from AudioDevicesPrefHandler. | 24 // Overridden from AudioDevicesPrefHandler. |
| 25 virtual double GetOutputVolumeValue(const AudioDevice* device) OVERRIDE; | 25 virtual double GetOutputVolumeValue(const AudioDevice* device) override; |
| 26 virtual double GetInputGainValue(const AudioDevice* device) OVERRIDE; | 26 virtual double GetInputGainValue(const AudioDevice* device) override; |
| 27 virtual void SetVolumeGainValue(const AudioDevice& device, | 27 virtual void SetVolumeGainValue(const AudioDevice& device, |
| 28 double value) OVERRIDE; | 28 double value) override; |
| 29 | 29 |
| 30 virtual bool GetMuteValue(const AudioDevice& device) OVERRIDE; | 30 virtual bool GetMuteValue(const AudioDevice& device) override; |
| 31 virtual void SetMuteValue(const AudioDevice& device, bool mute_on) OVERRIDE; | 31 virtual void SetMuteValue(const AudioDevice& device, bool mute_on) override; |
| 32 | 32 |
| 33 virtual bool GetAudioCaptureAllowedValue() OVERRIDE; | 33 virtual bool GetAudioCaptureAllowedValue() override; |
| 34 virtual bool GetAudioOutputAllowedValue() OVERRIDE; | 34 virtual bool GetAudioOutputAllowedValue() override; |
| 35 | 35 |
| 36 virtual void AddAudioPrefObserver(AudioPrefObserver* observer) OVERRIDE; | 36 virtual void AddAudioPrefObserver(AudioPrefObserver* observer) override; |
| 37 virtual void RemoveAudioPrefObserver(AudioPrefObserver* observer) OVERRIDE; | 37 virtual void RemoveAudioPrefObserver(AudioPrefObserver* observer) override; |
| 38 | 38 |
| 39 // Registers volume and mute preferences. | 39 // Registers volume and mute preferences. |
| 40 static void RegisterPrefs(PrefRegistrySimple* registry); | 40 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 41 | 41 |
| 42 protected: | 42 protected: |
| 43 virtual ~AudioDevicesPrefHandlerImpl(); | 43 virtual ~AudioDevicesPrefHandlerImpl(); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 // Initializes the observers for the policy prefs. | 46 // Initializes the observers for the policy prefs. |
| 47 void InitializePrefObservers(); | 47 void InitializePrefObservers(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 73 PrefService* local_state_; // not owned | 73 PrefService* local_state_; // not owned |
| 74 PrefChangeRegistrar pref_change_registrar_; | 74 PrefChangeRegistrar pref_change_registrar_; |
| 75 ObserverList<AudioPrefObserver> observers_; | 75 ObserverList<AudioPrefObserver> observers_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(AudioDevicesPrefHandlerImpl); | 77 DISALLOW_COPY_AND_ASSIGN(AudioDevicesPrefHandlerImpl); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace chromeos | 80 } // namespace chromeos |
| 81 | 81 |
| 82 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_IMPL_H_ | 82 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_IMPL_H_ |
| OLD | NEW |