Index: content/renderer/presentation/presentation_dispatcher.cc |
diff --git a/content/renderer/presentation/presentation_dispatcher.cc b/content/renderer/presentation/presentation_dispatcher.cc |
index 9543fb9129c205c90e32b3a5e23a8286b88307a3..a0b3125568cfa47217c6424ab470549d34f99c92 100644 |
--- a/content/renderer/presentation/presentation_dispatcher.cc |
+++ b/content/renderer/presentation/presentation_dispatcher.cc |
@@ -20,6 +20,7 @@ |
#include "third_party/WebKit/public/platform/modules/presentation/WebPresentationAvailabilityObserver.h" |
#include "third_party/WebKit/public/platform/modules/presentation/WebPresentationController.h" |
#include "third_party/WebKit/public/platform/modules/presentation/WebPresentationError.h" |
+#include "third_party/WebKit/public/platform/modules/presentation/WebPresentationReceiver.h" |
#include "third_party/WebKit/public/platform/modules/presentation/presentation.mojom.h" |
#include "third_party/WebKit/public/web/WebLocalFrame.h" |
#include "url/gurl.h" |
@@ -298,6 +299,12 @@ void PresentationDispatcher::setDefaultPresentationUrls( |
presentation_service_->SetDefaultPresentationUrls(urls); |
} |
+void PresentationDispatcher::setReceiver( |
+ blink::WebPresentationReceiver* receiver) { |
+ ConnectToPresentationServiceIfNeeded(); |
+ receiver_ = receiver; |
+} |
+ |
void PresentationDispatcher::DidCommitProvisionalLoad( |
bool is_new_navigation, |
bool is_same_page_navigation) { |
@@ -391,6 +398,14 @@ void PresentationDispatcher::OnSessionCreated( |
base::MakeUnique<PresentationConnectionClient>(std::move(session_info))); |
} |
+void PresentationDispatcher::OnReceiverConnectionAvailable( |
+ blink::mojom::PresentationSessionInfoPtr session_info) { |
+ if (receiver_) { |
+ receiver_->onReceiverConnectionAvailable( |
+ new PresentationConnectionClient(std::move(session_info))); |
+ } |
+} |
+ |
void PresentationDispatcher::OnConnectionStateChanged( |
blink::mojom::PresentationSessionInfoPtr connection, |
blink::mojom::PresentationConnectionState state) { |