| 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 377e3453e7efabe0f73ecf9a788cf05d4b7b5d71..064ca77f6fc9d46be41fcadaf19854aa6685c8a3 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.GetFrame() || !document.GetFrame()->DomWindow())
|
| + return nullptr;
|
| + Navigator& navigator = *document.GetFrame()->DomWindow()->navigator();
|
| + Presentation* presentation = NavigatorPresentation::presentation(navigator);
|
| + if (!presentation)
|
| + return nullptr;
|
| +
|
| + return presentation->receiver();
|
| +}
|
| +
|
| ScriptPromise PresentationReceiver::connectionList(ScriptState* script_state) {
|
| if (!connection_list_property_)
|
| connection_list_property_ =
|
|
|