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 ui { |
| 19 class ContextFactory; |
| 20 } |
| 21 |
18 namespace aura { | 22 namespace aura { |
19 class Window; | 23 class Window; |
20 class WindowTreeHost; | 24 class WindowTreeHost; |
21 | 25 |
22 // A minimal, testing Aura implementation of gfx::Screen. | 26 // A minimal, testing Aura implementation of gfx::Screen. |
23 class TestScreen : public gfx::Screen, | 27 class TestScreen : public gfx::Screen, |
24 public WindowObserver { | 28 public WindowObserver { |
25 public: | 29 public: |
26 static TestScreen* Create(); | 30 static TestScreen* Create(); |
27 // Creates a TestScreen that uses fullscreen for the display. | 31 // Creates a TestScreen that uses fullscreen for the display. |
28 static TestScreen* CreateFullscreen(); | 32 static TestScreen* CreateFullscreen(); |
29 virtual ~TestScreen(); | 33 virtual ~TestScreen(); |
30 | 34 |
31 WindowTreeHost* CreateHostForPrimaryDisplay(); | 35 WindowTreeHost* CreateHostForPrimaryDisplay( |
| 36 ui::ContextFactory* context_factory); |
32 | 37 |
33 void SetDeviceScaleFactor(float device_scale_fator); | 38 void SetDeviceScaleFactor(float device_scale_fator); |
34 void SetDisplayRotation(gfx::Display::Rotation rotation); | 39 void SetDisplayRotation(gfx::Display::Rotation rotation); |
35 void SetUIScale(float ui_scale); | 40 void SetUIScale(float ui_scale); |
36 | 41 |
37 protected: | 42 protected: |
38 gfx::Transform GetRotationTransform() const; | 43 gfx::Transform GetRotationTransform() const; |
39 gfx::Transform GetUIScaleTransform() const; | 44 gfx::Transform GetUIScaleTransform() const; |
40 | 45 |
41 // WindowObserver overrides: | 46 // WindowObserver overrides: |
(...skipping 28 matching lines...) Expand all Loading... |
70 gfx::Display display_; | 75 gfx::Display display_; |
71 | 76 |
72 float ui_scale_; | 77 float ui_scale_; |
73 | 78 |
74 DISALLOW_COPY_AND_ASSIGN(TestScreen); | 79 DISALLOW_COPY_AND_ASSIGN(TestScreen); |
75 }; | 80 }; |
76 | 81 |
77 } // namespace aura | 82 } // namespace aura |
78 | 83 |
79 #endif // UI_AURA_TEST_TEST_SCREEN_H_ | 84 #endif // UI_AURA_TEST_TEST_SCREEN_H_ |
OLD | NEW |