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

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

Issue 2343013002: [Presentation API] (MR side) 1-UA: notify receiver page when receiver connection becomes available (Closed)
Patch Set: resolve code review comments from Derek Created 4 years, 3 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..75ee3cf88a6ed3957e8b28a8138fba116b33f4e7 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/10/04 00:32:20 These #includes don't seem to be used in your patc
#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 PresentationRouter, id="
mark a. foltz 2016/10/04 00:32:20 Did you mean ReceiverPresentationServiceDelegateIm
zhaobin 2016/10/04 02:43:00 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())));
@@ -118,8 +122,11 @@ void OffscreenTab::Start(const GURL& start_url,
// TODO(imcheng): If |optional_presentation_id| is not empty, register it with
// the PresentationRouter. http://crbug.com/513859
mark a. foltz 2016/10/04 00:32:20 s/PresentationRouter/ReceiverPresentationServiceDe
zhaobin 2016/10/04 02:43:00 Done.
if (!optional_presentation_id.empty()) {
- NOTIMPLEMENTED()
- << "Register with PresentationRouter, id=" << optional_presentation_id;
+#if defined(ENABLE_MEDIA_ROUTER)
imcheng 2016/09/28 07:28:35 nit: Remove the #if
zhaobin 2016/09/29 17:20:42 Done.
mark a. foltz 2016/10/04 00:32:20 Still not done (did you upload the most recent pat
+ // Register the offscreen tab as the receiver of the offscreen presentation.
+ media_router::ReceiverPresentationServiceDelegateImpl::CreateForWebContents(
+ offscreen_tab_web_contents_.get(), optional_presentation_id);
+#endif // defined(ENABLE_MEDIA_ROUTER)
}
// Navigate to the initial URL.

Powered by Google App Engine
This is Rietveld 408576698