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..226b43a5cae741b6f8358d3977476a8bfca60d22 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,20 @@ void PresentationReceiver::onReceiverConnectionAvailable( |
| m_connectionList->dispatchConnectionAvailableEvent(connection); |
| } |
| +void PresentationReceiver::didChangeSessionState( |
| + WebPresentationConnectionState state) { |
| + DCHECK(state == WebPresentationConnectionState::Terminated); |
| + |
| + for (auto connection : m_connectionList->connections()) |
| + connection->didChangeState(state); |
| +} |
| + |
| +void PresentationReceiver::closeWindow() { |
| + DOMWindow* window = frame()->domWindow(); |
| + if (!window->closed()) |
|
haraken
2016/11/08 23:44:50
You need to check if frame(), frame()->domWindow()
zhaobin
2016/11/09 03:40:12
Done.
|
| + window->close(frame()->document()); |
| +} |
| + |
| void PresentationReceiver::registerConnection( |
| PresentationConnection* connection) { |
| DCHECK(m_connectionList); |