Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Unified Diff: ui/aura/test/test_screen.cc

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/test/test_screen.h ('k') | ui/aura/window_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/test/test_screen.cc
diff --git a/ui/aura/test/test_screen.cc b/ui/aura/test/test_screen.cc
index e61db9fdcdc5ea8eb19f88072e052de29baa6297..d242d78e57742ae36c23b6395c30a9c86930ec36 100644
--- a/ui/aura/test/test_screen.cc
+++ b/ui/aura/test/test_screen.cc
@@ -8,6 +8,7 @@
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/gfx/screen.h"
namespace aura {
@@ -18,44 +19,34 @@ TestScreen::TestScreen(aura::RootWindow* root_window)
TestScreen::~TestScreen() {
}
-gfx::Point TestScreen::GetCursorScreenPointImpl() {
+gfx::Point TestScreen::GetCursorScreenPoint() {
return root_window_->last_mouse_location();
}
-gfx::Rect TestScreen::GetMonitorWorkAreaNearestWindowImpl(
- gfx::NativeWindow window) {
- return GetBounds();
-}
-
-gfx::Rect TestScreen::GetMonitorAreaNearestWindowImpl(
- gfx::NativeWindow window) {
- return GetBounds();
-}
-
-gfx::Rect TestScreen::GetMonitorWorkAreaNearestPointImpl(
- const gfx::Point& point) {
- return GetBounds();
+gfx::NativeWindow TestScreen::GetWindowAtCursorScreenPoint() {
+ const gfx::Point point = gfx::Screen::GetCursorScreenPoint();
+ return root_window_->GetTopWindowContainingPoint(point);
}
-gfx::Rect TestScreen::GetMonitorAreaNearestPointImpl(const gfx::Point& point) {
- return GetBounds();
+int TestScreen::GetNumMonitors() {
+ return 1;
}
-gfx::NativeWindow TestScreen::GetWindowAtCursorScreenPointImpl() {
- const gfx::Point point = GetCursorScreenPoint();
- return root_window_->GetTopWindowContainingPoint(point);
+gfx::Monitor TestScreen::GetMonitorNearestWindow(
+ gfx::NativeWindow window) const {
+ return GetMonitor();
}
-gfx::Rect TestScreen::GetBounds() {
- return gfx::Rect(root_window_->bounds().size());
+gfx::Monitor TestScreen::GetMonitorNearestPoint(const gfx::Point& point) const {
+ return GetMonitor();
}
-gfx::Size TestScreen::GetPrimaryMonitorSizeImpl() {
- return GetBounds().size();
+gfx::Monitor TestScreen::GetPrimaryMonitor() const {
+ return GetMonitor();
}
-int TestScreen::GetNumMonitorsImpl() {
- return 1;
+gfx::Monitor TestScreen::GetMonitor() const {
+ return gfx::Monitor(0, root_window_->bounds());
}
} // namespace aura
« no previous file with comments | « ui/aura/test/test_screen.h ('k') | ui/aura/window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698