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

Unified Diff: chrome/browser/extensions/api/tab_capture/offscreen_tab.cc

Issue 2379703002: [Presentation API] (alternative) 1-UA: send message between controller and receiver page (Closed)
Patch Set: rebase with master Created 4 years, 2 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: 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..48d19f672433e30757733471480b9d3766cd3c92 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>
#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"
@@ -98,8 +101,9 @@ void OffscreenTab::Start(const GURL& start_url,
DCHECK(start_time_.is_null());
start_url_ = start_url;
DVLOG(1) << "Starting OffscreenTab with initial size of "
- << initial_size.ToString() << " for start_url=" << start_url_.spec();
-
+ << initial_size.ToString() << " for start_url=" << start_url_.spec()
+ << " Register with ReceiverPresentationServiceDelegateImpl, id="
mark a. foltz 2016/10/06 03:13:54 Should this go down at L125?
zhaobin 2016/10/07 01:07:03 Done.
+ << optional_presentation_id;
// Create the WebContents to contain the off-screen tab's page.
offscreen_tab_web_contents_.reset(
WebContents::Create(WebContents::CreateParams(profile_.get())));
@@ -116,10 +120,11 @@ void OffscreenTab::Start(const GURL& start_url,
offscreen_tab_web_contents_->SetAudioMuted(true);
// TODO(imcheng): If |optional_presentation_id| is not empty, register it with
- // the PresentationRouter. http://crbug.com/513859
+ // the ReceiverPresentationServiceDelegateImpl. http://crbug.com/513859
mark a. foltz 2016/10/06 03:13:54 It looks like you can delete this TODO :)
zhaobin 2016/10/07 01:07:03 Done.
if (!optional_presentation_id.empty()) {
- NOTIMPLEMENTED()
- << "Register with PresentationRouter, 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.

Powered by Google App Engine
This is Rietveld 408576698