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

Unified Diff: chrome/browser/media/router/presentation_service_delegate_impl.cc

Issue 2477573002: [Presentation API] (3rd) (1-UA) Split PresentationServiceDelegateImpl(PSDImpl) (Closed)
Patch Set: Created 4 years, 1 month 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/media/router/presentation_service_delegate_impl.cc
diff --git a/chrome/browser/media/router/presentation_service_delegate_impl.cc b/chrome/browser/media/router/presentation_service_delegate_impl.cc
index 7d9400ca68572e5e1bc8aa244132da7b911a89e9..f401199a5f07ddcfd1c18b133169f25242087e4a 100644
--- a/chrome/browser/media/router/presentation_service_delegate_impl.cc
+++ b/chrome/browser/media/router/presentation_service_delegate_impl.cc
@@ -21,6 +21,8 @@
#include "chrome/browser/media/router/media_router_factory.h"
#include "chrome/browser/media/router/media_sink.h"
#include "chrome/browser/media/router/media_source_helper.h"
+#include "chrome/browser/media/router/offscreen_presentation_manager.h"
+#include "chrome/browser/media/router/offscreen_presentation_manager_factory.h"
#include "chrome/browser/media/router/presentation_media_sinks_observer.h"
#include "chrome/browser/media/router/route_message.h"
#include "chrome/browser/media/router/route_message_observer.h"
@@ -31,6 +33,7 @@
#include "content/public/browser/presentation_session.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
+#include "url/gurl.h"
DEFINE_WEB_CONTENTS_USER_DATA_KEY(
media_router::PresentationServiceDelegateImpl);
@@ -41,7 +44,7 @@ namespace media_router {
namespace {
-using DelegateObserver = content::PresentationServiceDelegate::Observer;
+using DelegateObserver = content::PresentationServiceDelegateBase::Observer;
// Returns the unique identifier for the supplied RenderFrameHost.
RenderFrameHostId GetRenderFrameHostId(RenderFrameHost* render_frame_host) {
@@ -917,6 +920,19 @@ void PresentationServiceDelegateImpl::ListenForConnectionStateChange(
state_changed_cb);
}
+void PresentationServiceDelegateImpl::ConnectToOffscreenPresentation(
+ int render_process_id,
+ int render_frame_id,
+ const content::PresentationSessionInfo& session,
+ content::PresentationConnectionPtr connection) {
+ RenderFrameHostId render_frame_host_id(render_process_id, render_frame_id);
+ auto offscreen_presentation_manager = OffscreenPresentationManagerFactory::
mark a. foltz 2016/11/08 23:40:51 Slight preference for auto offscreen_presentation_
zhaobin 2016/11/10 04:14:00 Done.
+ GetOrCreateForControllerBrowserContext(web_contents_);
+ offscreen_presentation_manager->RegisterOffscreenPresentationController(
+ session.presentation_id, GURL(session.presentation_url),
mark a. foltz 2016/11/08 23:40:51 session.presentation_url is already a GURL.
zhaobin 2016/11/10 04:13:59 Done.
+ render_frame_host_id, std::move(connection));
+}
+
void PresentationServiceDelegateImpl::OnRouteResponse(
const PresentationRequest& presentation_request,
const RouteRequestResult& result) {

Powered by Google App Engine
This is Rietveld 408576698