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

Side by Side Diff: extensions/browser/api/audio/audio_service.cc

Issue 2605983002: Simplify logic behind chrome.audio.setActiveDevices (Closed)
Patch Set: . Created 3 years, 11 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 #include "extensions/browser/api/audio/audio_service.h" 5 #include "extensions/browser/api/audio/audio_service.h"
6 6
7 namespace extensions { 7 namespace extensions {
8 8
9 class AudioServiceImpl : public AudioService { 9 class AudioServiceImpl : public AudioService {
10 public: 10 public:
11 AudioServiceImpl() {} 11 AudioServiceImpl() {}
12 ~AudioServiceImpl() override {} 12 ~AudioServiceImpl() override {}
13 13
14 // Called by listeners to this service to add/remove themselves as observers. 14 // Called by listeners to this service to add/remove themselves as observers.
15 void AddObserver(Observer* observer) override; 15 void AddObserver(Observer* observer) override;
16 void RemoveObserver(Observer* observer) override; 16 void RemoveObserver(Observer* observer) override;
17 17
18 // Start to query audio device information. 18 // Start to query audio device information.
19 bool GetInfo(OutputInfo* output_info_out, InputInfo* input_info_out) override; 19 bool GetInfo(OutputInfo* output_info_out, InputInfo* input_info_out) override;
20 void SetActiveDevices(const DeviceIdList& device_list) override; 20 void SetActiveDevices(const DeviceIdList& device_list) override;
21 bool SetActiveDeviceLists(
22 const std::unique_ptr<DeviceIdList>& input_devices,
23 const std::unique_ptr<DeviceIdList>& output_devives) override;
21 bool SetDeviceProperties(const std::string& device_id, 24 bool SetDeviceProperties(const std::string& device_id,
22 bool muted, 25 bool muted,
23 int volume, 26 int volume,
24 int gain) override; 27 int gain) override;
25 }; 28 };
26 29
27 void AudioServiceImpl::AddObserver(Observer* observer) { 30 void AudioServiceImpl::AddObserver(Observer* observer) {
28 // TODO: implement this for platforms other than Chrome OS. 31 // TODO: implement this for platforms other than Chrome OS.
29 } 32 }
30 33
31 void AudioServiceImpl::RemoveObserver(Observer* observer) { 34 void AudioServiceImpl::RemoveObserver(Observer* observer) {
32 // TODO: implement this for platforms other than Chrome OS. 35 // TODO: implement this for platforms other than Chrome OS.
33 } 36 }
34 37
35 AudioService* AudioService::CreateInstance() { 38 AudioService* AudioService::CreateInstance() {
36 return new AudioServiceImpl; 39 return new AudioServiceImpl;
37 } 40 }
38 41
39 bool AudioServiceImpl::GetInfo(OutputInfo* output_info_out, 42 bool AudioServiceImpl::GetInfo(OutputInfo* output_info_out,
40 InputInfo* input_info_out) { 43 InputInfo* input_info_out) {
41 // TODO: implement this for platforms other than Chrome OS. 44 // TODO: implement this for platforms other than Chrome OS.
42 return false; 45 return false;
43 } 46 }
44 47
48 bool AudioServiceImpl::SetActiveDeviceLists(
49 const std::unique_ptr<DeviceIdList>& input_devices,
50 const std::unique_ptr<DeviceIdList>& output_devives) {
51 return false;
52 }
53
45 void AudioServiceImpl::SetActiveDevices(const DeviceIdList& device_list) { 54 void AudioServiceImpl::SetActiveDevices(const DeviceIdList& device_list) {
46 } 55 }
47 56
48 bool AudioServiceImpl::SetDeviceProperties(const std::string& device_id, 57 bool AudioServiceImpl::SetDeviceProperties(const std::string& device_id,
49 bool muted, 58 bool muted,
50 int volume, 59 int volume,
51 int gain) { 60 int gain) {
52 return false; 61 return false;
53 } 62 }
54 63
55 } // namespace extensions 64 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/audio/audio_service.h ('k') | extensions/browser/api/audio/audio_service_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698