Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2255)

Unified Diff: ash/mus/window_manager.cc

Issue 2846893004: chromeos: makes WindowManager not delete shell when connection to mus is lost (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/mus/window_manager.h ('k') | chrome/browser/ui/ash/ash_init.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « ash/mus/window_manager.h ('k') | chrome/browser/ui/ash/ash_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698