| 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 "modules/presentation/PresentationController.h" | 9 #include "modules/presentation/PresentationController.h" |
| 10 #include "modules/presentation/PresentationReceiver.h" | 10 #include "modules/presentation/PresentationReceiver.h" |
| 11 #include "modules/presentation/PresentationRequest.h" | 11 #include "modules/presentation/PresentationRequest.h" |
| 12 #include "platform/weborigin/KURL.h" |
| 13 #include "wtf/Vector.h" |
| 12 | 14 |
| 13 namespace blink { | 15 namespace blink { |
| 14 | 16 |
| 15 Presentation::Presentation(LocalFrame* frame) | 17 Presentation::Presentation(LocalFrame* frame) |
| 16 : DOMWindowProperty(frame) | 18 : DOMWindowProperty(frame) |
| 17 { | 19 { |
| 18 } | 20 } |
| 19 | 21 |
| 20 // static | 22 // static |
| 21 Presentation* Presentation::create(LocalFrame* frame) | 23 Presentation* Presentation::create(LocalFrame* frame) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 44 void Presentation::setDefaultRequest(PresentationRequest* request) | 46 void Presentation::setDefaultRequest(PresentationRequest* request) |
| 45 { | 47 { |
| 46 m_defaultRequest = request; | 48 m_defaultRequest = request; |
| 47 | 49 |
| 48 if (!frame()) | 50 if (!frame()) |
| 49 return; | 51 return; |
| 50 | 52 |
| 51 PresentationController* controller = PresentationController::from(*frame()); | 53 PresentationController* controller = PresentationController::from(*frame()); |
| 52 if (!controller) | 54 if (!controller) |
| 53 return; | 55 return; |
| 54 controller->setDefaultRequestUrl(request ? request->url() : KURL()); | 56 controller->setDefaultRequestUrls(request ? request->urls() : WTF::Vector<KU
RL>()); |
| 55 } | 57 } |
| 56 | 58 |
| 57 PresentationReceiver* Presentation::receiver() | 59 PresentationReceiver* Presentation::receiver() |
| 58 { | 60 { |
| 59 // TODO(mlamouri): only return something if the Blink instance is running in | 61 // TODO(mlamouri): only return something if the Blink instance is running in |
| 60 // presentation receiver mode. The flag PresentationReceiver could be used | 62 // presentation receiver mode. The flag PresentationReceiver could be used |
| 61 // for that. | 63 // for that. |
| 62 if (!m_receiver) | 64 if (!m_receiver) |
| 63 m_receiver = new PresentationReceiver(frame()); | 65 m_receiver = new PresentationReceiver(frame()); |
| 64 return m_receiver; | 66 return m_receiver; |
| 65 } | 67 } |
| 66 | 68 |
| 67 } // namespace blink | 69 } // namespace blink |
| OLD | NEW |