| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 return shell->scoped_target_root_window_; | 215 return shell->scoped_target_root_window_; |
| 216 return shell->target_root_window_; | 216 return shell->target_root_window_; |
| 217 } | 217 } |
| 218 | 218 |
| 219 // static | 219 // static |
| 220 gfx::Screen* Shell::GetScreen() { | 220 gfx::Screen* Shell::GetScreen() { |
| 221 return gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_ALTERNATE); | 221 return gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_ALTERNATE); |
| 222 } | 222 } |
| 223 | 223 |
| 224 // static | 224 // static |
| 225 Shell::RootWindowList Shell::GetAllRootWindows() { | 225 aura::Window::Windows Shell::GetAllRootWindows() { |
| 226 return Shell::GetInstance()->display_controller()-> | 226 return Shell::GetInstance()->display_controller()-> |
| 227 GetAllRootWindows(); | 227 GetAllRootWindows(); |
| 228 } | 228 } |
| 229 | 229 |
| 230 // static | 230 // static |
| 231 aura::Window* Shell::GetContainer(aura::Window* root_window, | 231 aura::Window* Shell::GetContainer(aura::Window* root_window, |
| 232 int container_id) { | 232 int container_id) { |
| 233 return root_window->GetChildById(container_id); | 233 return root_window->GetChildById(container_id); |
| 234 } | 234 } |
| 235 | 235 |
| 236 // static | 236 // static |
| 237 const aura::Window* Shell::GetContainer(const aura::Window* root_window, | 237 const aura::Window* Shell::GetContainer(const aura::Window* root_window, |
| 238 int container_id) { | 238 int container_id) { |
| 239 return root_window->GetChildById(container_id); | 239 return root_window->GetChildById(container_id); |
| 240 } | 240 } |
| 241 | 241 |
| 242 // static | 242 // static |
| 243 std::vector<aura::Window*> Shell::GetContainersFromAllRootWindows( | 243 std::vector<aura::Window*> Shell::GetContainersFromAllRootWindows( |
| 244 int container_id, | 244 int container_id, |
| 245 aura::Window* priority_root) { | 245 aura::Window* priority_root) { |
| 246 std::vector<aura::Window*> containers; | 246 std::vector<aura::Window*> containers; |
| 247 RootWindowList root_windows = GetAllRootWindows(); | 247 aura::Window::Windows root_windows = GetAllRootWindows(); |
| 248 for (RootWindowList::const_iterator it = root_windows.begin(); | 248 for (aura::Window::Windows::const_iterator it = root_windows.begin(); |
| 249 it != root_windows.end(); ++it) { | 249 it != root_windows.end(); ++it) { |
| 250 aura::Window* container = (*it)->GetChildById(container_id); | 250 aura::Window* container = (*it)->GetChildById(container_id); |
| 251 if (container) { | 251 if (container) { |
| 252 if (priority_root && priority_root->Contains(container)) | 252 if (priority_root && priority_root->Contains(container)) |
| 253 containers.insert(containers.begin(), container); | 253 containers.insert(containers.begin(), container); |
| 254 else | 254 else |
| 255 containers.push_back(container); | 255 containers.push_back(container); |
| 256 } | 256 } |
| 257 } | 257 } |
| 258 return containers; | 258 return containers; |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 //////////////////////////////////////////////////////////////////////////////// | 989 //////////////////////////////////////////////////////////////////////////////// |
| 990 // Shell, aura::client::ActivationChangeObserver implementation: | 990 // Shell, aura::client::ActivationChangeObserver implementation: |
| 991 | 991 |
| 992 void Shell::OnWindowActivated(aura::Window* gained_active, | 992 void Shell::OnWindowActivated(aura::Window* gained_active, |
| 993 aura::Window* lost_active) { | 993 aura::Window* lost_active) { |
| 994 if (gained_active) | 994 if (gained_active) |
| 995 target_root_window_ = gained_active->GetRootWindow(); | 995 target_root_window_ = gained_active->GetRootWindow(); |
| 996 } | 996 } |
| 997 | 997 |
| 998 } // namespace ash | 998 } // namespace ash |
| OLD | NEW |