| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_AURA_TEST_TEST_SCREEN_H_ | 5 #ifndef UI_AURA_TEST_TEST_SCREEN_H_ |
| 6 #define UI_AURA_TEST_TEST_SCREEN_H_ | 6 #define UI_AURA_TEST_TEST_SCREEN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "ui/gfx/insets.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "ui/gfx/screen.h" | 11 #include "ui/gfx/screen_impl.h" |
| 12 |
| 13 namespace gfx { |
| 14 class Monitor; |
| 15 } |
| 12 | 16 |
| 13 namespace aura { | 17 namespace aura { |
| 14 class RootWindow; | 18 class RootWindow; |
| 19 class MonitorAura; |
| 15 | 20 |
| 16 // A minimal, testing Aura implementation of gfx::Screen. | 21 // A minimal, testing Aura implementation of gfx::Screen. |
| 17 class TestScreen : public gfx::Screen { | 22 class TestScreen : public gfx::ScreenImpl { |
| 18 public: | 23 public: |
| 19 explicit TestScreen(aura::RootWindow* root_window); | 24 explicit TestScreen(aura::RootWindow* root_window); |
| 20 virtual ~TestScreen(); | 25 virtual ~TestScreen(); |
| 21 | 26 |
| 22 protected: | 27 protected: |
| 23 virtual gfx::Point GetCursorScreenPointImpl() OVERRIDE; | 28 // gfx::ScreenImpl overrides: |
| 24 virtual gfx::Rect GetMonitorWorkAreaNearestWindowImpl( | 29 virtual gfx::Point GetCursorScreenPoint() OVERRIDE; |
| 25 gfx::NativeView view) OVERRIDE; | 30 virtual gfx::NativeWindow GetWindowAtCursorScreenPoint() OVERRIDE; |
| 26 virtual gfx::Rect GetMonitorAreaNearestWindowImpl( | 31 virtual int GetNumMonitors() OVERRIDE; |
| 27 gfx::NativeView view) OVERRIDE; | 32 virtual void GetMonitorNearestWindow( |
| 28 virtual gfx::Rect GetMonitorWorkAreaNearestPointImpl( | 33 gfx::NativeView view, gfx::Monitor* monitor_out) const OVERRIDE; |
| 29 const gfx::Point& point) OVERRIDE; | 34 virtual void GetMonitorNearestPoint( |
| 30 virtual gfx::Rect GetMonitorAreaNearestPointImpl( | 35 const gfx::Point& point, gfx::Monitor* monitor_out) const OVERRIDE; |
| 31 const gfx::Point& point) OVERRIDE; | 36 virtual void GetPrimaryMonitor(gfx::Monitor* monitor_out) const OVERRIDE; |
| 32 virtual gfx::NativeWindow GetWindowAtCursorScreenPointImpl() OVERRIDE; | |
| 33 virtual gfx::Size GetPrimaryMonitorSizeImpl() OVERRIDE; | |
| 34 virtual int GetNumMonitorsImpl() OVERRIDE; | |
| 35 | 37 |
| 36 private: | 38 private: |
| 37 // We currently support only one monitor. These two methods return the bounds | 39 void CopyTo(gfx::Monitor* monitor_out) const; |
| 38 // and work area. | |
| 39 gfx::Rect GetBounds(); | |
| 40 | 40 |
| 41 aura::RootWindow* root_window_; | 41 aura::RootWindow* root_window_; |
| 42 | 42 |
| 43 // One monitor in testing environment. |
| 44 scoped_ptr<MonitorAura> monitor_; |
| 45 |
| 43 DISALLOW_COPY_AND_ASSIGN(TestScreen); | 46 DISALLOW_COPY_AND_ASSIGN(TestScreen); |
| 44 }; | 47 }; |
| 45 | 48 |
| 46 } // namespace aura | 49 } // namespace aura |
| 47 | 50 |
| 48 #endif // UI_AURA_TEST_TEST_SCREEN_H_ | 51 #endif // UI_AURA_TEST_TEST_SCREEN_H_ |
| OLD | NEW |