Index: ash/mus/window_manager.cc |
diff --git a/ash/mus/window_manager.cc b/ash/mus/window_manager.cc |
index dbeae2c6a94fbe51e536b708ce68e972bd47c6e2..0b7c4ae2559f3628ffeca62d90d2bc94bec47ec0 100644 |
--- a/ash/mus/window_manager.cc |
+++ b/ash/mus/window_manager.cc |
@@ -155,6 +155,10 @@ void WindowManager::Init( |
shell_delegate_ = std::move(shell_delegate); |
} |
+void WindowManager::SetLostConnectionCallback(base::OnceClosure closure) { |
+ lost_connection_callback_ = std::move(closure); |
+} |
+ |
bool WindowManager::WaitForInitialDisplays() { |
return window_manager_client_->WaitForInitialDisplays(); |
} |
@@ -309,6 +313,10 @@ void WindowManager::OnEmbedRootDestroyed( |
void WindowManager::OnLostConnection(aura::WindowTreeClient* client) { |
DCHECK_EQ(client, window_tree_client_.get()); |
+ if (!lost_connection_callback_.is_null()) { |
+ base::ResetAndReturn(&lost_connection_callback_).Run(); |
+ return; |
+ } |
Shutdown(); |
// TODO(sky): this case should trigger shutting down WindowManagerApplication |
// too. |