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 "base/memory/scoped_ptr.h" |
10 #include "ui/gfx/insets.h" | 11 #include "ui/gfx/insets.h" |
11 #include "ui/gfx/screen.h" | 12 #include "ui/gfx/screen.h" |
12 | 13 |
| 14 namespace gfx { |
| 15 class Monitor; |
| 16 } |
| 17 |
13 namespace aura { | 18 namespace aura { |
14 class RootWindow; | 19 class RootWindow; |
| 20 class MonitorAura; |
15 | 21 |
16 // A minimal, testing Aura implementation of gfx::Screen. | 22 // A minimal, testing Aura implementation of gfx::Screen. |
17 class TestScreen : public gfx::Screen { | 23 class TestScreen : public gfx::ScreenImpl { |
18 public: | 24 public: |
19 explicit TestScreen(aura::RootWindow* root_window); | 25 explicit TestScreen(aura::RootWindow* root_window); |
20 virtual ~TestScreen(); | 26 virtual ~TestScreen(); |
21 | 27 |
22 protected: | 28 protected: |
23 virtual gfx::Point GetCursorScreenPointImpl() OVERRIDE; | 29 // gfx::ScreenImpl overrides: |
24 virtual gfx::Rect GetMonitorWorkAreaNearestWindowImpl( | 30 virtual gfx::Point GetCursorScreenPoint() OVERRIDE; |
| 31 virtual gfx::NativeWindow GetWindowAtCursorScreenPoint() OVERRIDE; |
| 32 virtual int GetNumMonitors() OVERRIDE; |
| 33 virtual const gfx::Monitor* GetMonitorNearestWindow( |
25 gfx::NativeView view) OVERRIDE; | 34 gfx::NativeView view) OVERRIDE; |
26 virtual gfx::Rect GetMonitorAreaNearestWindowImpl( | 35 virtual const gfx::Monitor* GetMonitorNearestPoint( |
27 gfx::NativeView view) OVERRIDE; | |
28 virtual gfx::Rect GetMonitorWorkAreaNearestPointImpl( | |
29 const gfx::Point& point) OVERRIDE; | 36 const gfx::Point& point) OVERRIDE; |
30 virtual gfx::Rect GetMonitorAreaNearestPointImpl( | 37 virtual const gfx::Monitor* GetPrimaryMonitor() OVERRIDE; |
31 const gfx::Point& point) OVERRIDE; | 38 virtual void AddMonitorObserver(gfx::MonitorObserver* observer) OVERRIDE; |
32 virtual gfx::NativeWindow GetWindowAtCursorScreenPointImpl() OVERRIDE; | 39 virtual void RemoveMonitorObserver(gfx::MonitorObserver* observer) OVERRIDE; |
33 virtual gfx::Size GetPrimaryMonitorSizeImpl() OVERRIDE; | |
34 virtual int GetNumMonitorsImpl() OVERRIDE; | |
35 | 40 |
36 private: | 41 private: |
37 // We currently support only one monitor. These two methods return the bounds | 42 void Update(); |
38 // and work area. | |
39 gfx::Rect GetBounds(); | |
40 | 43 |
41 aura::RootWindow* root_window_; | 44 aura::RootWindow* root_window_; |
42 | 45 |
| 46 // One monitor in testing environment. |
| 47 scoped_ptr<MonitorAura> monitor_; |
| 48 |
43 DISALLOW_COPY_AND_ASSIGN(TestScreen); | 49 DISALLOW_COPY_AND_ASSIGN(TestScreen); |
44 }; | 50 }; |
45 | 51 |
46 } // namespace aura | 52 } // namespace aura |
47 | 53 |
48 #endif // UI_AURA_TEST_TEST_SCREEN_H_ | 54 #endif // UI_AURA_TEST_TEST_SCREEN_H_ |
OLD | NEW |