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

Unified Diff: content/renderer/presentation/presentation_dispatcher.cc

Issue 2340433003: [Presentation API] 1-UA: notify receiver page when receiver connection becomes available (blink sid… (Closed)
Patch Set: rebase with master 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: 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) {

Powered by Google App Engine
This is Rietveld 408576698