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

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

Issue 1084293004: [PresentationAPI] Added on-session-message handler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 39e5238b189b9fd7c3219337565554affc628c92..59cfa74cdb1610bdffa506541d64e3cf0e21425d 100644
--- a/content/renderer/presentation/presentation_dispatcher.cc
+++ b/content/renderer/presentation/presentation_dispatcher.cc
@@ -210,6 +210,22 @@ void PresentationDispatcher::OnSessionStateChange(
GetWebPresentationSessionStateFromMojo(session_state));
}
+void PresentationDispatcher::OnSessionTextMessageReceived(
+ presentation::PresentationSessionInfoPtr session_info,
+ const std::string& message) {
+ if (!controller_)
+ return;
+
+ presentation_service_->ListenForSessionTextMessage(base::Bind(
+ &PresentationDispatcher::OnSessionTextMessageReceived,
+ base::Unretained(this)));
+
+ DCHECK(!session_info.is_null());
+ controller_->didReceiveSessionTextMessage(
+ new PresentationSessionClient(session_info.Pass()),
+ blink::WebString::fromUTF8(message));
+}
+
void PresentationDispatcher::ConnectToPresentationServiceIfNeeded() {
if (presentation_service_.get())
return;
@@ -225,6 +241,9 @@ void PresentationDispatcher::ConnectToPresentationServiceIfNeeded() {
presentation_service_->ListenForSessionStateChange(base::Bind(
&PresentationDispatcher::OnSessionStateChange,
base::Unretained(this)));
+ presentation_service_->ListenForSessionTextMessage(base::Bind(
+ &PresentationDispatcher::OnSessionTextMessageReceived,
+ base::Unretained(this)));
*/
}

Powered by Google App Engine
This is Rietveld 408576698