Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 | 97 |
| 98 void PresentationController::joinSession(const String& presentationUrl, const St ring& presentationId, WebPresentationSessionClientCallbacks* callbacks) | 98 void PresentationController::joinSession(const String& presentationUrl, const St ring& presentationId, WebPresentationSessionClientCallbacks* callbacks) |
| 99 { | 99 { |
| 100 if (!m_client) { | 100 if (!m_client) { |
| 101 delete callbacks; | 101 delete callbacks; |
| 102 return; | 102 return; |
| 103 } | 103 } |
| 104 m_client->joinSession(presentationUrl, presentationId, callbacks); | 104 m_client->joinSession(presentationUrl, presentationId, callbacks); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void PresentationController::closeSession(const String& presentationId) | |
| 108 { | |
| 109 if (!m_client) { | |
|
whywhat
2015/03/17 23:35:19
nit: remove the curly braces to be consistent with
haibinlu
2015/03/18 00:58:22
Done.
| |
| 110 return; | |
| 111 } | |
| 112 m_client->closeSession(presentationId); | |
|
whywhat
2015/03/17 23:35:19
high level question: do we want to get any result
haibinlu
2015/03/18 00:58:22
The result of session.close is onstatechange event
whywhat
2015/03/18 12:51:19
Ok, I think this makes sense and aligns with the s
| |
| 113 } | |
| 114 | |
| 107 void PresentationController::setPresentation(Presentation* presentation) | 115 void PresentationController::setPresentation(Presentation* presentation) |
| 108 { | 116 { |
| 109 m_presentation = presentation; | 117 m_presentation = presentation; |
| 110 } | 118 } |
| 111 | 119 |
| 112 void PresentationController::willDetachFrameHost() | 120 void PresentationController::willDetachFrameHost() |
| 113 { | 121 { |
| 114 if (m_client) { | 122 if (m_client) { |
| 115 m_client->setController(nullptr); | 123 m_client->setController(nullptr); |
| 116 m_client = nullptr; | 124 m_client = nullptr; |
| 117 } | 125 } |
| 118 } | 126 } |
| 119 | 127 |
| 120 } // namespace blink | 128 } // namespace blink |
| OLD | NEW |