| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_privat
e_api.h" | 5 #include "chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_privat
e_api.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/task_runner_util.h" | 9 #include "base/task_runner_util.h" |
| 10 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" | 10 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 void WebrtcAudioPrivateEventService::Shutdown() { | 44 void WebrtcAudioPrivateEventService::Shutdown() { |
| 45 // In unit tests, the SystemMonitor may not be created. | 45 // In unit tests, the SystemMonitor may not be created. |
| 46 base::SystemMonitor* system_monitor = base::SystemMonitor::Get(); | 46 base::SystemMonitor* system_monitor = base::SystemMonitor::Get(); |
| 47 if (system_monitor) | 47 if (system_monitor) |
| 48 system_monitor->RemoveDevicesChangedObserver(this); | 48 system_monitor->RemoveDevicesChangedObserver(this); |
| 49 } | 49 } |
| 50 | 50 |
| 51 // static | 51 // static |
| 52 ProfileKeyedAPIFactory<WebrtcAudioPrivateEventService>* | 52 ProfileKeyedAPIFactory<WebrtcAudioPrivateEventService>* |
| 53 WebrtcAudioPrivateEventService::GetFactoryInstance() { | 53 WebrtcAudioPrivateEventService::GetFactoryInstance() { |
| 54 return &g_factory.Get(); | 54 return g_factory.Pointer(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 // static | 57 // static |
| 58 const char* WebrtcAudioPrivateEventService::service_name() { | 58 const char* WebrtcAudioPrivateEventService::service_name() { |
| 59 return "WebrtcAudioPrivateEventService"; | 59 return "WebrtcAudioPrivateEventService"; |
| 60 } | 60 } |
| 61 | 61 |
| 62 void WebrtcAudioPrivateEventService::OnDevicesChanged( | 62 void WebrtcAudioPrivateEventService::OnDevicesChanged( |
| 63 base::SystemMonitor::DeviceType device_type) { | 63 base::SystemMonitor::DeviceType device_type) { |
| 64 switch (device_type) { | 64 switch (device_type) { |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 void WebrtcAudioPrivateGetAssociatedSinkFunction::OnGetAssociatedSinkDone( | 359 void WebrtcAudioPrivateGetAssociatedSinkFunction::OnGetAssociatedSinkDone( |
| 360 const std::string& associated_sink_id) { | 360 const std::string& associated_sink_id) { |
| 361 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 361 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 362 | 362 |
| 363 results_.reset( | 363 results_.reset( |
| 364 wap::GetAssociatedSink::Results::Create(associated_sink_id).release()); | 364 wap::GetAssociatedSink::Results::Create(associated_sink_id).release()); |
| 365 SendResponse(true); | 365 SendResponse(true); |
| 366 } | 366 } |
| 367 | 367 |
| 368 } // namespace extensions | 368 } // namespace extensions |
| OLD | NEW |