| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 } | 647 } |
| 648 | 648 |
| 649 void MediaCaptureDevicesDispatcher::ProcessTabCaptureAccessRequest( | 649 void MediaCaptureDevicesDispatcher::ProcessTabCaptureAccessRequest( |
| 650 content::WebContents* web_contents, | 650 content::WebContents* web_contents, |
| 651 const content::MediaStreamRequest& request, | 651 const content::MediaStreamRequest& request, |
| 652 const content::MediaResponseCallback& callback, | 652 const content::MediaResponseCallback& callback, |
| 653 const extensions::Extension* extension) { | 653 const extensions::Extension* extension) { |
| 654 content::MediaStreamDevices devices; | 654 content::MediaStreamDevices devices; |
| 655 scoped_ptr<content::MediaStreamUI> ui; | 655 scoped_ptr<content::MediaStreamUI> ui; |
| 656 | 656 |
| 657 #if defined(ENABLE_EXTENSIONS) && !defined(USE_ATHENA) | 657 #if defined(ENABLE_EXTENSIONS) |
| 658 Profile* profile = | 658 Profile* profile = |
| 659 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 659 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| 660 extensions::TabCaptureRegistry* tab_capture_registry = | 660 extensions::TabCaptureRegistry* tab_capture_registry = |
| 661 extensions::TabCaptureRegistry::Get(profile); | 661 extensions::TabCaptureRegistry::Get(profile); |
| 662 if (!tab_capture_registry) { | 662 if (!tab_capture_registry) { |
| 663 NOTREACHED(); | 663 NOTREACHED(); |
| 664 callback.Run(devices, content::MEDIA_DEVICE_INVALID_STATE, ui.Pass()); | 664 callback.Run(devices, content::MEDIA_DEVICE_INVALID_STATE, ui.Pass()); |
| 665 return; | 665 return; |
| 666 } | 666 } |
| 667 const bool tab_capture_allowed = tab_capture_registry->VerifyRequest( | 667 const bool tab_capture_allowed = tab_capture_registry->VerifyRequest( |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 | 1086 |
| 1087 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( | 1087 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( |
| 1088 const MediaStreamDevices& devices) { | 1088 const MediaStreamDevices& devices) { |
| 1089 test_audio_devices_ = devices; | 1089 test_audio_devices_ = devices; |
| 1090 } | 1090 } |
| 1091 | 1091 |
| 1092 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( | 1092 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( |
| 1093 const MediaStreamDevices& devices) { | 1093 const MediaStreamDevices& devices) { |
| 1094 test_video_devices_ = devices; | 1094 test_video_devices_ = devices; |
| 1095 } | 1095 } |
| OLD | NEW |