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 // TODO(mlamouri): only return something if the Blink instance is running in | 59 PresentationController* controller = PresentationController::from(*frame()); |
60 auto client = controller ? controller->client() : nullptr; | |
dcheng
2016/09/28 23:55:13
Nit: auto*
zhaobin
2016/09/29 18:38:53
Done.
| |
61 // TODO(crbug.com/647296): only return something if the Blink instance is ru nning 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(), client); |
64 return m_receiver; | 66 return m_receiver; |
65 } | 67 } |
66 | 68 |
67 } // namespace blink | 69 } // namespace blink |
OLD | NEW |