| 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" | |
| 8 #include "apps/app_window_registry.h" | |
| 9 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 8 #include "base/logging.h" |
| 11 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 12 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| 13 #include "base/prefs/scoped_user_pref_update.h" | 11 #include "base/prefs/scoped_user_pref_update.h" |
| 14 #include "base/sha1.h" | 12 #include "base/sha1.h" |
| 15 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 16 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 18 #include "chrome/browser/media/desktop_streams_registry.h" | 16 #include "chrome/browser/media/desktop_streams_registry.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 33 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
| 34 #include "content/public/browser/desktop_media_id.h" | 32 #include "content/public/browser/desktop_media_id.h" |
| 35 #include "content/public/browser/media_capture_devices.h" | 33 #include "content/public/browser/media_capture_devices.h" |
| 36 #include "content/public/browser/notification_service.h" | 34 #include "content/public/browser/notification_service.h" |
| 37 #include "content/public/browser/notification_source.h" | 35 #include "content/public/browser/notification_source.h" |
| 38 #include "content/public/browser/notification_types.h" | 36 #include "content/public/browser/notification_types.h" |
| 39 #include "content/public/browser/render_frame_host.h" | 37 #include "content/public/browser/render_frame_host.h" |
| 40 #include "content/public/browser/render_process_host.h" | 38 #include "content/public/browser/render_process_host.h" |
| 41 #include "content/public/browser/web_contents.h" | 39 #include "content/public/browser/web_contents.h" |
| 42 #include "content/public/common/media_stream_request.h" | 40 #include "content/public/common/media_stream_request.h" |
| 41 #include "extensions/browser/app_window/app_window.h" |
| 42 #include "extensions/browser/app_window/app_window_registry.h" |
| 43 #include "extensions/common/constants.h" | 43 #include "extensions/common/constants.h" |
| 44 #include "extensions/common/extension.h" | 44 #include "extensions/common/extension.h" |
| 45 #include "extensions/common/permissions/permissions_data.h" | 45 #include "extensions/common/permissions/permissions_data.h" |
| 46 #include "media/audio/audio_manager_base.h" | 46 #include "media/audio/audio_manager_base.h" |
| 47 #include "media/base/media_switches.h" | 47 #include "media/base/media_switches.h" |
| 48 #include "net/base/net_util.h" | 48 #include "net/base/net_util.h" |
| 49 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_types.h" | 49 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_types.h" |
| 50 #include "ui/base/l10n/l10n_util.h" | 50 #include "ui/base/l10n/l10n_util.h" |
| 51 | 51 |
| 52 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 #endif // defined(AUDIO_STREAM_MONITORING) | 229 #endif // defined(AUDIO_STREAM_MONITORING) |
| 230 | 230 |
| 231 #if !defined(OS_ANDROID) | 231 #if !defined(OS_ANDROID) |
| 232 // Find browser or app window from a given |web_contents|. | 232 // Find browser or app window from a given |web_contents|. |
| 233 gfx::NativeWindow FindParentWindowForWebContents( | 233 gfx::NativeWindow FindParentWindowForWebContents( |
| 234 content::WebContents* web_contents) { | 234 content::WebContents* web_contents) { |
| 235 Browser* browser = chrome::FindBrowserWithWebContents(web_contents); | 235 Browser* browser = chrome::FindBrowserWithWebContents(web_contents); |
| 236 if (browser && browser->window()) | 236 if (browser && browser->window()) |
| 237 return browser->window()->GetNativeWindow(); | 237 return browser->window()->GetNativeWindow(); |
| 238 | 238 |
| 239 const apps::AppWindowRegistry::AppWindowList& window_list = | 239 const extensions::AppWindowRegistry::AppWindowList& window_list = |
| 240 apps::AppWindowRegistry::Get( | 240 extensions::AppWindowRegistry::Get( |
| 241 web_contents->GetBrowserContext())->app_windows(); | 241 web_contents->GetBrowserContext())->app_windows(); |
| 242 for (apps::AppWindowRegistry::AppWindowList::const_iterator iter = | 242 for (extensions::AppWindowRegistry::AppWindowList::const_iterator iter = |
| 243 window_list.begin(); | 243 window_list.begin(); |
| 244 iter != window_list.end(); ++iter) { | 244 iter != window_list.end(); ++iter) { |
| 245 if ((*iter)->web_contents() == web_contents) | 245 if ((*iter)->web_contents() == web_contents) |
| 246 return (*iter)->GetNativeWindow(); | 246 return (*iter)->GetNativeWindow(); |
| 247 } | 247 } |
| 248 | 248 |
| 249 return NULL; | 249 return NULL; |
| 250 } | 250 } |
| 251 #endif | 251 #endif |
| 252 | 252 |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 | 1015 |
| 1016 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( | 1016 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( |
| 1017 const MediaStreamDevices& devices) { | 1017 const MediaStreamDevices& devices) { |
| 1018 test_audio_devices_ = devices; | 1018 test_audio_devices_ = devices; |
| 1019 } | 1019 } |
| 1020 | 1020 |
| 1021 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( | 1021 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( |
| 1022 const MediaStreamDevices& devices) { | 1022 const MediaStreamDevices& devices) { |
| 1023 test_video_devices_ = devices; | 1023 test_video_devices_ = devices; |
| 1024 } | 1024 } |
| OLD | NEW |