Index: ash/screen_ash.cc |
diff --git a/ash/screen_ash.cc b/ash/screen_ash.cc |
index ad679a15615b645dd62882635741f37f52b2bd96..f72ed7c0fdb4d6f5dd7ceef8e630ce633aaa90fc 100644 |
--- a/ash/screen_ash.cc |
+++ b/ash/screen_ash.cc |
@@ -8,16 +8,12 @@ |
#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_aura.h" |
#include "ui/aura/monitor_manager.h" |
#include "ui/aura/root_window.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 +37,39 @@ 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::NativeWindow ScreenAsh::GetWindowAtCursorScreenPoint() { |
+ const gfx::Point point = gfx::Screen::GetCursorScreenPoint(); |
+ return root_window_->GetTopWindowContainingPoint(point); |
} |
-gfx::Rect ScreenAsh::GetMonitorAreaNearestWindowImpl( |
- gfx::NativeWindow window) { |
- // See the comment at the top. |
- return gfx::Rect( |
- GetMonitorManager()->GetMonitorNearestWindow(window)->size()); |
+int ScreenAsh::GetNumMonitors() { |
+ return GetMonitorManager()->GetNumMonitors(); |
} |
-gfx::Rect ScreenAsh::GetMonitorWorkAreaNearestPointImpl( |
- const gfx::Point& point) { |
- return GetMonitorManager()->GetMonitorNearestPoint(point)-> |
- GetWorkAreaBounds(); |
+const gfx::Monitor* ScreenAsh::GetMonitorNearestWindow( |
+ gfx::NativeWindow window) { |
+ return GetMonitorManager()->GetMonitorNearestWindow(window); |
} |
-gfx::Rect ScreenAsh::GetMonitorAreaNearestPointImpl(const gfx::Point& point) { |
- // See the comment at the top. |
- return gfx::Rect(GetMonitorManager()->GetMonitorNearestPoint(point)->size()); |
+const gfx::Monitor* ScreenAsh::GetMonitorNearestPoint( |
+ const gfx::Point& point) { |
+ return GetMonitorManager()->GetMonitorNearestPoint(point); |
} |
-gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPointImpl() { |
- const gfx::Point point = GetCursorScreenPoint(); |
- return root_window_->GetTopWindowContainingPoint(point); |
+const gfx::Monitor* ScreenAsh::GetPrimaryMonitor() { |
+ return GetMonitorManager()->GetMonitorAt(0); |
} |
-gfx::Size ScreenAsh::GetPrimaryMonitorSizeImpl() { |
- return GetMonitorManager()->GetMonitorAt(0)->size(); |
+void ScreenAsh::AddMonitorObserver(gfx::MonitorObserver* observer) { |
+ return GetMonitorManager()->AddObserver(observer); |
} |
-int ScreenAsh::GetNumMonitorsImpl() { |
- return GetMonitorManager()->GetNumMonitors(); |
+void ScreenAsh::RemoveMonitorObserver(gfx::MonitorObserver* observer) { |
+ return GetMonitorManager()->RemoveObserver(observer); |
} |
} // namespace ash |