| 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/focus_manager_factory.h" | 10 #include "ash/accelerators/focus_manager_factory.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 aura::RootWindow* Shell::GetPrimaryRootWindow() { | 327 aura::RootWindow* Shell::GetPrimaryRootWindow() { |
| 328 return GetInstance()->display_controller()->GetPrimaryRootWindow(); | 328 return GetInstance()->display_controller()->GetPrimaryRootWindow(); |
| 329 } | 329 } |
| 330 | 330 |
| 331 // static | 331 // static |
| 332 aura::RootWindow* Shell::GetActiveRootWindow() { | 332 aura::RootWindow* Shell::GetActiveRootWindow() { |
| 333 return GetInstance()->active_root_window_; | 333 return GetInstance()->active_root_window_; |
| 334 } | 334 } |
| 335 | 335 |
| 336 // static | 336 // static |
| 337 aura::RootWindow* Shell::GetRootWindowAt(const gfx::Point& point) { | |
| 338 const gfx::Display& display = gfx::Screen::GetDisplayNearestPoint(point); | |
| 339 return Shell::GetInstance()->display_controller()-> | |
| 340 GetRootWindowForDisplayId(display.id()); | |
| 341 } | |
| 342 | |
| 343 // static | |
| 344 aura::RootWindow* Shell::GetRootWindowMatching(const gfx::Rect& rect) { | |
| 345 const gfx::Display& display = gfx::Screen::GetDisplayMatching(rect); | |
| 346 return Shell::GetInstance()->display_controller()-> | |
| 347 GetRootWindowForDisplayId(display.id()); | |
| 348 } | |
| 349 | |
| 350 // static | |
| 351 Shell::RootWindowList Shell::GetAllRootWindows() { | 337 Shell::RootWindowList Shell::GetAllRootWindows() { |
| 352 return Shell::GetInstance()->display_controller()-> | 338 return Shell::GetInstance()->display_controller()-> |
| 353 GetAllRootWindows(); | 339 GetAllRootWindows(); |
| 354 } | 340 } |
| 355 | 341 |
| 356 // static | 342 // static |
| 357 aura::Window* Shell::GetContainer(aura::RootWindow* root_window, | 343 aura::Window* Shell::GetContainer(aura::RootWindow* root_window, |
| 358 int container_id) { | 344 int container_id) { |
| 359 return root_window->GetChildById(container_id); | 345 return root_window->GetChildById(container_id); |
| 360 } | 346 } |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 } | 779 } |
| 794 | 780 |
| 795 void Shell::ShowCursor(bool visible) { | 781 void Shell::ShowCursor(bool visible) { |
| 796 RootWindowList root_windows = GetAllRootWindows(); | 782 RootWindowList root_windows = GetAllRootWindows(); |
| 797 for (RootWindowList::iterator iter = root_windows.begin(); | 783 for (RootWindowList::iterator iter = root_windows.begin(); |
| 798 iter != root_windows.end(); ++iter) | 784 iter != root_windows.end(); ++iter) |
| 799 (*iter)->ShowCursor(visible); | 785 (*iter)->ShowCursor(visible); |
| 800 } | 786 } |
| 801 | 787 |
| 802 } // namespace ash | 788 } // namespace ash |
| OLD | NEW |