| 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/screen_ash.h" | 5 #include "ash/screen_ash.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/wm/shelf_layout_manager.h" | 8 #include "ash/wm/shelf_layout_manager.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
| 11 #include "ui/aura/monitor_manager.h" | 11 #include "ui/aura/monitor_manager.h" |
| 12 #include "ui/aura/root_window.h" | 12 #include "ui/aura/root_window.h" |
| 13 #include "ui/gfx/monitor.h" | 13 #include "ui/gfx/display.h" |
| 14 #include "ui/gfx/screen.h" | 14 #include "ui/gfx/screen.h" |
| 15 | 15 |
| 16 namespace ash { | 16 namespace ash { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 aura::MonitorManager* GetMonitorManager() { | 19 aura::MonitorManager* GetMonitorManager() { |
| 20 return aura::Env::GetInstance()->monitor_manager(); | 20 return aura::Env::GetInstance()->monitor_manager(); |
| 21 } | 21 } |
| 22 } // namespace | 22 } // namespace |
| 23 | 23 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 51 gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPoint() { | 51 gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPoint() { |
| 52 const gfx::Point point = gfx::Screen::GetCursorScreenPoint(); | 52 const gfx::Point point = gfx::Screen::GetCursorScreenPoint(); |
| 53 // TODO(oshima): convert point to relateive to the root window. | 53 // TODO(oshima): convert point to relateive to the root window. |
| 54 return Shell::GetRootWindowAt(point)->GetTopWindowContainingPoint(point); | 54 return Shell::GetRootWindowAt(point)->GetTopWindowContainingPoint(point); |
| 55 } | 55 } |
| 56 | 56 |
| 57 int ScreenAsh::GetNumMonitors() { | 57 int ScreenAsh::GetNumMonitors() { |
| 58 return GetMonitorManager()->GetNumMonitors(); | 58 return GetMonitorManager()->GetNumMonitors(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 gfx::Monitor ScreenAsh::GetMonitorNearestWindow(gfx::NativeView window) const { | 61 gfx::Display ScreenAsh::GetMonitorNearestWindow(gfx::NativeView window) const { |
| 62 return GetMonitorManager()->GetMonitorNearestWindow(window); | 62 return GetMonitorManager()->GetMonitorNearestWindow(window); |
| 63 } | 63 } |
| 64 | 64 |
| 65 gfx::Monitor ScreenAsh::GetMonitorNearestPoint(const gfx::Point& point) const { | 65 gfx::Display ScreenAsh::GetMonitorNearestPoint(const gfx::Point& point) const { |
| 66 return GetMonitorManager()->GetMonitorNearestPoint(point); | 66 return GetMonitorManager()->GetMonitorNearestPoint(point); |
| 67 } | 67 } |
| 68 | 68 |
| 69 gfx::Monitor ScreenAsh::GetPrimaryMonitor() const { | 69 gfx::Display ScreenAsh::GetPrimaryMonitor() const { |
| 70 return GetMonitorManager()->GetMonitorAt(0); | 70 return GetMonitorManager()->GetMonitorAt(0); |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace ash | 73 } // namespace ash |
| OLD | NEW |