| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 presentationUrls[0] = url; | 124 presentationUrls[0] = url; |
| 125 | 125 |
| 126 m_client->setDefaultPresentationUrls(presentationUrls); | 126 m_client->setDefaultPresentationUrls(presentationUrls); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void PresentationController::registerConnection( | 129 void PresentationController::registerConnection( |
| 130 PresentationConnection* connection) { | 130 PresentationConnection* connection) { |
| 131 m_connections.add(connection); | 131 m_connections.add(connection); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void PresentationController::contextDestroyed() { | 134 void PresentationController::contextDestroyed(ExecutionContext*) { |
| 135 if (m_client) { | 135 if (m_client) { |
| 136 m_client->setController(nullptr); | 136 m_client->setController(nullptr); |
| 137 m_client = nullptr; | 137 m_client = nullptr; |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 | 140 |
| 141 PresentationConnection* PresentationController::findExistingConnection( | 141 PresentationConnection* PresentationController::findExistingConnection( |
| 142 const blink::WebVector<blink::WebURL>& presentationUrls, | 142 const blink::WebVector<blink::WebURL>& presentationUrls, |
| 143 const blink::WebString& presentationId) { | 143 const blink::WebString& presentationId) { |
| 144 for (const auto& connection : m_connections) { | 144 for (const auto& connection : m_connections) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 157 const WebPresentationSessionInfo& sessionInfo) { | 157 const WebPresentationSessionInfo& sessionInfo) { |
| 158 for (const auto& connection : m_connections) { | 158 for (const auto& connection : m_connections) { |
| 159 if (connection->matches(sessionInfo)) | 159 if (connection->matches(sessionInfo)) |
| 160 return connection.get(); | 160 return connection.get(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 return nullptr; | 163 return nullptr; |
| 164 } | 164 } |
| 165 | 165 |
| 166 } // namespace blink | 166 } // namespace blink |
| OLD | NEW |