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 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "ui/aura/window_observer.h" | 9 #include "ui/aura/window_observer.h" |
10 #include "ui/gfx/display.h" | 10 #include "ui/gfx/display.h" |
11 #include "ui/gfx/screen.h" | 11 #include "ui/gfx/screen.h" |
12 | 12 |
13 namespace gfx { | 13 namespace gfx { |
14 class Rect; | 14 class Rect; |
15 class Transform; | 15 class Transform; |
16 } | 16 } |
17 | 17 |
18 namespace aura { | 18 namespace aura { |
19 class Window; | 19 class Window; |
20 class WindowTreeHost; | 20 class WindowTreeHost; |
21 | 21 |
22 // A minimal, testing Aura implementation of gfx::Screen. | 22 // A minimal, testing Aura implementation of gfx::Screen. |
23 class TestScreen : public gfx::Screen, | 23 class TestScreen : public gfx::Screen, |
24 public WindowObserver { | 24 public WindowObserver { |
25 public: | 25 public: |
26 static TestScreen* Create(); | 26 // Creates a gfx::Screen of the specified size. If no size is specified, then |
| 27 // creates a 800x600 screen. |size| is in physical pixels. |
| 28 static TestScreen* Create(const gfx::Size& size); |
27 // Creates a TestScreen that uses fullscreen for the display. | 29 // Creates a TestScreen that uses fullscreen for the display. |
28 static TestScreen* CreateFullscreen(); | 30 static TestScreen* CreateFullscreen(); |
29 virtual ~TestScreen(); | 31 virtual ~TestScreen(); |
30 | 32 |
31 WindowTreeHost* CreateHostForPrimaryDisplay(); | 33 WindowTreeHost* CreateHostForPrimaryDisplay(); |
32 | 34 |
33 void SetDeviceScaleFactor(float device_scale_fator); | 35 void SetDeviceScaleFactor(float device_scale_fator); |
34 void SetDisplayRotation(gfx::Display::Rotation rotation); | 36 void SetDisplayRotation(gfx::Display::Rotation rotation); |
35 void SetUIScale(float ui_scale); | 37 void SetUIScale(float ui_scale); |
36 | 38 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 gfx::Display display_; | 72 gfx::Display display_; |
71 | 73 |
72 float ui_scale_; | 74 float ui_scale_; |
73 | 75 |
74 DISALLOW_COPY_AND_ASSIGN(TestScreen); | 76 DISALLOW_COPY_AND_ASSIGN(TestScreen); |
75 }; | 77 }; |
76 | 78 |
77 } // namespace aura | 79 } // namespace aura |
78 | 80 |
79 #endif // UI_AURA_TEST_TEST_SCREEN_H_ | 81 #endif // UI_AURA_TEST_TEST_SCREEN_H_ |
OLD | NEW |