Index: ash/screen_ash.cc |
diff --git a/ash/screen_ash.cc b/ash/screen_ash.cc |
index ad679a15615b645dd62882635741f37f52b2bd96..98a9f3cfb1c3a6f7093aed8ea03ba98188de511f 100644 |
--- a/ash/screen_ash.cc |
+++ b/ash/screen_ash.cc |
@@ -8,16 +8,13 @@ |
#include "ash/wm/shelf_layout_manager.h" |
#include "base/logging.h" |
#include "ui/aura/env.h" |
-#include "ui/aura/monitor.h" |
#include "ui/aura/monitor_manager.h" |
#include "ui/aura/root_window.h" |
+#include "ui/gfx/monitor.h" |
+#include "ui/gfx/screen.h" |
namespace ash { |
-// TODO(oshima): For m19, the origin of work area/monitor bounds for |
-// views/aura is (0,0) because it's simple and enough. Fix this when |
-// real multi monitor support is implemented. |
- |
namespace { |
aura::MonitorManager* GetMonitorManager() { |
return aura::Env::GetInstance()->monitor_manager(); |
@@ -41,45 +38,41 @@ gfx::Rect ScreenAsh::GetUnmaximizedWorkAreaBounds(aura::Window* window) { |
return Shell::GetInstance()->shelf()->GetUnmaximizedWorkAreaBounds(window); |
} |
-gfx::Point ScreenAsh::GetCursorScreenPointImpl() { |
+gfx::Point ScreenAsh::GetCursorScreenPoint() { |
return root_window_->last_mouse_location(); |
} |
-gfx::Rect ScreenAsh::GetMonitorWorkAreaNearestWindowImpl( |
- gfx::NativeWindow window) { |
- return GetMonitorManager()->GetMonitorNearestWindow(window)-> |
- GetWorkAreaBounds(); |
-} |
- |
-gfx::Rect ScreenAsh::GetMonitorAreaNearestWindowImpl( |
- gfx::NativeWindow window) { |
- // See the comment at the top. |
- return gfx::Rect( |
- GetMonitorManager()->GetMonitorNearestWindow(window)->size()); |
+gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPoint() { |
+ const gfx::Point point = gfx::Screen::GetCursorScreenPoint(); |
+ return root_window_->GetTopWindowContainingPoint(point); |
} |
-gfx::Rect ScreenAsh::GetMonitorWorkAreaNearestPointImpl( |
- const gfx::Point& point) { |
- return GetMonitorManager()->GetMonitorNearestPoint(point)-> |
- GetWorkAreaBounds(); |
+int ScreenAsh::GetNumMonitors() { |
+ return GetMonitorManager()->GetNumMonitors(); |
} |
-gfx::Rect ScreenAsh::GetMonitorAreaNearestPointImpl(const gfx::Point& point) { |
- // See the comment at the top. |
- return gfx::Rect(GetMonitorManager()->GetMonitorNearestPoint(point)->size()); |
-} |
-gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPointImpl() { |
- const gfx::Point point = GetCursorScreenPoint(); |
- return root_window_->GetTopWindowContainingPoint(point); |
+gfx::Monitor ScreenAsh::GetMonitorNearestWindow(gfx::NativeView window) const { |
+ gfx::Monitor monitor = GetMonitorManager()->GetMonitorNearestWindow(window); |
+ // TODO(oshima): For m19, work area/monitor bounds that chrome/webapps sees |
+ // has (0, 0) origin because it's simpler and enough. Fix this when |
+ // real multi monitor support is implemented. |
+ monitor.SetBoundsAndUpdateWorkArea(gfx::Rect(monitor.size())); |
+ return monitor; |
} |
-gfx::Size ScreenAsh::GetPrimaryMonitorSizeImpl() { |
- return GetMonitorManager()->GetMonitorAt(0)->size(); |
+gfx::Monitor ScreenAsh::GetMonitorNearestPoint(const gfx::Point& point) const { |
+ gfx::Monitor monitor = GetMonitorManager()->GetMonitorNearestPoint(point); |
+ // See comment above. |
+ monitor.SetBoundsAndUpdateWorkArea(gfx::Rect(monitor.size())); |
+ return monitor; |
} |
-int ScreenAsh::GetNumMonitorsImpl() { |
- return GetMonitorManager()->GetNumMonitors(); |
+gfx::Monitor ScreenAsh::GetPrimaryMonitor() const { |
+ gfx::Monitor monitor = GetMonitorManager()->GetMonitorAt(0); |
+ // See comment above. |
+ monitor.SetBoundsAndUpdateWorkArea(gfx::Rect(monitor.size())); |
+ return monitor; |
} |
} // namespace ash |