Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(869)

Side by Side Diff: chromeos/audio/audio_devices_pref_handler_stub.h

Issue 1380103003: Store audio device's active state in preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <map> 8 #include <map>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "chromeos/audio/audio_devices_pref_handler.h" 11 #include "chromeos/audio/audio_devices_pref_handler.h"
12 12
13 namespace chromeos { 13 namespace chromeos {
14 14
15 // Stub class for AudioDevicesPrefHandler, used for testing. 15 // Stub class for AudioDevicesPrefHandler, used for testing.
16 class CHROMEOS_EXPORT AudioDevicesPrefHandlerStub 16 class CHROMEOS_EXPORT AudioDevicesPrefHandlerStub
17 : public AudioDevicesPrefHandler { 17 : public AudioDevicesPrefHandler {
18 public: 18 public:
19 using AudioDeviceMute = std::map<uint64_t, bool>; 19 using AudioDeviceMute = std::map<uint64_t, bool>;
20 using AudioDeviceVolumeGain = std::map<uint64_t, int>; 20 using AudioDeviceVolumeGain = std::map<uint64_t, int>;
21 using AudioDeviceLastState = std::map<uint64_t, AudioDeviceState>;
21 22
22 AudioDevicesPrefHandlerStub(); 23 AudioDevicesPrefHandlerStub();
23 24
24 // AudioDevicesPrefHandler: 25 // AudioDevicesPrefHandler:
25 double GetOutputVolumeValue(const AudioDevice* device) override; 26 double GetOutputVolumeValue(const AudioDevice* device) override;
26 double GetInputGainValue(const AudioDevice* device) override; 27 double GetInputGainValue(const AudioDevice* device) override;
27 void SetVolumeGainValue(const AudioDevice& device, double value) override; 28 void SetVolumeGainValue(const AudioDevice& device, double value) override;
28 bool GetMuteValue(const AudioDevice& device) override; 29 bool GetMuteValue(const AudioDevice& device) override;
29 void SetMuteValue(const AudioDevice& device, bool mute_on) override; 30 void SetMuteValue(const AudioDevice& device, bool mute_on) override;
31 AudioDeviceState GetDeviceState(const AudioDevice &device) override;
32 void SetDeviceState(const AudioDevice& device,
33 AudioDeviceState state) override;
30 bool GetAudioOutputAllowedValue() override; 34 bool GetAudioOutputAllowedValue() override;
31 void AddAudioPrefObserver(AudioPrefObserver* observer) override; 35 void AddAudioPrefObserver(AudioPrefObserver* observer) override;
32 void RemoveAudioPrefObserver(AudioPrefObserver* observer) override; 36 void RemoveAudioPrefObserver(AudioPrefObserver* observer) override;
33 37
34 protected: 38 protected:
35 ~AudioDevicesPrefHandlerStub() override; 39 ~AudioDevicesPrefHandlerStub() override;
36 40
37 private: 41 private:
38 AudioDeviceMute audio_device_mute_map_; 42 AudioDeviceMute audio_device_mute_map_;
39 AudioDeviceVolumeGain audio_device_volume_gain_map_; 43 AudioDeviceVolumeGain audio_device_volume_gain_map_;
44 AudioDeviceLastState audio_device_state_map_;
40 45
41 DISALLOW_COPY_AND_ASSIGN(AudioDevicesPrefHandlerStub); 46 DISALLOW_COPY_AND_ASSIGN(AudioDevicesPrefHandlerStub);
42 }; 47 };
43 48
44 } // namespace chromeos 49 } // namespace chromeos
45 50
46 #endif // CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_ 51 #endif // CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698