| 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" |
| 14 #include "wtf/Vector.h" |
| 13 | 15 |
| 14 namespace blink { | 16 namespace blink { |
| 15 | 17 |
| 16 Presentation::Presentation(LocalFrame* frame) : ContextClient(frame) {} | 18 Presentation::Presentation(LocalFrame* frame) : ContextClient(frame) {} |
| 17 | 19 |
| 18 // static | 20 // static |
| 19 Presentation* Presentation::create(LocalFrame* frame) { | 21 Presentation* Presentation::create(LocalFrame* frame) { |
| 20 ASSERT(frame); | 22 ASSERT(frame); |
| 21 | 23 |
| 22 Presentation* presentation = new Presentation(frame); | 24 Presentation* presentation = new Presentation(frame); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 38 | 40 |
| 39 void Presentation::setDefaultRequest(PresentationRequest* request) { | 41 void Presentation::setDefaultRequest(PresentationRequest* request) { |
| 40 m_defaultRequest = request; | 42 m_defaultRequest = request; |
| 41 | 43 |
| 42 if (!frame()) | 44 if (!frame()) |
| 43 return; | 45 return; |
| 44 | 46 |
| 45 PresentationController* controller = PresentationController::from(*frame()); | 47 PresentationController* controller = PresentationController::from(*frame()); |
| 46 if (!controller) | 48 if (!controller) |
| 47 return; | 49 return; |
| 48 controller->setDefaultRequestUrl(request ? request->url() : KURL()); | 50 controller->setDefaultRequestUrl(request ? request->urls() |
| 51 : WTF::Vector<KURL>()); |
| 49 } | 52 } |
| 50 | 53 |
| 51 PresentationReceiver* Presentation::receiver() { | 54 PresentationReceiver* Presentation::receiver() { |
| 52 if (!frame() || !frame()->settings()) | 55 if (!frame() || !frame()->settings()) |
| 53 return nullptr; | 56 return nullptr; |
| 54 | 57 |
| 55 if (!frame()->settings()->getPresentationReceiver()) | 58 if (!frame()->settings()->getPresentationReceiver()) |
| 56 return nullptr; | 59 return nullptr; |
| 57 | 60 |
| 58 if (!m_receiver) { | 61 if (!m_receiver) { |
| 59 PresentationController* controller = PresentationController::from(*frame()); | 62 PresentationController* controller = PresentationController::from(*frame()); |
| 60 auto* client = controller ? controller->client() : nullptr; | 63 auto* client = controller ? controller->client() : nullptr; |
| 61 m_receiver = new PresentationReceiver(frame(), client); | 64 m_receiver = new PresentationReceiver(frame(), client); |
| 62 } | 65 } |
| 63 | 66 |
| 64 return m_receiver; | 67 return m_receiver; |
| 65 } | 68 } |
| 66 | 69 |
| 67 } // namespace blink | 70 } // namespace blink |
| OLD | NEW |