- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / api / audio / audio_service.cc
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 #include "chrome/browser/extensions/api/audio/audio_service.h"
6
7 namespace extensions {
8
9 class AudioServiceImpl : public AudioService {
10  public:
11   AudioServiceImpl() {}
12   virtual ~AudioServiceImpl() {}
13
14   // Called by listeners to this service to add/remove themselves as observers.
15   virtual void AddObserver(Observer* observer) OVERRIDE;
16   virtual void RemoveObserver(Observer* observer) OVERRIDE;
17
18   // Start to query audio device information.
19   virtual void StartGetInfo(const GetInfoCallback& callback) OVERRIDE;
20   virtual void SetActiveDevices(const DeviceIdList& device_list) OVERRIDE;
21   virtual bool SetDeviceProperties(const std::string& device_id,
22                                    bool muted,
23                                    int volume,
24                                    int gain) OVERRIDE;
25 };
26
27 void AudioServiceImpl::AddObserver(Observer* observer) {
28   // TODO: implement this for platforms other than Chrome OS.
29 }
30
31 void AudioServiceImpl::RemoveObserver(Observer* observer) {
32   // TODO: implement this for platforms other than Chrome OS.
33 }
34
35 AudioService* AudioService::CreateInstance() {
36   return new AudioServiceImpl;
37 }
38
39 void AudioServiceImpl::StartGetInfo(const GetInfoCallback& callback) {
40   // TODO: implement this for platforms other than Chrome OS.
41   if (!callback.is_null())
42     callback.Run(OutputInfo(), InputInfo(), false);
43 }
44
45 void AudioServiceImpl::SetActiveDevices(const DeviceIdList& device_list) {
46 }
47
48 bool AudioServiceImpl::SetDeviceProperties(const std::string& device_id,
49                                            bool muted,
50                                            int volume,
51                                            int gain) {
52   return false;
53 }
54
55 }  // namespace extensions