| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/aura/aura_layout_manager_adapter.h" | 10 #include "ash/aura/aura_layout_manager_adapter.h" |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 if (touch_exploration_manager_) { | 379 if (touch_exploration_manager_) { |
| 380 touch_exploration_manager_.reset(); | 380 touch_exploration_manager_.reset(); |
| 381 } | 381 } |
| 382 #endif | 382 #endif |
| 383 | 383 |
| 384 if (animating_wallpaper_controller_.get()) | 384 if (animating_wallpaper_controller_.get()) |
| 385 animating_wallpaper_controller_->StopAnimating(); | 385 animating_wallpaper_controller_->StopAnimating(); |
| 386 wallpaper_controller_.reset(); | 386 wallpaper_controller_.reset(); |
| 387 animating_wallpaper_controller_.reset(); | 387 animating_wallpaper_controller_.reset(); |
| 388 aura::Window* root_window = GetRootWindow(); | 388 aura::Window* root_window = GetRootWindow(); |
| 389 Shell* shell = Shell::GetInstance(); | 389 WmWindow* root_shutting_down = WmWindowAura::Get(root_window); |
| 390 WmShell* shell = WmShell::Get(); |
| 390 // Change the target root window before closing child windows. If any child | 391 // Change the target root window before closing child windows. If any child |
| 391 // being removed triggers a relayout of the shelf it will try to build a | 392 // being removed triggers a relayout of the shelf it will try to build a |
| 392 // window list adding windows from the target root window's containers which | 393 // window list adding windows from the target root window's containers which |
| 393 // may have already gone away. | 394 // may have already gone away. |
| 394 if (Shell::GetTargetRootWindow() == root_window) { | 395 if (shell->GetRootWindowForNewWindows() == root_shutting_down) { |
| 395 shell->set_target_root_window(Shell::GetPrimaryRootWindow() == root_window | 396 // The root window for new windows is being destroyed. Switch to the primary |
| 396 ? NULL | 397 // root window if possible. |
| 397 : Shell::GetPrimaryRootWindow()); | 398 WmWindow* primary_root = shell->GetPrimaryRootWindow(); |
| 399 shell->set_root_window_for_new_windows( |
| 400 primary_root == root_shutting_down ? nullptr : primary_root); |
| 398 } | 401 } |
| 399 | 402 |
| 400 CloseChildWindows(); | 403 CloseChildWindows(); |
| 401 GetRootWindowSettings(root_window)->controller = NULL; | 404 GetRootWindowSettings(root_window)->controller = NULL; |
| 402 workspace_controller_.reset(); | 405 workspace_controller_.reset(); |
| 403 // Forget with the display ID so that display lookup | 406 // Forget with the display ID so that display lookup |
| 404 // ends up with invalid display. | 407 // ends up with invalid display. |
| 405 GetRootWindowSettings(root_window)->display_id = | 408 GetRootWindowSettings(root_window)->display_id = |
| 406 display::Display::kInvalidDisplayID; | 409 display::Display::kInvalidDisplayID; |
| 407 ash_host_->PrepareForShutdown(); | 410 ash_host_->PrepareForShutdown(); |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 aura::Window* primary_root_window = Shell::GetInstance() | 981 aura::Window* primary_root_window = Shell::GetInstance() |
| 979 ->window_tree_host_manager() | 982 ->window_tree_host_manager() |
| 980 ->GetPrimaryRootWindow(); | 983 ->GetPrimaryRootWindow(); |
| 981 return GetRootWindowSettings(primary_root_window)->controller; | 984 return GetRootWindowSettings(primary_root_window)->controller; |
| 982 } | 985 } |
| 983 | 986 |
| 984 return GetRootWindowSettings(root_window)->controller; | 987 return GetRootWindowSettings(root_window)->controller; |
| 985 } | 988 } |
| 986 | 989 |
| 987 } // namespace ash | 990 } // namespace ash |
| OLD | NEW |