Chromium Code Reviews| 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 d7b86b576b1fde3121a28145f635e76542ed0e9a..1ad2467e0744c087555b254a686cb161aee3d1a0 100644 |
| --- a/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp |
| +++ b/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp |
| @@ -9,6 +9,7 @@ |
| #include "core/dom/DOMException.h" |
| #include "core/dom/Document.h" |
| #include "core/dom/ExceptionCode.h" |
| +#include "core/frame/DOMWindow.h" |
| #include "core/frame/LocalFrame.h" |
| #include "modules/presentation/PresentationConnection.h" |
| #include "modules/presentation/PresentationConnectionList.h" |
| @@ -59,6 +60,29 @@ void PresentationReceiver::onReceiverConnectionAvailable( |
| m_connectionList->dispatchConnectionAvailableEvent(connection); |
| } |
| +void PresentationReceiver::didChangeSessionState( |
| + WebPresentationConnectionState state) { |
| + DCHECK(state == WebPresentationConnectionState::Terminated); |
|
imcheng
2016/11/28 22:12:01
Is this temporary? Please add a TODO if so
zhaobin
2017/02/16 00:42:30
Done.
|
| + |
| + for (auto connection : m_connectionList->connections()) |
| + connection->didChangeState(state); |
|
imcheng
2016/11/28 22:12:01
will you also need to close the window if the conn
zhaobin
2017/02/16 00:42:30
No. This is invoked when destroying receiver frame
|
| +} |
| + |
| +void PresentationReceiver::closeWindow() { |
| + if (!frame()) |
| + return; |
| + |
| + DOMWindow* window = frame()->domWindow(); |
| + if (!window || window->closed()) |
| + return; |
| + |
| + Document* document = frame()->document(); |
| + if (!document) |
|
haraken
2016/11/29 02:15:50
This check won't be needed. You can pass in nullpt
zhaobin
2017/02/16 00:42:30
Done.
|
| + return; |
| + |
| + window->close(document); |
| +} |
| + |
| void PresentationReceiver::registerConnection( |
| PresentationConnection* connection) { |
| DCHECK(m_connectionList); |