summaryrefslogtreecommitdiffstats
path: root/ash/screen_ash.cc
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-10 00:18:48 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-10 00:18:48 +0000
commit277a3bb5fd9196b3109d0e6ca2ba6a4ec43582b4 (patch)
tree94b10b9669fc76bc969be9709d3e2f4cb6b0dc80 /ash/screen_ash.cc
parent011352fdfe5524e72ea9aff9cc21b553ff4dc351 (diff)
downloadchromium_src-277a3bb5fd9196b3109d0e6ca2ba6a4ec43582b4.zip
chromium_src-277a3bb5fd9196b3109d0e6ca2ba6a4ec43582b4.tar.gz
chromium_src-277a3bb5fd9196b3109d0e6ca2ba6a4ec43582b4.tar.bz2
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 Review URL: http://codereview.chromium.org/9616045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125950 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/screen_ash.cc')
-rw-r--r--ash/screen_ash.cc67
1 files changed, 67 insertions, 0 deletions
diff --git a/ash/screen_ash.cc b/ash/screen_ash.cc
new file mode 100644
index 0000000..bbdf9e8
--- /dev/null
+++ b/ash/screen_ash.cc
@@ -0,0 +1,67 @@
+// 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 "ash/screen_ash.h"
+
+#include "base/logging.h"
+#include "ui/aura/root_window.h"
+#include "ui/aura/window.h"
+#include "ui/gfx/native_widget_types.h"
+
+namespace ash {
+
+ScreenAsh::ScreenAsh(aura::RootWindow* root_window)
+ : root_window_(root_window) {
+}
+
+ScreenAsh::~ScreenAsh() {
+}
+
+gfx::Point ScreenAsh::GetCursorScreenPointImpl() {
+ return root_window_->last_mouse_location();
+}
+
+gfx::Rect ScreenAsh::GetMonitorWorkAreaNearestWindowImpl(
+ gfx::NativeWindow window) {
+ return GetWorkAreaBounds();
+}
+
+gfx::Rect ScreenAsh::GetMonitorAreaNearestWindowImpl(
+ gfx::NativeWindow window) {
+ return GetBounds();
+}
+
+gfx::Rect ScreenAsh::GetMonitorWorkAreaNearestPointImpl(
+ const gfx::Point& point) {
+ return GetWorkAreaBounds();
+}
+
+gfx::Rect ScreenAsh::GetMonitorAreaNearestPointImpl(const gfx::Point& point) {
+ return GetBounds();
+}
+
+gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPointImpl() {
+ const gfx::Point point = GetCursorScreenPoint();
+ return root_window_->GetTopWindowContainingPoint(point);
+}
+
+gfx::Rect ScreenAsh::GetBounds() {
+ return gfx::Rect(root_window_->bounds().size());
+}
+
+gfx::Rect ScreenAsh::GetWorkAreaBounds() {
+ gfx::Rect bounds(GetBounds());
+ bounds.Inset(work_area_insets_);
+ return bounds;
+}
+
+gfx::Size ScreenAsh::GetPrimaryMonitorSizeImpl() {
+ return GetMonitorWorkAreaNearestPoint(gfx::Point()).size();
+}
+
+int ScreenAsh::GetNumMonitorsImpl() {
+ return 1;
+}
+
+} // namespace ash