| 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 CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_ | 5 #ifndef CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_ |
| 6 #define CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_ | 6 #define CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "chromeos/audio/audio_devices_pref_handler.h" | 13 #include "chromeos/audio/audio_devices_pref_handler.h" |
| 14 | 14 |
| 15 namespace chromeos { | 15 namespace chromeos { |
| 16 | 16 |
| 17 // Stub class for AudioDevicesPrefHandler, used for testing. | 17 // Stub class for AudioDevicesPrefHandler, used for testing. |
| 18 class CHROMEOS_EXPORT AudioDevicesPrefHandlerStub | 18 class CHROMEOS_EXPORT AudioDevicesPrefHandlerStub |
| 19 : public AudioDevicesPrefHandler { | 19 : public AudioDevicesPrefHandler { |
| 20 public: | 20 public: |
| 21 using AudioDeviceMute = std::map<uint64_t, bool>; | 21 using AudioDeviceMute = std::map<uint64_t, bool>; |
| 22 using AudioDeviceVolumeGain = std::map<uint64_t, int>; | 22 using AudioDeviceVolumeGain = std::map<uint64_t, int>; |
| 23 using AudioDeviceLastState = std::map<uint64_t, AudioDeviceState>; |
| 23 | 24 |
| 24 AudioDevicesPrefHandlerStub(); | 25 AudioDevicesPrefHandlerStub(); |
| 25 | 26 |
| 26 // AudioDevicesPrefHandler: | 27 // AudioDevicesPrefHandler: |
| 27 double GetOutputVolumeValue(const AudioDevice* device) override; | 28 double GetOutputVolumeValue(const AudioDevice* device) override; |
| 28 double GetInputGainValue(const AudioDevice* device) override; | 29 double GetInputGainValue(const AudioDevice* device) override; |
| 29 void SetVolumeGainValue(const AudioDevice& device, double value) override; | 30 void SetVolumeGainValue(const AudioDevice& device, double value) override; |
| 30 bool GetMuteValue(const AudioDevice& device) override; | 31 bool GetMuteValue(const AudioDevice& device) override; |
| 31 void SetMuteValue(const AudioDevice& device, bool mute_on) override; | 32 void SetMuteValue(const AudioDevice& device, bool mute_on) override; |
| 33 AudioDeviceState GetDeviceState(const AudioDevice &device) override; |
| 34 void SetDeviceState(const AudioDevice& device, |
| 35 AudioDeviceState state) override; |
| 32 bool GetAudioOutputAllowedValue() override; | 36 bool GetAudioOutputAllowedValue() override; |
| 33 void AddAudioPrefObserver(AudioPrefObserver* observer) override; | 37 void AddAudioPrefObserver(AudioPrefObserver* observer) override; |
| 34 void RemoveAudioPrefObserver(AudioPrefObserver* observer) override; | 38 void RemoveAudioPrefObserver(AudioPrefObserver* observer) override; |
| 35 | 39 |
| 36 protected: | 40 protected: |
| 37 ~AudioDevicesPrefHandlerStub() override; | 41 ~AudioDevicesPrefHandlerStub() override; |
| 38 | 42 |
| 39 private: | 43 private: |
| 40 AudioDeviceMute audio_device_mute_map_; | 44 AudioDeviceMute audio_device_mute_map_; |
| 41 AudioDeviceVolumeGain audio_device_volume_gain_map_; | 45 AudioDeviceVolumeGain audio_device_volume_gain_map_; |
| 46 AudioDeviceLastState audio_device_state_map_; |
| 42 | 47 |
| 43 DISALLOW_COPY_AND_ASSIGN(AudioDevicesPrefHandlerStub); | 48 DISALLOW_COPY_AND_ASSIGN(AudioDevicesPrefHandlerStub); |
| 44 }; | 49 }; |
| 45 | 50 |
| 46 } // namespace chromeos | 51 } // namespace chromeos |
| 47 | 52 |
| 48 #endif // CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_ | 53 #endif // CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_ |
| OLD | NEW |