Index: content/renderer/presentation/presentation_dispatcher.cc |
diff --git a/content/renderer/presentation/presentation_dispatcher.cc b/content/renderer/presentation/presentation_dispatcher.cc |
index 88236345a26ab374f4a9fdc7ca6ee917ba8fb7b5..841338f1eb3b7620c0974e1d2fdcae10b32c9f7d 100644 |
--- a/content/renderer/presentation/presentation_dispatcher.cc |
+++ b/content/renderer/presentation/presentation_dispatcher.cc |
@@ -113,6 +113,24 @@ void PresentationDispatcher::OnScreenAvailabilityChanged(bool available) { |
controller_->didChangeAvailability(available); |
} |
+void PresentationDispatcher::OnDefaultPresentationStarted( |
+ presentation::PresentationSessionInfoPtr session_info) { |
+ if (!controller_) |
+ return; |
+ |
+ // Reset the callback to get the next event. |
+ presentation_service_->ListenForDefaultPresentationStart(base::Bind( |
+ &PresentationDispatcher::OnDefaultPresentationStarted, |
+ base::Unretained(this))); |
+ |
+ DCHECK(!session_info.is_null()); |
+ PresentationSessionDispatcher* session_dispatcher = |
+ new PresentationSessionDispatcher(session_info.Pass()); |
+ presentation_session_dispatchers_.push_back(session_dispatcher); |
+ controller_->didStartDefaultPresentation( |
+ new PresentationSessionClient(session_dispatcher)); |
+} |
+ |
void PresentationDispatcher::OnSessionCreated( |
blink::WebPresentationSessionClientCallbacks* callback, |
presentation::PresentationSessionInfoPtr session_info, |
@@ -139,6 +157,9 @@ void PresentationDispatcher::ConnectToPresentationServiceIfNeeded() { |
render_frame()->GetServiceRegistry()->ConnectToRemoteService( |
&presentation_service_); |
+ presentation_service_->ListenForDefaultPresentationStart(base::Bind( |
+ &PresentationDispatcher::OnDefaultPresentationStarted, |
+ base::Unretained(this))); |
} |
} // namespace content |