From 49c33c2ddfe099c027bd76a172c65e28f1442bfb Mon Sep 17 00:00:00 2001
From: "isherman@chromium.org"
 <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Sat, 10 Mar 2012 00:34:48 +0000
Subject: Revert 125950 - 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

TBR=erg@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9667017

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125958 0039d316-1c4b-4281-b951-d872f2087c98
---
 ui/gfx/screen.h       |  4 +--
 ui/gfx/screen_ash.cc  | 79 --------------------------------------------------
 ui/gfx/screen_aura.cc | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 82 insertions(+), 81 deletions(-)
 delete mode 100644 ui/gfx/screen_ash.cc
 create mode 100644 ui/gfx/screen_aura.cc

(limited to 'ui/gfx')

diff --git a/ui/gfx/screen.h b/ui/gfx/screen.h
index a451130..cd363b3 100644
--- a/ui/gfx/screen.h
+++ b/ui/gfx/screen.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
 
@@ -20,7 +20,7 @@ class UI_EXPORT Screen {
  public:
   virtual ~Screen() {}
 
-#if defined(USE_ASH)
+#if defined(USE_AURA)
   // Sets the instance to use. This takes owernship of |screen|, deleting the
   // old instance. This is used on aura to avoid circular dependencies between
   // ui and aura.
diff --git a/ui/gfx/screen_ash.cc b/ui/gfx/screen_ash.cc
deleted file mode 100644
index 9df6b84..0000000
--- a/ui/gfx/screen_ash.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-// 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/gfx/screen.h"
-
-#include "base/logging.h"
-#include "ui/gfx/native_widget_types.h"
-
-namespace gfx {
-
-// gfx can't depend upon ash, otherwise we have circular dependencies. So,
-// gfx::Screen is pluggable and Desktop plugs in the real implementation.
-
-// static
-Screen* Screen::instance_ = NULL;
-
-// static
-void Screen::SetInstance(Screen* screen) {
-  delete instance_;
-  instance_ = screen;
-}
-
-// static
-gfx::Point Screen::GetCursorScreenPoint() {
-  return instance_->GetCursorScreenPointImpl();
-}
-
-// static
-gfx::Rect Screen::GetMonitorWorkAreaNearestWindow(gfx::NativeWindow window) {
-  return instance_->GetMonitorWorkAreaNearestWindowImpl(window);
-}
-
-// static
-gfx::Rect Screen::GetMonitorAreaNearestWindow(gfx::NativeWindow window) {
-  return instance_->GetMonitorAreaNearestWindowImpl(window);
-}
-
-// static
-gfx::Rect Screen::GetMonitorWorkAreaNearestPoint(const gfx::Point& point) {
-  return instance_->GetMonitorWorkAreaNearestPointImpl(point);
-}
-
-// static
-gfx::Rect Screen::GetMonitorAreaNearestPoint(const gfx::Point& point) {
-  return instance_->GetMonitorAreaNearestPointImpl(point);
-}
-
-// static
-gfx::Rect Screen::GetPrimaryMonitorWorkArea() {
-  return instance_->GetMonitorWorkAreaNearestPoint(gfx::Point());
-}
-
-// static
-gfx::Rect Screen::GetPrimaryMonitorBounds() {
-  return instance_->GetMonitorAreaNearestPoint(gfx::Point());
-}
-
-// static
-gfx::Rect Screen::GetMonitorWorkAreaMatching(const gfx::Rect& match_rect) {
-  return instance_->GetMonitorWorkAreaNearestPoint(gfx::Point());
-}
-
-// static
-gfx::NativeWindow Screen::GetWindowAtCursorScreenPoint() {
-  return instance_->GetWindowAtCursorScreenPointImpl();
-}
-
-// static
-gfx::Size Screen::GetPrimaryMonitorSize() {
-  return instance_->GetPrimaryMonitorSizeImpl();
-}
-
-// static
-int Screen::GetNumMonitors() {
-  return instance_->GetNumMonitorsImpl();
-}
-
-}  // namespace gfx
diff --git a/ui/gfx/screen_aura.cc b/ui/gfx/screen_aura.cc
new file mode 100644
index 0000000..ea4216f
--- /dev/null
+++ b/ui/gfx/screen_aura.cc
@@ -0,0 +1,80 @@
+// Copyright (c) 2011 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/gfx/screen.h"
+
+#include "base/logging.h"
+#include "ui/gfx/native_widget_types.h"
+
+namespace gfx {
+
+// gfx can't depend upon aura, otherwise we have circular dependencies. So,
+// gfx::Screen is pluggable for aura and Desktop plugs in the real
+// implementation.
+
+// static
+Screen* Screen::instance_ = NULL;
+
+// static
+void Screen::SetInstance(Screen* screen) {
+  delete instance_;
+  instance_ = screen;
+}
+
+// static
+gfx::Point Screen::GetCursorScreenPoint() {
+  return instance_->GetCursorScreenPointImpl();
+}
+
+// static
+gfx::Rect Screen::GetMonitorWorkAreaNearestWindow(gfx::NativeWindow window) {
+  return instance_->GetMonitorWorkAreaNearestWindowImpl(window);
+}
+
+// static
+gfx::Rect Screen::GetMonitorAreaNearestWindow(gfx::NativeWindow window) {
+  return instance_->GetMonitorAreaNearestWindowImpl(window);
+}
+
+// static
+gfx::Rect Screen::GetMonitorWorkAreaNearestPoint(const gfx::Point& point) {
+  return instance_->GetMonitorWorkAreaNearestPointImpl(point);
+}
+
+// static
+gfx::Rect Screen::GetMonitorAreaNearestPoint(const gfx::Point& point) {
+  return instance_->GetMonitorAreaNearestPointImpl(point);
+}
+
+// static
+gfx::Rect Screen::GetPrimaryMonitorWorkArea() {
+  return instance_->GetMonitorWorkAreaNearestPoint(gfx::Point());
+}
+
+// static
+gfx::Rect Screen::GetPrimaryMonitorBounds() {
+  return instance_->GetMonitorAreaNearestPoint(gfx::Point());
+}
+
+// static
+gfx::Rect Screen::GetMonitorWorkAreaMatching(const gfx::Rect& match_rect) {
+  return instance_->GetMonitorWorkAreaNearestPoint(gfx::Point());
+}
+
+// static
+gfx::NativeWindow Screen::GetWindowAtCursorScreenPoint() {
+  return instance_->GetWindowAtCursorScreenPointImpl();
+}
+
+// static
+gfx::Size Screen::GetPrimaryMonitorSize() {
+  return instance_->GetPrimaryMonitorSizeImpl();
+}
+
+// static
+int Screen::GetNumMonitors() {
+  return instance_->GetNumMonitorsImpl();
+}
+
+}  // namespace gfx
-- 
cgit v1.1