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

Unified Diff: ash/display/window_tree_host_manager.cc

Issue 2870253006: Fix WindowTreeHostManager::GetPrimaryRootWindow. (Closed)
Patch Set: Reset primary_tree_host_for_replace_. Created 3 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/window_tree_host_manager.cc
diff --git a/ash/display/window_tree_host_manager.cc b/ash/display/window_tree_host_manager.cc
index 358804ac0280a7b0ccecc20b30e24cb3c0b74b49..b562c761315c556838ff12ffd4b825157d70b1b7 100644
--- a/ash/display/window_tree_host_manager.cc
+++ b/ash/display/window_tree_host_manager.cc
@@ -328,6 +328,10 @@ int64_t WindowTreeHostManager::GetPrimaryDisplayId() {
}
aura::Window* WindowTreeHostManager::GetPrimaryRootWindow() {
+ // If |primary_tree_host_for_replace_| is set, it means |primary_display_id|
+ // is kInvalidDisplayId.
+ if (primary_tree_host_for_replace_)
+ return GetWindow(primary_tree_host_for_replace_);
return GetRootWindowForDisplayId(primary_display_id);
}
@@ -633,6 +637,8 @@ void WindowTreeHostManager::DeleteHost(AshWindowTreeHost* host_to_delete) {
// Delete most of root window related objects, but don't delete
// root window itself yet because the stack may be using it.
controller->Shutdown();
+ if (primary_tree_host_for_replace_ == host_to_delete)
+ primary_tree_host_for_replace_ = nullptr;
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, controller);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698