summaryrefslogtreecommitdiffstats
path: root/ui/aura/test/test_screen.cc
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-13 21:09:17 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-13 21:09:17 +0000
commit1a2145b860591d2e868ab98147ea4f162636d7eb (patch)
tree26a65524e4698ffc4b76eeb3409bbd0fca2ae238 /ui/aura/test/test_screen.cc
parent73238e09cc56e8b1b599ec978bec7bdd7a7730a8 (diff)
downloadchromium_src-1a2145b860591d2e868ab98147ea4f162636d7eb.zip
chromium_src-1a2145b860591d2e868ab98147ea4f162636d7eb.tar.gz
chromium_src-1a2145b860591d2e868ab98147ea4f162636d7eb.tar.bz2
Recommit r125950, which was reverted by r125958 due to link failures on win_aura bot.
Aura/Ash split: Move ScreenAura to aura::RootWindowScreen. What is now aura::RootWindowScreen was tightly bundled with aura::RootWindow. Instead of moving it to ash::ScreenAsh, I renamed it aurea::RootWindowScreen because there's a bunch of unit tests that use RootWindow as if it were the desktop. Screen integration stuff has been moved out of RootWindow (and related observers) and into ash::Shell. BUG=116458 First Review URL: http://codereview.chromium.org/9616045 Review URL: http://codereview.chromium.org/9696008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126464 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/test/test_screen.cc')
-rw-r--r--ui/aura/test/test_screen.cc61
1 files changed, 61 insertions, 0 deletions
diff --git a/ui/aura/test/test_screen.cc b/ui/aura/test/test_screen.cc
new file mode 100644
index 0000000..e61db9f
--- /dev/null
+++ b/ui/aura/test/test_screen.cc
@@ -0,0 +1,61 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/aura/test/test_screen.h"
+
+#include "base/logging.h"
+#include "ui/aura/root_window.h"
+#include "ui/aura/window.h"
+#include "ui/gfx/native_widget_types.h"
+
+namespace aura {
+
+TestScreen::TestScreen(aura::RootWindow* root_window)
+ : root_window_(root_window) {
+}
+
+TestScreen::~TestScreen() {
+}
+
+gfx::Point TestScreen::GetCursorScreenPointImpl() {
+ 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::Rect TestScreen::GetMonitorAreaNearestPointImpl(const gfx::Point& point) {
+ return GetBounds();
+}
+
+gfx::NativeWindow TestScreen::GetWindowAtCursorScreenPointImpl() {
+ const gfx::Point point = GetCursorScreenPoint();
+ return root_window_->GetTopWindowContainingPoint(point);
+}
+
+gfx::Rect TestScreen::GetBounds() {
+ return gfx::Rect(root_window_->bounds().size());
+}
+
+gfx::Size TestScreen::GetPrimaryMonitorSizeImpl() {
+ return GetBounds().size();
+}
+
+int TestScreen::GetNumMonitorsImpl() {
+ return 1;
+}
+
+} // namespace aura