OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/media/media_capture_devices_dispatcher.h" | 5 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
6 | 6 |
7 #include "apps/app_window.h" | 7 #include "apps/app_window.h" |
8 #include "apps/app_window_registry.h" | 8 #include "apps/app_window_registry.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // MediaCaptureDevicesDispatcher is a singleton. It should be created on | 269 // MediaCaptureDevicesDispatcher is a singleton. It should be created on |
270 // UI thread. Otherwise, it will not receive | 270 // UI thread. Otherwise, it will not receive |
271 // content::NOTIFICATION_WEB_CONTENTS_DESTROYED, and that will result in | 271 // content::NOTIFICATION_WEB_CONTENTS_DESTROYED, and that will result in |
272 // possible use after free. | 272 // possible use after free. |
273 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 273 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
274 notifications_registrar_.Add( | 274 notifications_registrar_.Add( |
275 this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 275 this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
276 content::NotificationService::AllSources()); | 276 content::NotificationService::AllSources()); |
277 | 277 |
278 // AVFoundation is used for video/audio device monitoring and video capture in | 278 // AVFoundation is used for video/audio device monitoring and video capture in |
279 // Mac. Experimentally, connect it in Canary and Unkown (developer builds). | 279 // Mac. Experimentally, connect it in Canary and Unknown (developer builds). |
280 #if defined(OS_MACOSX) | 280 #if defined(OS_MACOSX) |
281 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 281 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
282 if (channel == chrome::VersionInfo::CHANNEL_CANARY || | 282 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceQTKit)) { |
283 channel == chrome::VersionInfo::CHANNEL_UNKNOWN) { | 283 if (channel == chrome::VersionInfo::CHANNEL_CANARY || |
284 CommandLine::ForCurrentProcess()->AppendSwitch( | 284 channel == chrome::VersionInfo::CHANNEL_UNKNOWN) { |
285 switches::kEnableAVFoundation); | 285 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 286 switches::kEnableAVFoundation); |
| 287 } |
286 } | 288 } |
287 #endif | 289 #endif |
288 } | 290 } |
289 | 291 |
290 MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {} | 292 MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {} |
291 | 293 |
292 void MediaCaptureDevicesDispatcher::RegisterProfilePrefs( | 294 void MediaCaptureDevicesDispatcher::RegisterProfilePrefs( |
293 user_prefs::PrefRegistrySyncable* registry) { | 295 user_prefs::PrefRegistrySyncable* registry) { |
294 registry->RegisterStringPref( | 296 registry->RegisterStringPref( |
295 prefs::kDefaultAudioCaptureDevice, | 297 prefs::kDefaultAudioCaptureDevice, |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 | 1013 |
1012 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( | 1014 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( |
1013 const MediaStreamDevices& devices) { | 1015 const MediaStreamDevices& devices) { |
1014 test_audio_devices_ = devices; | 1016 test_audio_devices_ = devices; |
1015 } | 1017 } |
1016 | 1018 |
1017 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( | 1019 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( |
1018 const MediaStreamDevices& devices) { | 1020 const MediaStreamDevices& devices) { |
1019 test_video_devices_ = devices; | 1021 test_video_devices_ = devices; |
1020 } | 1022 } |
OLD | NEW |