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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 aura::RootWindow* Shell::GetPrimaryRootWindow() { | 325 aura::RootWindow* Shell::GetPrimaryRootWindow() { |
326 return GetInstance()->display_controller()->GetPrimaryRootWindow(); | 326 return GetInstance()->display_controller()->GetPrimaryRootWindow(); |
327 } | 327 } |
328 | 328 |
329 // static | 329 // static |
330 aura::RootWindow* Shell::GetActiveRootWindow() { | 330 aura::RootWindow* Shell::GetActiveRootWindow() { |
331 return GetInstance()->active_root_window_; | 331 return GetInstance()->active_root_window_; |
332 } | 332 } |
333 | 333 |
334 // static | 334 // static |
335 aura::RootWindow* Shell::GetRootWindowAt(const gfx::Point& point) { | |
336 const gfx::Display& display = gfx::Screen::GetDisplayNearestPoint(point); | |
337 return Shell::GetInstance()->display_controller()-> | |
338 GetRootWindowForDisplayId(display.id()); | |
339 } | |
340 | |
341 // static | |
342 aura::RootWindow* Shell::GetRootWindowMatching(const gfx::Rect& rect) { | |
343 const gfx::Display& display = gfx::Screen::GetDisplayMatching(rect); | |
344 return Shell::GetInstance()->display_controller()-> | |
345 GetRootWindowForDisplayId(display.id()); | |
346 } | |
347 | |
348 // static | |
349 Shell::RootWindowList Shell::GetAllRootWindows() { | 335 Shell::RootWindowList Shell::GetAllRootWindows() { |
350 return Shell::GetInstance()->display_controller()-> | 336 return Shell::GetInstance()->display_controller()-> |
351 GetAllRootWindows(); | 337 GetAllRootWindows(); |
352 } | 338 } |
353 | 339 |
354 // static | 340 // static |
355 aura::Window* Shell::GetContainer(aura::RootWindow* root_window, | 341 aura::Window* Shell::GetContainer(aura::RootWindow* root_window, |
356 int container_id) { | 342 int container_id) { |
357 return root_window->GetChildById(container_id); | 343 return root_window->GetChildById(container_id); |
358 } | 344 } |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 } | 773 } |
788 | 774 |
789 void Shell::ShowCursor(bool visible) { | 775 void Shell::ShowCursor(bool visible) { |
790 RootWindowList root_windows = GetAllRootWindows(); | 776 RootWindowList root_windows = GetAllRootWindows(); |
791 for (RootWindowList::iterator iter = root_windows.begin(); | 777 for (RootWindowList::iterator iter = root_windows.begin(); |
792 iter != root_windows.end(); ++iter) | 778 iter != root_windows.end(); ++iter) |
793 (*iter)->ShowCursor(visible); | 779 (*iter)->ShowCursor(visible); |
794 } | 780 } |
795 | 781 |
796 } // namespace ash | 782 } // namespace ash |
OLD | NEW |