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

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: resolve code review comments from mlamouri 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 dbbfc1e4f48810c959c8b339b67602663ef2ba66..0660758464e39f1b400b7f00e628484a3a50503e 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"
@@ -302,6 +303,12 @@ void PresentationDispatcher::setDefaultPresentationUrls(
presentation_service_->SetDefaultPresentationUrls(urls);
}
+void PresentationDispatcher::setReceiver(
+ blink::WebPresentationReceiver* receiver) {
+ ConnectToPresentationServiceIfNeeded();
+ m_receiver = receiver;
+}
+
void PresentationDispatcher::DidCommitProvisionalLoad(
bool is_new_navigation,
bool is_same_page_navigation) {
@@ -395,6 +402,13 @@ void PresentationDispatcher::OnSessionCreated(
base::MakeUnique<PresentationConnectionClient>(std::move(session_info)));
}
+void PresentationDispatcher::OnReceiverConnectionAvailable(
+ blink::mojom::PresentationSessionInfoPtr session_info) {
+ if (m_receiver)
mark a. foltz 2016/09/15 16:53:18 What if this is called before m_receiver is set?
zhaobin 2016/09/15 18:56:03 Yes. Going to send out another CL with queuing log
+ m_receiver->onReceiverConnectionAvailable(
+ new PresentationConnectionClient(std::move(session_info)));
mlamouri (slow - plz ping) 2016/09/15 10:49:39 style: add {} when the statement is wrapped in mor
zhaobin 2016/09/15 18:56:03 Done.
+}
+
void PresentationDispatcher::OnConnectionStateChanged(
blink::mojom::PresentationSessionInfoPtr connection,
blink::mojom::PresentationConnectionState state) {

Powered by Google App Engine
This is Rietveld 408576698