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

Side by Side Diff: Source/modules/presentation/PresentationController.cpp

Issue 1020303004: [PresentationAPI] Plumbing |onstatechange| event for the PresentationSession from Blink to platform/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "modules/presentation/PresentationController.h" 6 #include "modules/presentation/PresentationController.h"
7 7
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "modules/presentation/PresentationSession.h" 9 #include "modules/presentation/PresentationSession.h"
10 #include "public/platform/modules/presentation/WebPresentationClient.h" 10 #include "public/platform/modules/presentation/WebPresentationClient.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 { 79 {
80 if (!m_presentation) { 80 if (!m_presentation) {
81 PresentationSession::dispose(sessionClient); 81 PresentationSession::dispose(sessionClient);
82 return; 82 return;
83 } 83 }
84 84
85 PresentationSession* session = PresentationSession::take(sessionClient, m_pr esentation); 85 PresentationSession* session = PresentationSession::take(sessionClient, m_pr esentation);
86 m_presentation->didStartDefaultSession(session); 86 m_presentation->didStartDefaultSession(session);
87 } 87 }
88 88
89 void PresentationController::didChangeSessionState(WebPresentationSessionClient* sessionClient, WebPresentationSessionClient::SessionState state)
90 {
91 if (m_presentation) {
92 PresentationSession* session = m_presentation->findSession(sessionClient );
Peter Beverloo 2015/03/20 19:07:40 Do you expect more events following this paradigm?
whywhat 2015/03/23 21:12:16 Yes, there will be at least an event about receivi
93 if (session)
94 session->didChangeState(state);
95 }
96
97 PresentationSession::dispose(sessionClient);
98 }
99
89 void PresentationController::startSession(const String& presentationUrl, const S tring& presentationId, WebPresentationSessionClientCallbacks* callbacks) 100 void PresentationController::startSession(const String& presentationUrl, const S tring& presentationId, WebPresentationSessionClientCallbacks* callbacks)
90 { 101 {
91 if (!m_client) { 102 if (!m_client) {
92 delete callbacks; 103 delete callbacks;
93 return; 104 return;
94 } 105 }
95 m_client->startSession(presentationUrl, presentationId, callbacks); 106 m_client->startSession(presentationUrl, presentationId, callbacks);
96 } 107 }
97 108
98 void PresentationController::joinSession(const String& presentationUrl, const St ring& presentationId, WebPresentationSessionClientCallbacks* callbacks) 109 void PresentationController::joinSession(const String& presentationUrl, const St ring& presentationId, WebPresentationSessionClientCallbacks* callbacks)
(...skipping 19 matching lines...) Expand all
118 129
119 void PresentationController::willDetachFrameHost() 130 void PresentationController::willDetachFrameHost()
120 { 131 {
121 if (m_client) { 132 if (m_client) {
122 m_client->setController(nullptr); 133 m_client->setController(nullptr);
123 m_client = nullptr; 134 m_client = nullptr;
124 } 135 }
125 } 136 }
126 137
127 } // namespace blink 138 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698