Chromium Code Reviews| 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 Presentation* presentation = new Presentation(frame); | 23 Presentation* presentation = new Presentation(frame); |
| 24 PresentationController* controller = PresentationController::from(*frame); | 24 PresentationController* controller = PresentationController::from(*frame); |
| 25 ASSERT(controller); | 25 ASSERT(controller); |
| 26 controller->setPresentation(presentation); | 26 controller->setPresentation(presentation); |
| 27 | |
| 28 if (frame->settings() && frame->settings()->getPresentationReceiver()) { | |
|
mlamouri (slow - plz ping)
2017/04/10 12:50:28
Maybe add a comment explaining that this need to b
zhaobin
2017/04/10 21:05:59
Code removed.
| |
| 29 presentation->m_receiver = | |
| 30 new PresentationReceiver(frame, controller->client()); | |
| 31 } | |
| 27 return presentation; | 32 return presentation; |
| 28 } | 33 } |
| 29 | 34 |
| 30 DEFINE_TRACE(Presentation) { | 35 DEFINE_TRACE(Presentation) { |
| 31 visitor->trace(m_defaultRequest); | 36 visitor->trace(m_defaultRequest); |
| 32 visitor->trace(m_receiver); | 37 visitor->trace(m_receiver); |
| 33 ContextClient::trace(visitor); | 38 ContextClient::trace(visitor); |
| 34 } | 39 } |
| 35 | 40 |
| 36 PresentationRequest* Presentation::defaultRequest() const { | 41 PresentationRequest* Presentation::defaultRequest() const { |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 60 if (!m_receiver) { | 65 if (!m_receiver) { |
| 61 PresentationController* controller = PresentationController::from(*frame()); | 66 PresentationController* controller = PresentationController::from(*frame()); |
| 62 auto* client = controller ? controller->client() : nullptr; | 67 auto* client = controller ? controller->client() : nullptr; |
| 63 m_receiver = new PresentationReceiver(frame(), client); | 68 m_receiver = new PresentationReceiver(frame(), client); |
| 64 } | 69 } |
| 65 | 70 |
| 66 return m_receiver; | 71 return m_receiver; |
| 67 } | 72 } |
| 68 | 73 |
| 69 } // namespace blink | 74 } // namespace blink |
| OLD | NEW |