OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/common/wm/container_finder.h" | 5 #include "ash/common/wm/container_finder.h" |
6 | 6 |
7 #include "ash/common/session/session_state_delegate.h" | 7 #include "ash/common/session/session_state_delegate.h" |
8 #include "ash/common/wm/always_on_top_controller.h" | 8 #include "ash/common/wm/always_on_top_controller.h" |
9 #include "ash/common/wm/root_window_finder.h" | 9 #include "ash/common/wm/root_window_finder.h" |
10 #include "ash/common/wm/window_state.h" | 10 #include "ash/common/wm/window_state.h" |
11 #include "ash/common/wm_shell.h" | 11 #include "ash/common/wm_shell.h" |
12 #include "ash/common/wm_window.h" | 12 #include "ash/common/wm_window.h" |
13 #include "ash/public/cpp/shell_window_ids.h" | 13 #include "ash/public/cpp/shell_window_ids.h" |
14 #include "ash/public/cpp/window_properties.h" | 14 #include "ash/public/cpp/window_properties.h" |
15 #include "ash/root_window_controller.h" | 15 #include "ash/root_window_controller.h" |
16 #include "ash/shell.h" | 16 #include "ash/shell.h" |
| 17 #include "ui/aura/window.h" |
17 #include "ui/gfx/geometry/rect.h" | 18 #include "ui/gfx/geometry/rect.h" |
18 | 19 |
19 namespace ash { | 20 namespace ash { |
20 namespace wm { | 21 namespace wm { |
21 namespace { | 22 namespace { |
22 | 23 |
23 WmWindow* FindContainerRoot(const gfx::Rect& bounds) { | 24 WmWindow* FindContainerRoot(const gfx::Rect& bounds) { |
24 if (bounds == gfx::Rect()) | 25 if (bounds == gfx::Rect()) |
25 return Shell::GetWmRootWindowForNewWindows(); | 26 return Shell::GetWmRootWindowForNewWindows(); |
26 return GetRootWindowMatching(bounds); | 27 return GetRootWindowMatching(bounds); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 return target_root->GetChildByShellWindowId( | 104 return target_root->GetChildByShellWindowId( |
104 kShellWindowId_DragImageAndTooltipContainer); | 105 kShellWindowId_DragImageAndTooltipContainer); |
105 default: | 106 default: |
106 NOTREACHED() << "Window " << window->GetShellWindowId() | 107 NOTREACHED() << "Window " << window->GetShellWindowId() |
107 << " has unhandled type " << window->GetType(); | 108 << " has unhandled type " << window->GetType(); |
108 break; | 109 break; |
109 } | 110 } |
110 return nullptr; | 111 return nullptr; |
111 } | 112 } |
112 | 113 |
113 std::vector<WmWindow*> GetContainersFromAllRootWindows( | 114 aura::Window::Windows GetContainersFromAllRootWindows( |
114 int container_id, | 115 int container_id, |
115 WmWindow* priority_root) { | 116 aura::Window* priority_root) { |
116 std::vector<WmWindow*> containers; | 117 aura::Window::Windows containers; |
117 for (WmWindow* root : WmShell::Get()->GetAllRootWindows()) { | 118 for (aura::Window* root : Shell::GetAllRootWindows()) { |
118 WmWindow* container = root->GetChildByShellWindowId(container_id); | 119 aura::Window* container = root->GetChildById(container_id); |
119 if (!container) | 120 if (!container) |
120 continue; | 121 continue; |
121 | 122 |
122 if (priority_root && priority_root->Contains(container)) | 123 if (priority_root && priority_root->Contains(container)) |
123 containers.insert(containers.begin(), container); | 124 containers.insert(containers.begin(), container); |
124 else | 125 else |
125 containers.push_back(container); | 126 containers.push_back(container); |
126 } | 127 } |
127 return containers; | 128 return containers; |
128 } | 129 } |
129 | 130 |
130 } // namespace wm | 131 } // namespace wm |
131 } // namespace ash | 132 } // namespace ash |
OLD | NEW |