Chromium Code Reviews| 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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 530 if (animating_wallpaper_widget_controller()) { | 530 if (animating_wallpaper_widget_controller()) { |
| 531 WallpaperWidgetController* controller = | 531 WallpaperWidgetController* controller = |
| 532 animating_wallpaper_widget_controller()->GetController(true); | 532 animating_wallpaper_widget_controller()->GetController(true); |
| 533 DCHECK_EQ(controller->widget(), widget); | 533 DCHECK_EQ(controller->widget(), widget); |
| 534 // Release the old controller and close its wallpaper widget. | 534 // Release the old controller and close its wallpaper widget. |
| 535 SetWallpaperWidgetController(controller); | 535 SetWallpaperWidgetController(controller); |
| 536 } | 536 } |
| 537 } | 537 } |
| 538 | 538 |
| 539 void RootWindowController::CloseChildWindows() { | 539 void RootWindowController::CloseChildWindows() { |
| 540 aura::Window* root_window = GetRootWindow(); | |
| 541 aura::client::SetDragDropClient(root_window, nullptr); | |
| 542 aura::client::SetTooltipClient(root_window, nullptr); | |
| 543 | |
| 540 mouse_event_target_.reset(); | 544 mouse_event_target_.reset(); |
| 541 | 545 |
| 542 // Remove observer as deactivating keyboard causes |docked_layout_manager_| | 546 // Remove observer as deactivating keyboard causes |docked_layout_manager_| |
| 543 // to fire notifications. | 547 // to fire notifications. |
| 544 if (docked_layout_manager_ && wm_shelf_aura_->shelf_layout_manager()) { | 548 if (docked_layout_manager_ && wm_shelf_aura_->shelf_layout_manager()) { |
| 545 docked_layout_manager_->RemoveObserver( | 549 docked_layout_manager_->RemoveObserver( |
| 546 wm_shelf_aura_->shelf_layout_manager()); | 550 wm_shelf_aura_->shelf_layout_manager()); |
| 547 } | 551 } |
| 548 | 552 |
| 549 // Deactivate keyboard container before closing child windows and shutting | 553 // Deactivate keyboard container before closing child windows and shutting |
| 550 // down associated layout managers. | 554 // down associated layout managers. |
| 551 DeactivateKeyboard(keyboard::KeyboardController::GetInstance()); | 555 DeactivateKeyboard(keyboard::KeyboardController::GetInstance()); |
| 552 | 556 |
| 553 // panel_layout_manager_ needs to be shut down before windows are destroyed. | 557 // panel_layout_manager_ needs to be shut down before windows are destroyed. |
| 554 if (panel_layout_manager_) { | 558 if (panel_layout_manager_) { |
| 555 panel_layout_manager_->Shutdown(); | 559 panel_layout_manager_->Shutdown(); |
| 556 panel_layout_manager_ = NULL; | 560 panel_layout_manager_ = NULL; |
| 557 } | 561 } |
| 558 // docked_layout_manager_ needs to be shut down before windows are destroyed. | 562 // docked_layout_manager_ needs to be shut down before windows are destroyed. |
| 559 if (docked_layout_manager_) { | 563 if (docked_layout_manager_) { |
| 560 docked_layout_manager_->Shutdown(); | 564 docked_layout_manager_->Shutdown(); |
| 561 docked_layout_manager_ = NULL; | 565 docked_layout_manager_ = NULL; |
| 562 } | 566 } |
| 563 aura::Window* root_window = GetRootWindow(); | |
| 564 aura::client::SetDragDropClient(root_window, NULL); | |
| 565 | |
| 566 wm_shelf_aura_->ShutdownShelfWidget(); | 567 wm_shelf_aura_->ShutdownShelfWidget(); |
| 567 | 568 |
| 568 // Close wallpaper widget first as it depends on tooltip. | 569 // Close wallpaper widget first as it depends on tooltip. |
|
James Cook
2016/09/07 21:41:45
This comment seems concerning. If it's no longer t
sky
2016/09/07 22:02:27
Good point. I moved to end. Take another look?
| |
| 569 wallpaper_widget_controller_.reset(); | 570 wallpaper_widget_controller_.reset(); |
| 570 animating_wallpaper_widget_controller_.reset(); | 571 animating_wallpaper_widget_controller_.reset(); |
| 571 | 572 |
| 572 wm_root_window_controller_->DeleteWorkspaceController(); | 573 wm_root_window_controller_->DeleteWorkspaceController(); |
| 573 aura::client::SetTooltipClient(root_window, NULL); | |
| 574 | 574 |
| 575 // Explicitly destroy top level windows. We do this as during part of | 575 // Explicitly destroy top level windows. We do this as during part of |
| 576 // destruction such windows may query the RootWindow for state. | 576 // destruction such windows may query the RootWindow for state. |
| 577 aura::WindowTracker non_toplevel_windows; | 577 aura::WindowTracker non_toplevel_windows; |
| 578 non_toplevel_windows.Add(root_window); | 578 non_toplevel_windows.Add(root_window); |
| 579 while (!non_toplevel_windows.windows().empty()) { | 579 while (!non_toplevel_windows.windows().empty()) { |
| 580 const aura::Window* non_toplevel_window = | 580 const aura::Window* non_toplevel_window = |
| 581 *non_toplevel_windows.windows().begin(); | 581 *non_toplevel_windows.windows().begin(); |
| 582 non_toplevel_windows.Remove(const_cast<aura::Window*>(non_toplevel_window)); | 582 non_toplevel_windows.Remove(const_cast<aura::Window*>(non_toplevel_window)); |
| 583 aura::WindowTracker toplevel_windows; | 583 aura::WindowTracker toplevel_windows; |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 950 aura::Window* primary_root_window = Shell::GetInstance() | 950 aura::Window* primary_root_window = Shell::GetInstance() |
| 951 ->window_tree_host_manager() | 951 ->window_tree_host_manager() |
| 952 ->GetPrimaryRootWindow(); | 952 ->GetPrimaryRootWindow(); |
| 953 return GetRootWindowSettings(primary_root_window)->controller; | 953 return GetRootWindowSettings(primary_root_window)->controller; |
| 954 } | 954 } |
| 955 | 955 |
| 956 return GetRootWindowSettings(root_window)->controller; | 956 return GetRootWindowSettings(root_window)->controller; |
| 957 } | 957 } |
| 958 | 958 |
| 959 } // namespace ash | 959 } // namespace ash |
| OLD | NEW |