| 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 "modules/presentation/PresentationController.h" | 5 #include "modules/presentation/PresentationController.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
| 9 #include "modules/presentation/PresentationConnection.h" | 9 #include "modules/presentation/PresentationConnection.h" |
| 10 #include "public/platform/WebString.h" | 10 #include "public/platform/WebString.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 return m_client; | 59 return m_client; |
| 60 } | 60 } |
| 61 | 61 |
| 62 DEFINE_TRACE(PresentationController) { | 62 DEFINE_TRACE(PresentationController) { |
| 63 visitor->trace(m_presentation); | 63 visitor->trace(m_presentation); |
| 64 visitor->trace(m_connections); | 64 visitor->trace(m_connections); |
| 65 Supplement<LocalFrame>::trace(visitor); | 65 Supplement<LocalFrame>::trace(visitor); |
| 66 ContextLifecycleObserver::trace(visitor); | 66 ContextLifecycleObserver::trace(visitor); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void PresentationController::didStartDefaultSession( | 69 WebPresentationConnection* PresentationController::didStartDefaultSession( |
| 70 const WebPresentationSessionInfo& sessionInfo) { | 70 const WebPresentationSessionInfo& sessionInfo) { |
| 71 if (!m_presentation || !m_presentation->defaultRequest()) | 71 if (!m_presentation || !m_presentation->defaultRequest()) |
| 72 return; | 72 return nullptr; |
| 73 PresentationConnection::take(this, sessionInfo, | 73 |
| 74 m_presentation->defaultRequest()); | 74 return PresentationConnection::take(this, sessionInfo, |
| 75 m_presentation->defaultRequest()); |
| 75 } | 76 } |
| 76 | 77 |
| 77 void PresentationController::didChangeSessionState( | 78 void PresentationController::didChangeSessionState( |
| 78 const WebPresentationSessionInfo& sessionInfo, | 79 const WebPresentationSessionInfo& sessionInfo, |
| 79 WebPresentationConnectionState state) { | 80 WebPresentationConnectionState state) { |
| 80 PresentationConnection* connection = findConnection(sessionInfo); | 81 PresentationConnection* connection = findConnection(sessionInfo); |
| 81 if (!connection) | 82 if (!connection) |
| 82 return; | 83 return; |
| 83 connection->didChangeState(state); | 84 connection->didChangeState(state); |
| 84 } | 85 } |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 const WebPresentationSessionInfo& sessionInfo) { | 162 const WebPresentationSessionInfo& sessionInfo) { |
| 162 for (const auto& connection : m_connections) { | 163 for (const auto& connection : m_connections) { |
| 163 if (connection->matches(sessionInfo)) | 164 if (connection->matches(sessionInfo)) |
| 164 return connection.get(); | 165 return connection.get(); |
| 165 } | 166 } |
| 166 | 167 |
| 167 return nullptr; | 168 return nullptr; |
| 168 } | 169 } |
| 169 | 170 |
| 170 } // namespace blink | 171 } // namespace blink |
| OLD | NEW |