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..65c56ecd8afa0b03e78248976b428b98be05fa11 100644 |
--- a/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc |
+++ b/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc |
@@ -10,6 +10,7 @@ |
#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 +100,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 +115,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. |