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 |
(...skipping 21 matching lines...) Expand all Loading... |
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 |
39 // static | 39 // static |
40 PresentationController* PresentationController::from(LocalFrame& frame) | 40 PresentationController* PresentationController::from(LocalFrame& frame) |
41 { | 41 { |
42 return static_cast<PresentationController*>(HeapSupplement<LocalFrame>::from
(frame, supplementName())); | 42 return static_cast<PresentationController*>(Supplement<LocalFrame>::from(fra
me, supplementName())); |
43 } | 43 } |
44 | 44 |
45 // static | 45 // static |
46 void PresentationController::provideTo(LocalFrame& frame, WebPresentationClient*
client) | 46 void PresentationController::provideTo(LocalFrame& frame, WebPresentationClient*
client) |
47 { | 47 { |
48 HeapSupplement<LocalFrame>::provideTo(frame, PresentationController::supplem
entName(), PresentationController::create(frame, client)); | 48 Supplement<LocalFrame>::provideTo(frame, PresentationController::supplementN
ame(), PresentationController::create(frame, client)); |
49 } | 49 } |
50 | 50 |
51 WebPresentationClient* PresentationController::client() | 51 WebPresentationClient* PresentationController::client() |
52 { | 52 { |
53 return m_client; | 53 return m_client; |
54 } | 54 } |
55 | 55 |
56 DEFINE_TRACE(PresentationController) | 56 DEFINE_TRACE(PresentationController) |
57 { | 57 { |
58 visitor->trace(m_presentation); | 58 visitor->trace(m_presentation); |
59 visitor->trace(m_connections); | 59 visitor->trace(m_connections); |
60 HeapSupplement<LocalFrame>::trace(visitor); | 60 Supplement<LocalFrame>::trace(visitor); |
61 LocalFrameLifecycleObserver::trace(visitor); | 61 LocalFrameLifecycleObserver::trace(visitor); |
62 } | 62 } |
63 | 63 |
64 void PresentationController::didStartDefaultSession(WebPresentationConnectionCli
ent* connectionClient) | 64 void PresentationController::didStartDefaultSession(WebPresentationConnectionCli
ent* connectionClient) |
65 { | 65 { |
66 if (!m_presentation || !m_presentation->defaultRequest()) | 66 if (!m_presentation || !m_presentation->defaultRequest()) |
67 return; | 67 return; |
68 PresentationConnection::take(this, adoptPtr(connectionClient), m_presentatio
n->defaultRequest()); | 68 PresentationConnection::take(this, adoptPtr(connectionClient), m_presentatio
n->defaultRequest()); |
69 } | 69 } |
70 | 70 |
(...skipping 70 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 |