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