| 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 #include "extensions/browser/api/audio/audio_service.h" | 5 #include "extensions/browser/api/audio/audio_service.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "chromeos/audio/audio_device.h" | 10 #include "chromeos/audio/audio_device.h" |
| 11 #include "chromeos/audio/cras_audio_handler.h" | 11 #include "chromeos/audio/cras_audio_handler.h" |
| 12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 13 | 13 |
| 14 using content::BrowserThread; | 14 using content::BrowserThread; |
| 15 | 15 |
| 16 namespace extensions { | 16 namespace extensions { |
| 17 | 17 |
| 18 using core_api::audio::OutputDeviceInfo; | 18 using api::audio::OutputDeviceInfo; |
| 19 using core_api::audio::InputDeviceInfo; | 19 using api::audio::InputDeviceInfo; |
| 20 using core_api::audio::AudioDeviceInfo; | 20 using api::audio::AudioDeviceInfo; |
| 21 | 21 |
| 22 class AudioServiceImpl : public AudioService, | 22 class AudioServiceImpl : public AudioService, |
| 23 public chromeos::CrasAudioHandler::AudioObserver { | 23 public chromeos::CrasAudioHandler::AudioObserver { |
| 24 public: | 24 public: |
| 25 AudioServiceImpl(); | 25 AudioServiceImpl(); |
| 26 ~AudioServiceImpl() override; | 26 ~AudioServiceImpl() override; |
| 27 | 27 |
| 28 // Called by listeners to this service to add/remove themselves as observers. | 28 // Called by listeners to this service to add/remove themselves as observers. |
| 29 void AddObserver(AudioService::Observer* observer) override; | 29 void AddObserver(AudioService::Observer* observer) override; |
| 30 void RemoveObserver(AudioService::Observer* observer) override; | 30 void RemoveObserver(AudioService::Observer* observer) override; |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 // Notify DeviceChanged event for backward compatibility. | 281 // Notify DeviceChanged event for backward compatibility. |
| 282 // TODO(jennyz): remove this code when the old version of hotrod retires. | 282 // TODO(jennyz): remove this code when the old version of hotrod retires. |
| 283 NotifyDeviceChanged(); | 283 NotifyDeviceChanged(); |
| 284 } | 284 } |
| 285 | 285 |
| 286 AudioService* AudioService::CreateInstance() { | 286 AudioService* AudioService::CreateInstance() { |
| 287 return new AudioServiceImpl; | 287 return new AudioServiceImpl; |
| 288 } | 288 } |
| 289 | 289 |
| 290 } // namespace extensions | 290 } // namespace extensions |
| OLD | NEW |