| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 docked_window_layout_manager_ = nullptr; | 590 docked_window_layout_manager_ = nullptr; |
| 591 } | 591 } |
| 592 | 592 |
| 593 WmShelf* shelf = GetShelf(); | 593 WmShelf* shelf = GetShelf(); |
| 594 shelf->ShutdownShelfWidget(); | 594 shelf->ShutdownShelfWidget(); |
| 595 | 595 |
| 596 workspace_controller_.reset(); | 596 workspace_controller_.reset(); |
| 597 | 597 |
| 598 // Explicitly destroy top level windows. We do this because such windows may | 598 // Explicitly destroy top level windows. We do this because such windows may |
| 599 // query the RootWindow for state. | 599 // query the RootWindow for state. |
| 600 WmWindowTracker non_toplevel_windows; | 600 aura::WindowTracker non_toplevel_windows; |
| 601 WmWindow* root = GetWindow(); | 601 WmWindow* root = GetWindow(); |
| 602 non_toplevel_windows.Add(root); | 602 non_toplevel_windows.Add(root->aura_window()); |
| 603 while (!non_toplevel_windows.windows().empty()) { | 603 while (!non_toplevel_windows.windows().empty()) { |
| 604 WmWindow* non_toplevel_window = non_toplevel_windows.Pop(); | 604 aura::Window* non_toplevel_window = non_toplevel_windows.Pop(); |
| 605 WmWindowTracker toplevel_windows; | 605 aura::WindowTracker toplevel_windows; |
| 606 for (WmWindow* child : non_toplevel_window->GetChildren()) { | 606 for (aura::Window* child : non_toplevel_window->children()) { |
| 607 if (!ShouldDestroyWindowInCloseChildWindows(child)) | 607 if (!ShouldDestroyWindowInCloseChildWindows(WmWindow::Get(child))) |
| 608 continue; | 608 continue; |
| 609 if (child->HasNonClientArea()) | 609 if (child->delegate()) |
| 610 toplevel_windows.Add(child); | 610 toplevel_windows.Add(child); |
| 611 else | 611 else |
| 612 non_toplevel_windows.Add(child); | 612 non_toplevel_windows.Add(child); |
| 613 } | 613 } |
| 614 while (!toplevel_windows.windows().empty()) | 614 while (!toplevel_windows.windows().empty()) |
| 615 toplevel_windows.Pop()->Destroy(); | 615 delete toplevel_windows.Pop(); |
| 616 } | 616 } |
| 617 // And then remove the containers. | 617 // And then remove the containers. |
| 618 while (!root->GetChildren().empty()) { | 618 while (!root->GetChildren().empty()) { |
| 619 WmWindow* child = root->GetChildren()[0]; | 619 WmWindow* child = root->GetChildren()[0]; |
| 620 if (ShouldDestroyWindowInCloseChildWindows(child)) | 620 if (ShouldDestroyWindowInCloseChildWindows(child)) |
| 621 child->Destroy(); | 621 child->Destroy(); |
| 622 else | 622 else |
| 623 root->RemoveChild(child); | 623 root->RemoveChild(child); |
| 624 } | 624 } |
| 625 | 625 |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 EnableTouchHudProjection(); | 1148 EnableTouchHudProjection(); |
| 1149 else | 1149 else |
| 1150 DisableTouchHudProjection(); | 1150 DisableTouchHudProjection(); |
| 1151 } | 1151 } |
| 1152 | 1152 |
| 1153 RootWindowController* GetRootWindowController(const aura::Window* root_window) { | 1153 RootWindowController* GetRootWindowController(const aura::Window* root_window) { |
| 1154 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; | 1154 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; |
| 1155 } | 1155 } |
| 1156 | 1156 |
| 1157 } // namespace ash | 1157 } // namespace ash |
| OLD | NEW |