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

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: Added a return statement for the conversion function 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, WebPresentationSessionState state)
90 {
91 if (m_presentation)
92 m_presentation->didChangeSessionState(sessionClient, state);
93 else
94 PresentationSession::dispose(sessionClient);
95 }
96
89 void PresentationController::startSession(const String& presentationUrl, const S tring& presentationId, WebPresentationSessionClientCallbacks* callbacks) 97 void PresentationController::startSession(const String& presentationUrl, const S tring& presentationId, WebPresentationSessionClientCallbacks* callbacks)
90 { 98 {
91 if (!m_client) { 99 if (!m_client) {
92 delete callbacks; 100 delete callbacks;
93 return; 101 return;
94 } 102 }
95 m_client->startSession(presentationUrl, presentationId, callbacks); 103 m_client->startSession(presentationUrl, presentationId, callbacks);
96 } 104 }
97 105
98 void PresentationController::joinSession(const String& presentationUrl, const St ring& presentationId, WebPresentationSessionClientCallbacks* callbacks) 106 void PresentationController::joinSession(const String& presentationUrl, const St ring& presentationId, WebPresentationSessionClientCallbacks* callbacks)
(...skipping 19 matching lines...) Expand all
118 126
119 void PresentationController::willDetachFrameHost() 127 void PresentationController::willDetachFrameHost()
120 { 128 {
121 if (m_client) { 129 if (m_client) {
122 m_client->setController(nullptr); 130 m_client->setController(nullptr);
123 m_client = nullptr; 131 m_client = nullptr;
124 } 132 }
125 } 133 }
126 134
127 } // namespace blink 135 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/presentation/PresentationController.h ('k') | Source/modules/presentation/PresentationSession.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698