| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 HEADLESS_LIB_BROWSER_HEADLESS_SCREEN_H_ | 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_SCREEN_H_ |
| 6 #define HEADLESS_LIB_BROWSER_HEADLESS_SCREEN_H_ | 6 #define HEADLESS_LIB_BROWSER_HEADLESS_SCREEN_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "ui/aura/window_observer.h" | 10 #include "ui/aura/window_observer.h" |
| 11 #include "ui/display/display.h" | 11 #include "ui/display/display.h" |
| 12 #include "ui/display/screen.h" | 12 #include "ui/display/screen.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class Insets; | 15 class Insets; |
| 16 class Rect; | 16 class Rect; |
| 17 class Transform; | 17 class Transform; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace aura { | 20 namespace aura { |
| 21 class Window; | 21 class Window; |
| 22 class WindowTreeClient; | 22 class WindowTreeClient; |
| 23 class WindowTreeHost; | 23 class WindowTreeHost; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace headless { | 26 namespace headless { |
| 27 | 27 |
| 28 class HeadlessScreen : public display::Screen, public aura::WindowObserver { | 28 class HeadlessScreen : public display::Screen, public aura::WindowObserver { |
| 29 public: | 29 public: |
| 30 // Creates a display::Screen of the specified size. If no size is specified, | 30 // Creates a display::Screen of the specified size (physical pixels). |
| 31 // then creates a 800x600 screen. |size| is in physical pixels. | |
| 32 static HeadlessScreen* Create(const gfx::Size& size); | 31 static HeadlessScreen* Create(const gfx::Size& size); |
| 33 ~HeadlessScreen() override; | 32 ~HeadlessScreen() override; |
| 34 | 33 |
| 35 aura::WindowTreeHost* CreateHostForPrimaryDisplay(); | 34 aura::WindowTreeHost* CreateHostForPrimaryDisplay(); |
| 36 | 35 |
| 37 void SetDeviceScaleFactor(float device_scale_fator); | 36 void SetDeviceScaleFactor(float device_scale_fator); |
| 38 void SetDisplayRotation(display::Display::Rotation rotation); | 37 void SetDisplayRotation(display::Display::Rotation rotation); |
| 39 void SetUIScale(float ui_scale); | 38 void SetUIScale(float ui_scale); |
| 40 void SetWorkAreaInsets(const gfx::Insets& insets); | 39 void SetWorkAreaInsets(const gfx::Insets& insets); |
| 41 | 40 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 70 aura::WindowTreeHost* host_; | 69 aura::WindowTreeHost* host_; |
| 71 display::Display display_; | 70 display::Display display_; |
| 72 float ui_scale_; | 71 float ui_scale_; |
| 73 | 72 |
| 74 DISALLOW_COPY_AND_ASSIGN(HeadlessScreen); | 73 DISALLOW_COPY_AND_ASSIGN(HeadlessScreen); |
| 75 }; | 74 }; |
| 76 | 75 |
| 77 } // namespace headless | 76 } // namespace headless |
| 78 | 77 |
| 79 #endif // HEADLESS_LIB_BROWSER_HEADLESS_SCREEN_H_ | 78 #endif // HEADLESS_LIB_BROWSER_HEADLESS_SCREEN_H_ |
| OLD | NEW |