OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/Presentation.h" | 5 #include "modules/presentation/Presentation.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 "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
10 #include "modules/presentation/PresentationController.h" | 10 #include "modules/presentation/PresentationController.h" |
11 #include "modules/presentation/PresentationReceiver.h" | 11 #include "modules/presentation/PresentationReceiver.h" |
12 #include "modules/presentation/PresentationRequest.h" | 12 #include "modules/presentation/PresentationRequest.h" |
13 #include "platform/weborigin/KURL.h" | 13 #include "platform/weborigin/KURL.h" |
14 #include "wtf/Vector.h" | 14 #include "wtf/Vector.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
18 Presentation::Presentation(LocalFrame* frame) : ContextClient(frame) {} | 18 Presentation::Presentation(LocalFrame* frame) : ContextClient(frame) {} |
19 | 19 |
20 // static | 20 // static |
21 Presentation* Presentation::create(LocalFrame* frame) { | 21 Presentation* Presentation::create(LocalFrame* frame) { |
22 ASSERT(frame); | 22 ASSERT(frame); |
23 | |
24 Presentation* presentation = new Presentation(frame); | 23 Presentation* presentation = new Presentation(frame); |
25 PresentationController* controller = PresentationController::from(*frame); | 24 PresentationController* controller = PresentationController::from(*frame); |
26 ASSERT(controller); | 25 ASSERT(controller); |
27 controller->setPresentation(presentation); | 26 controller->setPresentation(presentation); |
28 return presentation; | 27 return presentation; |
29 } | 28 } |
30 | 29 |
31 DEFINE_TRACE(Presentation) { | 30 DEFINE_TRACE(Presentation) { |
32 visitor->trace(m_defaultRequest); | 31 visitor->trace(m_defaultRequest); |
33 visitor->trace(m_receiver); | 32 visitor->trace(m_receiver); |
(...skipping 27 matching lines...) Expand all Loading... |
61 if (!m_receiver) { | 60 if (!m_receiver) { |
62 PresentationController* controller = PresentationController::from(*frame()); | 61 PresentationController* controller = PresentationController::from(*frame()); |
63 auto* client = controller ? controller->client() : nullptr; | 62 auto* client = controller ? controller->client() : nullptr; |
64 m_receiver = new PresentationReceiver(frame(), client); | 63 m_receiver = new PresentationReceiver(frame(), client); |
65 } | 64 } |
66 | 65 |
67 return m_receiver; | 66 return m_receiver; |
68 } | 67 } |
69 | 68 |
70 } // namespace blink | 69 } // namespace blink |
OLD | NEW |