Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1019)

Unified Diff: content/browser/renderer_host/media/media_stream_manager.cc

Issue 1763753003: Capture chrome browser windows from internal rendering procedure for windows and linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/media/media_stream_manager.cc
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc
index de848929a7cbac61bf360ed16524e410dd408a50..0f91d0b8bf88f18d0952bbda05df212fbdcb1e0e 100644
--- a/content/browser/renderer_host/media/media_stream_manager.cc
+++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -38,6 +38,7 @@
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
+#include "content/public/browser/desktop_media_id.h"
#include "content/public/browser/media_observer.h"
#include "content/public/browser/media_request_state.h"
#include "content/public/browser/render_process_host.h"
@@ -2052,15 +2053,24 @@ void MediaStreamManager::OnMediaStreamUIWindowId(MediaStreamType video_type,
if (video_type != MEDIA_DESKTOP_VIDEO_CAPTURE)
return;
- // Pass along for desktop screen and window capturing.
+ // Pass along for desktop screen and window capturing when DesktopCaptureDevic
Sergey Ulanov 2016/03/07 21:01:51 typo: DesktopCaptureDevic
GeorgeZ 2016/03/07 23:29:20 Done.
+ // is used.
for (const StreamDeviceInfo& device_info : devices) {
- if (device_info.device.type == MEDIA_DESKTOP_VIDEO_CAPTURE &&
- !WebContentsMediaCaptureId::IsWebContentsDeviceId(
- device_info.device.id)) {
- video_capture_manager_->SetDesktopCaptureWindowId(device_info.session_id,
- window_id);
- break;
- }
+ if (device_info.device.type != MEDIA_DESKTOP_VIDEO_CAPTURE)
+ continue;
+
+ DesktopMediaID media_id = DesktopMediaID::Parse(device_info.device.id);
+ // WebContentsVideoCaptureDevice is used for tab/webcontents.
+ if (media_id.type == DesktopMediaID::TYPE_WEB_CONTENTS)
+ continue;
+#if defined(USE_AURA)
+ // DesktopCaptureDevicAura is used when aura_id is valid.
+ if (media_id.aura_id > DesktopMediaID::kNullId)
+ continue;
+#endif
+ video_capture_manager_->SetDesktopCaptureWindowId(device_info.session_id,
+ window_id);
+ break;
}
}

Powered by Google App Engine
This is Rietveld 408576698