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/shell.h" | 5 #include "ash/shell.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/accelerators/accelerator_controller.h" | 10 #include "ash/accelerators/accelerator_controller.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 return shell->scoped_target_root_window_; | 216 return shell->scoped_target_root_window_; |
217 return shell->target_root_window_; | 217 return shell->target_root_window_; |
218 } | 218 } |
219 | 219 |
220 // static | 220 // static |
221 gfx::Screen* Shell::GetScreen() { | 221 gfx::Screen* Shell::GetScreen() { |
222 return gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_ALTERNATE); | 222 return gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_ALTERNATE); |
223 } | 223 } |
224 | 224 |
225 // static | 225 // static |
226 aura::Window::Windows Shell::GetAllRootWindows() { | 226 Shell::RootWindowList Shell::GetAllRootWindows() { |
227 return Shell::GetInstance()->display_controller()-> | 227 return Shell::GetInstance()->display_controller()-> |
228 GetAllRootWindows(); | 228 GetAllRootWindows(); |
229 } | 229 } |
230 | 230 |
231 // static | 231 // static |
232 aura::Window* Shell::GetContainer(aura::Window* root_window, | 232 aura::Window* Shell::GetContainer(aura::Window* root_window, |
233 int container_id) { | 233 int container_id) { |
234 return root_window->GetChildById(container_id); | 234 return root_window->GetChildById(container_id); |
235 } | 235 } |
236 | 236 |
237 // static | 237 // static |
238 const aura::Window* Shell::GetContainer(const aura::Window* root_window, | 238 const aura::Window* Shell::GetContainer(const aura::Window* root_window, |
239 int container_id) { | 239 int container_id) { |
240 return root_window->GetChildById(container_id); | 240 return root_window->GetChildById(container_id); |
241 } | 241 } |
242 | 242 |
243 // static | 243 // static |
244 std::vector<aura::Window*> Shell::GetContainersFromAllRootWindows( | 244 std::vector<aura::Window*> Shell::GetContainersFromAllRootWindows( |
245 int container_id, | 245 int container_id, |
246 aura::Window* priority_root) { | 246 aura::Window* priority_root) { |
247 std::vector<aura::Window*> containers; | 247 std::vector<aura::Window*> containers; |
248 aura::Window::Windows root_windows = GetAllRootWindows(); | 248 RootWindowList root_windows = GetAllRootWindows(); |
249 for (aura::Window::Windows::const_iterator it = root_windows.begin(); | 249 for (RootWindowList::const_iterator it = root_windows.begin(); |
250 it != root_windows.end(); ++it) { | 250 it != root_windows.end(); ++it) { |
251 aura::Window* container = (*it)->GetChildById(container_id); | 251 aura::Window* container = (*it)->GetChildById(container_id); |
252 if (container) { | 252 if (container) { |
253 if (priority_root && priority_root->Contains(container)) | 253 if (priority_root && priority_root->Contains(container)) |
254 containers.insert(containers.begin(), container); | 254 containers.insert(containers.begin(), container); |
255 else | 255 else |
256 containers.push_back(container); | 256 containers.push_back(container); |
257 } | 257 } |
258 } | 258 } |
259 return containers; | 259 return containers; |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 //////////////////////////////////////////////////////////////////////////////// | 997 //////////////////////////////////////////////////////////////////////////////// |
998 // Shell, aura::client::ActivationChangeObserver implementation: | 998 // Shell, aura::client::ActivationChangeObserver implementation: |
999 | 999 |
1000 void Shell::OnWindowActivated(aura::Window* gained_active, | 1000 void Shell::OnWindowActivated(aura::Window* gained_active, |
1001 aura::Window* lost_active) { | 1001 aura::Window* lost_active) { |
1002 if (gained_active) | 1002 if (gained_active) |
1003 target_root_window_ = gained_active->GetRootWindow(); | 1003 target_root_window_ = gained_active->GetRootWindow(); |
1004 } | 1004 } |
1005 | 1005 |
1006 } // namespace ash | 1006 } // namespace ash |
OLD | NEW |