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 "modules/presentation/PresentationController.h" | 9 #include "modules/presentation/PresentationController.h" |
| 10 #include "modules/presentation/PresentationReceiver.h" | 10 #include "modules/presentation/PresentationReceiver.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 return; | 49 return; |
| 50 | 50 |
| 51 PresentationController* controller = PresentationController::from(*frame()); | 51 PresentationController* controller = PresentationController::from(*frame()); |
| 52 if (!controller) | 52 if (!controller) |
| 53 return; | 53 return; |
| 54 controller->setDefaultRequestUrl(request ? request->url() : KURL()); | 54 controller->setDefaultRequestUrl(request ? request->url() : KURL()); |
| 55 } | 55 } |
| 56 | 56 |
| 57 PresentationReceiver* Presentation::receiver() | 57 PresentationReceiver* Presentation::receiver() |
| 58 { | 58 { |
| 59 PresentationController* controller = PresentationController::from(*frame()); | |
| 60 auto client = controller ? controller->client() : nullptr; | |
|
mark a. foltz
2016/09/15 16:53:18
It looks like this can only be nullptr if Presenta
zhaobin
2016/09/15 18:56:03
Acknowledged.
| |
| 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. |
|
mark a. foltz
2016/09/15 16:53:18
We need to actually do this to match spec; navigat
zhaobin
2016/09/15 18:56:03
Done.
| |
| 62 if (!m_receiver) | 64 if (!m_receiver) |
| 63 m_receiver = new PresentationReceiver(frame()); | 65 m_receiver = new PresentationReceiver(frame(), client); |
| 64 return m_receiver; | 66 return m_receiver; |
| 65 } | 67 } |
| 66 | 68 |
| 67 } // namespace blink | 69 } // namespace blink |
| OLD | NEW |