| Index: third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp
|
| diff --git a/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp b/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp
|
| index a550625000760e567369809fb40e8603ad52bf97..aa8ce0984b61f487e704e8b68aa7f76810a65971 100644
|
| --- a/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp
|
| +++ b/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp
|
| @@ -11,7 +11,10 @@
|
| #include "core/dom/ExceptionCode.h"
|
| #include "core/frame/LocalDOMWindow.h"
|
| #include "core/frame/LocalFrame.h"
|
| +#include "core/frame/Navigator.h"
|
| #include "core/frame/UseCounter.h"
|
| +#include "modules/presentation/NavigatorPresentation.h"
|
| +#include "modules/presentation/Presentation.h"
|
| #include "modules/presentation/PresentationConnection.h"
|
| #include "modules/presentation/PresentationConnectionList.h"
|
| #include "public/platform/modules/presentation/WebPresentationClient.h"
|
| @@ -28,6 +31,18 @@ PresentationReceiver::PresentationReceiver(LocalFrame* frame,
|
| client->setReceiver(this);
|
| }
|
|
|
| +// static
|
| +PresentationReceiver* PresentationReceiver::from(Document& document) {
|
| + if (!document.frame() || !document.frame()->domWindow())
|
| + return nullptr;
|
| + Navigator& navigator = *document.frame()->domWindow()->navigator();
|
| + Presentation* presentation = NavigatorPresentation::presentation(navigator);
|
| + if (!presentation)
|
| + return nullptr;
|
| +
|
| + return presentation->receiver();
|
| +}
|
| +
|
| ScriptPromise PresentationReceiver::connectionList(ScriptState* scriptState) {
|
| if (!m_connectionListProperty)
|
| m_connectionListProperty =
|
|
|