| 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/display_manager.h" |
| 12 #include "ui/aura/root_window.h" | 12 #include "ui/aura/root_window.h" |
| 13 #include "ui/gfx/display.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::DisplayManager* GetDisplayManager() { |
| 20 return aura::Env::GetInstance()->monitor_manager(); | 20 return aura::Env::GetInstance()->display_manager(); |
| 21 } | 21 } |
| 22 } // namespace | 22 } // namespace |
| 23 | 23 |
| 24 ScreenAsh::ScreenAsh() { | 24 ScreenAsh::ScreenAsh() { |
| 25 } | 25 } |
| 26 | 26 |
| 27 ScreenAsh::~ScreenAsh() { | 27 ScreenAsh::~ScreenAsh() { |
| 28 } | 28 } |
| 29 | 29 |
| 30 // static | 30 // static |
| (...skipping 17 matching lines...) Expand all Loading... |
| 48 return Shell::GetPrimaryRootWindow()->last_mouse_location(); | 48 return Shell::GetPrimaryRootWindow()->last_mouse_location(); |
| 49 } | 49 } |
| 50 | 50 |
| 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::GetNumDisplays() { | 57 int ScreenAsh::GetNumDisplays() { |
| 58 return GetMonitorManager()->GetNumDisplays(); | 58 return GetDisplayManager()->GetNumDisplays(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const { | 61 gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const { |
| 62 return GetMonitorManager()->GetDisplayNearestWindow(window); | 62 return GetDisplayManager()->GetDisplayNearestWindow(window); |
| 63 } | 63 } |
| 64 | 64 |
| 65 gfx::Display ScreenAsh::GetDisplayNearestPoint(const gfx::Point& point) const { | 65 gfx::Display ScreenAsh::GetDisplayNearestPoint(const gfx::Point& point) const { |
| 66 return GetMonitorManager()->GetDisplayNearestPoint(point); | 66 return GetDisplayManager()->GetDisplayNearestPoint(point); |
| 67 } | 67 } |
| 68 | 68 |
| 69 gfx::Display ScreenAsh::GetPrimaryDisplay() const { | 69 gfx::Display ScreenAsh::GetPrimaryDisplay() const { |
| 70 return GetMonitorManager()->GetDisplayAt(0); | 70 return GetDisplayManager()->GetDisplayAt(0); |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace ash | 73 } // namespace ash |
| OLD | NEW |