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

Unified Diff: ash/root_window_controller.cc

Issue 2194353002: mash: Migrate ScopedTargetRootWindow to //ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: non-virtual Created 4 years, 4 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/bridge/wm_shell_mus.cc ('k') | ash/scoped_target_root_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/root_window_controller.cc
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 5e1931688c206cab0594f50177b2070f0171780f..780401a2a5cc1a68b96c4f5449c3d268c2186606 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -386,15 +386,18 @@ void RootWindowController::Shutdown() {
wallpaper_controller_.reset();
animating_wallpaper_controller_.reset();
aura::Window* root_window = GetRootWindow();
- Shell* shell = Shell::GetInstance();
+ WmWindow* root_shutting_down = WmWindowAura::Get(root_window);
+ WmShell* shell = WmShell::Get();
// Change the target root window before closing child windows. If any child
// being removed triggers a relayout of the shelf it will try to build a
// window list adding windows from the target root window's containers which
// may have already gone away.
- if (Shell::GetTargetRootWindow() == root_window) {
- shell->set_target_root_window(Shell::GetPrimaryRootWindow() == root_window
- ? NULL
- : Shell::GetPrimaryRootWindow());
+ if (shell->GetRootWindowForNewWindows() == root_shutting_down) {
+ // The root window for new windows is being destroyed. Switch to the primary
+ // root window if possible.
+ WmWindow* primary_root = shell->GetPrimaryRootWindow();
+ shell->set_root_window_for_new_windows(
+ primary_root == root_shutting_down ? nullptr : primary_root);
}
CloseChildWindows();
« no previous file with comments | « ash/mus/bridge/wm_shell_mus.cc ('k') | ash/scoped_target_root_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698