| 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" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 if (!frame()) | 41 if (!frame()) |
| 42 return; | 42 return; |
| 43 | 43 |
| 44 PresentationController* controller = PresentationController::from(*frame()); | 44 PresentationController* controller = PresentationController::from(*frame()); |
| 45 if (!controller) | 45 if (!controller) |
| 46 return; | 46 return; |
| 47 controller->setDefaultRequestUrl(request ? request->url() : KURL()); | 47 controller->setDefaultRequestUrl(request ? request->url() : KURL()); |
| 48 } | 48 } |
| 49 | 49 |
| 50 PresentationReceiver* Presentation::receiver() { | 50 PresentationReceiver* Presentation::receiver() { |
| 51 PresentationController* controller = PresentationController::from(*frame()); | 51 if (!frame()) |
| 52 auto* client = controller ? controller->client() : nullptr; | 52 return nullptr; |
| 53 // TODO(crbug.com/647296): only return something if the Blink instance is | 53 // TODO(crbug.com/647296): only return something if the Blink instance is |
| 54 // running in presentation receiver mode. The flag PresentationReceiver could | 54 // running in presentation receiver mode. The flag PresentationReceiver could |
| 55 // be used for that. | 55 // be used for that. |
| 56 if (!m_receiver) | 56 if (!m_receiver) { |
| 57 PresentationController* controller = PresentationController::from(*frame()); |
| 58 auto* client = controller ? controller->client() : nullptr; |
| 57 m_receiver = new PresentationReceiver(frame(), client); | 59 m_receiver = new PresentationReceiver(frame(), client); |
| 60 } |
| 58 return m_receiver; | 61 return m_receiver; |
| 59 } | 62 } |
| 60 | 63 |
| 61 } // namespace blink | 64 } // namespace blink |
| OLD | NEW |