| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "net/base/net_util.h" | 47 #include "net/base/net_util.h" |
| 48 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_types.h" | 48 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_types.h" |
| 49 #include "ui/base/l10n/l10n_util.h" | 49 #include "ui/base/l10n/l10n_util.h" |
| 50 | 50 |
| 51 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
| 52 #include "ash/shell.h" | 52 #include "ash/shell.h" |
| 53 #endif // defined(OS_CHROMEOS) | 53 #endif // defined(OS_CHROMEOS) |
| 54 | 54 |
| 55 #if defined(ENABLE_EXTENSIONS) | 55 #if defined(ENABLE_EXTENSIONS) |
| 56 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" | 56 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" |
| 57 #include "chrome/browser/extensions/extension_service.h" | |
| 58 #include "extensions/browser/app_window/app_window.h" | 57 #include "extensions/browser/app_window/app_window.h" |
| 59 #include "extensions/browser/app_window/app_window_registry.h" | 58 #include "extensions/browser/app_window/app_window_registry.h" |
| 60 #include "extensions/browser/extension_system.h" | 59 #include "extensions/browser/extension_registry.h" |
| 61 #include "extensions/common/extension.h" | 60 #include "extensions/common/extension.h" |
| 62 #include "extensions/common/permissions/permissions_data.h" | 61 #include "extensions/common/permissions/permissions_data.h" |
| 63 #endif | 62 #endif |
| 64 | 63 |
| 65 using content::BrowserThread; | 64 using content::BrowserThread; |
| 66 using content::MediaCaptureDevices; | 65 using content::MediaCaptureDevices; |
| 67 using content::MediaStreamDevices; | 66 using content::MediaStreamDevices; |
| 68 | 67 |
| 69 namespace { | 68 namespace { |
| 70 | 69 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 } | 214 } |
| 216 #endif | 215 #endif |
| 217 | 216 |
| 218 #if defined(ENABLE_EXTENSIONS) | 217 #if defined(ENABLE_EXTENSIONS) |
| 219 const extensions::Extension* GetExtensionForOrigin( | 218 const extensions::Extension* GetExtensionForOrigin( |
| 220 Profile* profile, | 219 Profile* profile, |
| 221 const GURL& security_origin) { | 220 const GURL& security_origin) { |
| 222 if (!security_origin.SchemeIs(extensions::kExtensionScheme)) | 221 if (!security_origin.SchemeIs(extensions::kExtensionScheme)) |
| 223 return NULL; | 222 return NULL; |
| 224 | 223 |
| 225 ExtensionService* extensions_service = | |
| 226 extensions::ExtensionSystem::Get(profile)->extension_service(); | |
| 227 const extensions::Extension* extension = | 224 const extensions::Extension* extension = |
| 228 extensions_service->extensions()->GetByID(security_origin.host()); | 225 extensions::ExtensionRegistry::Get(profile)->GetExtensionById( |
| 226 security_origin.host(), extensions::ExtensionRegistry::ENABLED); |
| 229 DCHECK(extension); | 227 DCHECK(extension); |
| 230 return extension; | 228 return extension; |
| 231 } | 229 } |
| 232 #endif | 230 #endif |
| 233 | 231 |
| 234 } // namespace | 232 } // namespace |
| 235 | 233 |
| 236 MediaCaptureDevicesDispatcher::PendingAccessRequest::PendingAccessRequest( | 234 MediaCaptureDevicesDispatcher::PendingAccessRequest::PendingAccessRequest( |
| 237 const content::MediaStreamRequest& request, | 235 const content::MediaStreamRequest& request, |
| 238 const content::MediaResponseCallback& callback) | 236 const content::MediaResponseCallback& callback) |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1107 | 1105 |
| 1108 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( | 1106 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( |
| 1109 const MediaStreamDevices& devices) { | 1107 const MediaStreamDevices& devices) { |
| 1110 test_audio_devices_ = devices; | 1108 test_audio_devices_ = devices; |
| 1111 } | 1109 } |
| 1112 | 1110 |
| 1113 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( | 1111 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( |
| 1114 const MediaStreamDevices& devices) { | 1112 const MediaStreamDevices& devices) { |
| 1115 test_video_devices_ = devices; | 1113 test_video_devices_ = devices; |
| 1116 } | 1114 } |
| OLD | NEW |