| 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/wm/window_cycle_controller.h" | 5 #include "ash/wm/window_cycle_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/shell_delegate.h" | 9 #include "ash/shell_delegate.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 } | 86 } |
| 87 | 87 |
| 88 // Adds all the children of |window| to |windows|. | 88 // Adds all the children of |window| to |windows|. |
| 89 void AddAllChildren(aura::Window* window, | 89 void AddAllChildren(aura::Window* window, |
| 90 WindowCycleList::WindowList* windows) { | 90 WindowCycleList::WindowList* windows) { |
| 91 const WindowCycleList::WindowList& children(window->children()); | 91 const WindowCycleList::WindowList& children(window->children()); |
| 92 windows->insert(windows->end(), children.begin(), children.end()); | 92 windows->insert(windows->end(), children.begin(), children.end()); |
| 93 } | 93 } |
| 94 | 94 |
| 95 // Adds all the children of all of |window|s children to |windows|. | 95 // Adds all the children of all of |window|s children to |windows|. |
| 96 void AddWorkspace2Children(aura::Window* window, | 96 void AddWorkspaceChildren(aura::Window* window, |
| 97 WindowCycleList::WindowList* windows) { | 97 WindowCycleList::WindowList* windows) { |
| 98 for (size_t i = 0; i < window->children().size(); ++i) | 98 for (size_t i = 0; i < window->children().size(); ++i) |
| 99 AddAllChildren(window->children()[i], windows); | 99 AddAllChildren(window->children()[i], windows); |
| 100 } | 100 } |
| 101 | 101 |
| 102 // Adds the windows that can be cycled through for the specified window id to | 102 // Adds the windows that can be cycled through for the specified window id to |
| 103 // |windows|. | 103 // |windows|. |
| 104 void AddCycleWindows(aura::RootWindow* root, | 104 void AddCycleWindows(aura::RootWindow* root, |
| 105 int container_id, | 105 int container_id, |
| 106 WindowCycleList::WindowList* windows) { | 106 WindowCycleList::WindowList* windows) { |
| 107 aura::Window* container = Shell::GetContainer(root, container_id); | 107 aura::Window* container = Shell::GetContainer(root, container_id); |
| 108 if (container_id == internal::kShellWindowId_DefaultContainer) | 108 if (container_id == internal::kShellWindowId_DefaultContainer) |
| 109 AddWorkspace2Children(container, windows); | 109 AddWorkspaceChildren(container, windows); |
| 110 else | 110 else |
| 111 AddAllChildren(container, windows); | 111 AddAllChildren(container, windows); |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace | 114 } // namespace |
| 115 | 115 |
| 116 ////////////////////////////////////////////////////////////////////////////// | 116 ////////////////////////////////////////////////////////////////////////////// |
| 117 // WindowCycleController, public: | 117 // WindowCycleController, public: |
| 118 | 118 |
| 119 WindowCycleController::WindowCycleController( | 119 WindowCycleController::WindowCycleController( |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 mru_windows_.remove(window); | 312 mru_windows_.remove(window); |
| 313 if (window->id() == internal::kShellWindowId_WorkspaceContainer) | 313 if (window->id() == internal::kShellWindowId_WorkspaceContainer) |
| 314 window->RemoveObserver(this); | 314 window->RemoveObserver(this); |
| 315 } | 315 } |
| 316 | 316 |
| 317 void WindowCycleController::OnWindowDestroying(aura::Window* window) { | 317 void WindowCycleController::OnWindowDestroying(aura::Window* window) { |
| 318 window->RemoveObserver(this); | 318 window->RemoveObserver(this); |
| 319 } | 319 } |
| 320 | 320 |
| 321 } // namespace ash | 321 } // namespace ash |
| OLD | NEW |