Index: chrome/browser/extensions/api/tab_capture/offscreen_tab.cc |
diff --git a/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc b/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc |
index f50fdf9c3cb89cd7087e96e447cd697affb933df..a684164e2e7ebb3742b6ce4c6f492e465597f4f3 100644 |
--- a/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc |
+++ b/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc |
@@ -5,11 +5,14 @@ |
#include "chrome/browser/extensions/api/tab_capture/offscreen_tab.h" |
#include <algorithm> |
+#include <memory> |
+#include <utility> |
mark a. foltz
2016/11/16 01:25:37
Are these missing #includes from existing code, or
zhaobin
2016/11/23 01:29:25
Done.
|
#include "base/bind.h" |
#include "base/macros.h" |
#include "base/memory/ptr_util.h" |
#include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" |
+#include "chrome/browser/media/router/receiver_presentation_service_delegate_impl.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/ui/web_contents_sizer.h" |
#include "content/public/browser/render_widget_host_view.h" |
@@ -99,7 +102,6 @@ void OffscreenTab::Start(const GURL& start_url, |
start_url_ = start_url; |
DVLOG(1) << "Starting OffscreenTab with initial size of " |
<< initial_size.ToString() << " for start_url=" << start_url_.spec(); |
- |
// Create the WebContents to contain the off-screen tab's page. |
offscreen_tab_web_contents_.reset( |
WebContents::Create(WebContents::CreateParams(profile_.get()))); |
@@ -115,11 +117,12 @@ void OffscreenTab::Start(const GURL& start_url, |
// automatically unmuted, but will be captured into the MediaStream. |
offscreen_tab_web_contents_->SetAudioMuted(true); |
- // TODO(imcheng): If |optional_presentation_id| is not empty, register it with |
- // the PresentationRouter. http://crbug.com/513859 |
if (!optional_presentation_id.empty()) { |
- NOTIMPLEMENTED() |
- << "Register with PresentationRouter, id=" << optional_presentation_id; |
+ DVLOG(1) << " Register with ReceiverPresentationServiceDelegateImpl, id=" |
+ << optional_presentation_id; |
+ // Register the offscreen tab as the receiver of the offscreen presentation. |
+ media_router::ReceiverPresentationServiceDelegateImpl::CreateForWebContents( |
+ offscreen_tab_web_contents_.get(), optional_presentation_id); |
} |
// Navigate to the initial URL. |