| 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/frame/LocalFrame.h" | 7 #include "core/frame/LocalFrame.h" |
| 8 #include "modules/presentation/PresentationConnection.h" | 8 #include "modules/presentation/PresentationConnection.h" |
| 9 #include "public/platform/modules/presentation/WebPresentationClient.h" | 9 #include "public/platform/modules/presentation/WebPresentationClient.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 PresentationController::PresentationController(LocalFrame& frame, WebPresentatio
nClient* client) | 13 PresentationController::PresentationController(LocalFrame& frame, WebPresentatio
nClient* client) |
| 14 : LocalFrameLifecycleObserver(&frame) | 14 : LocalFrameLifecycleObserver(&frame) |
| 15 , m_client(client) | 15 , m_client(client) |
| 16 { | 16 { |
| 17 if (m_client) | 17 if (m_client) |
| 18 m_client->setController(this); | 18 m_client->setController(this); |
| 19 } | 19 } |
| 20 | 20 |
| 21 PresentationController::~PresentationController() | 21 PresentationController::~PresentationController() |
| 22 { | 22 { |
| 23 if (m_client) | 23 if (m_client) |
| 24 m_client->setController(nullptr); | 24 m_client->setController(nullptr); |
| 25 } | 25 } |
| 26 | 26 |
| 27 // static | 27 // static |
| 28 RawPtr<PresentationController> PresentationController::create(LocalFrame& frame,
WebPresentationClient* client) | 28 PresentationController* PresentationController::create(LocalFrame& frame, WebPre
sentationClient* client) |
| 29 { | 29 { |
| 30 return new PresentationController(frame, client); | 30 return new PresentationController(frame, client); |
| 31 } | 31 } |
| 32 | 32 |
| 33 // static | 33 // static |
| 34 const char* PresentationController::supplementName() | 34 const char* PresentationController::supplementName() |
| 35 { | 35 { |
| 36 return "PresentationController"; | 36 return "PresentationController"; |
| 37 } | 37 } |
| 38 | 38 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 { | 141 { |
| 142 for (const auto& connection : m_connections) { | 142 for (const auto& connection : m_connections) { |
| 143 if (connection->matches(connectionClient)) | 143 if (connection->matches(connectionClient)) |
| 144 return connection.get(); | 144 return connection.get(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 return nullptr; | 147 return nullptr; |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace blink | 150 } // namespace blink |
| OLD | NEW |