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 <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 using content::BrowserThread; | 30 using content::BrowserThread; |
31 using content::RenderProcessHost; | 31 using content::RenderProcessHost; |
32 using media::AudioDeviceDescriptions; | 32 using media::AudioDeviceDescriptions; |
33 using media::AudioManager; | 33 using media::AudioManager; |
34 | 34 |
35 namespace wap = api::webrtc_audio_private; | 35 namespace wap = api::webrtc_audio_private; |
36 | 36 |
37 using api::webrtc_audio_private::RequestInfo; | 37 using api::webrtc_audio_private::RequestInfo; |
38 | 38 |
39 static base::LazyInstance< | 39 static base::LazyInstance<BrowserContextKeyedAPIFactory< |
40 BrowserContextKeyedAPIFactory<WebrtcAudioPrivateEventService> > g_factory = | 40 WebrtcAudioPrivateEventService>>::DestructorAtExit g_factory = |
41 LAZY_INSTANCE_INITIALIZER; | 41 LAZY_INSTANCE_INITIALIZER; |
42 | 42 |
43 WebrtcAudioPrivateEventService::WebrtcAudioPrivateEventService( | 43 WebrtcAudioPrivateEventService::WebrtcAudioPrivateEventService( |
44 content::BrowserContext* context) | 44 content::BrowserContext* context) |
45 : browser_context_(context) { | 45 : browser_context_(context) { |
46 // In unit tests, the SystemMonitor may not be created. | 46 // In unit tests, the SystemMonitor may not be created. |
47 base::SystemMonitor* system_monitor = base::SystemMonitor::Get(); | 47 base::SystemMonitor* system_monitor = base::SystemMonitor::Get(); |
48 if (system_monitor) | 48 if (system_monitor) |
49 system_monitor->AddDevicesChangedObserver(this); | 49 system_monitor->AddDevicesChangedObserver(this); |
50 } | 50 } |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 DVLOG(2) << "Got default ID, replacing with empty ID."; | 498 DVLOG(2) << "Got default ID, replacing with empty ID."; |
499 results_ = wap::GetAssociatedSink::Results::Create(""); | 499 results_ = wap::GetAssociatedSink::Results::Create(""); |
500 } else { | 500 } else { |
501 results_ = wap::GetAssociatedSink::Results::Create(associated_sink_id); | 501 results_ = wap::GetAssociatedSink::Results::Create(associated_sink_id); |
502 } | 502 } |
503 | 503 |
504 SendResponse(true); | 504 SendResponse(true); |
505 } | 505 } |
506 | 506 |
507 } // namespace extensions | 507 } // namespace extensions |
OLD | NEW |