OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 SERVICES_UI_WS_PLATFORM_DISPLAY_H_ | 5 #ifndef SERVICES_UI_WS_PLATFORM_DISPLAY_H_ |
6 #define SERVICES_UI_WS_PLATFORM_DISPLAY_H_ | 6 #define SERVICES_UI_WS_PLATFORM_DISPLAY_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <memory> | 11 #include <memory> |
| 12 #include <utility> |
12 | 13 |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
15 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
16 #include "build/build_config.h" | 17 #include "build/build_config.h" |
17 #include "services/ui/public/interfaces/window_manager.mojom.h" | 18 #include "services/ui/public/interfaces/window_manager.mojom.h" |
18 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" | 19 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" |
19 #include "services/ui/public/interfaces/window_tree.mojom.h" | 20 #include "services/ui/public/interfaces/window_tree.mojom.h" |
20 #include "services/ui/ws/frame_generator.h" | 21 #include "services/ui/ws/frame_generator.h" |
21 #include "services/ui/ws/frame_generator_delegate.h" | 22 #include "services/ui/ws/frame_generator_delegate.h" |
22 #include "services/ui/ws/platform_display_delegate.h" | 23 #include "services/ui/ws/platform_display_delegate.h" |
| 24 #include "ui/display/display.h" |
23 #include "ui/platform_window/platform_window_delegate.h" | 25 #include "ui/platform_window/platform_window_delegate.h" |
24 | 26 |
25 namespace cc { | 27 namespace cc { |
26 class CopyOutputRequest; | 28 class CopyOutputRequest; |
27 } // namespace cc | 29 } // namespace cc |
28 | 30 |
29 namespace gfx { | 31 namespace gfx { |
30 class Rect; | 32 class Rect; |
31 } | 33 } |
32 | 34 |
(...skipping 30 matching lines...) Expand all Loading... |
63 virtual void SetViewportSize(const gfx::Size& size) = 0; | 65 virtual void SetViewportSize(const gfx::Size& size) = 0; |
64 | 66 |
65 virtual void SetTitle(const base::string16& title) = 0; | 67 virtual void SetTitle(const base::string16& title) = 0; |
66 | 68 |
67 virtual void SetCapture() = 0; | 69 virtual void SetCapture() = 0; |
68 | 70 |
69 virtual void ReleaseCapture() = 0; | 71 virtual void ReleaseCapture() = 0; |
70 | 72 |
71 virtual void SetCursorById(int32_t cursor) = 0; | 73 virtual void SetCursorById(int32_t cursor) = 0; |
72 | 74 |
73 virtual mojom::Rotation GetRotation() = 0; | 75 virtual ::display::Display::Rotation GetRotation() = 0; |
74 | 76 |
75 virtual float GetDeviceScaleFactor() = 0; | 77 virtual float GetDeviceScaleFactor() = 0; |
76 | 78 |
77 virtual void UpdateTextInputState(const ui::TextInputState& state) = 0; | 79 virtual void UpdateTextInputState(const ui::TextInputState& state) = 0; |
78 virtual void SetImeVisibility(bool visible) = 0; | 80 virtual void SetImeVisibility(bool visible) = 0; |
79 | 81 |
80 // Returns true if a compositor frame has been submitted but not drawn yet. | 82 // Returns true if a compositor frame has been submitted but not drawn yet. |
81 virtual bool IsFramePending() const = 0; | 83 virtual bool IsFramePending() const = 0; |
82 | 84 |
83 virtual void RequestCopyOfOutput( | 85 virtual void RequestCopyOfOutput( |
(...skipping 24 matching lines...) Expand all Loading... |
108 // PlatformDisplay: | 110 // PlatformDisplay: |
109 void Init(PlatformDisplayDelegate* delegate) override; | 111 void Init(PlatformDisplayDelegate* delegate) override; |
110 void SchedulePaint(const ServerWindow* window, | 112 void SchedulePaint(const ServerWindow* window, |
111 const gfx::Rect& bounds) override; | 113 const gfx::Rect& bounds) override; |
112 void SetViewportSize(const gfx::Size& size) override; | 114 void SetViewportSize(const gfx::Size& size) override; |
113 void SetTitle(const base::string16& title) override; | 115 void SetTitle(const base::string16& title) override; |
114 void SetCapture() override; | 116 void SetCapture() override; |
115 void ReleaseCapture() override; | 117 void ReleaseCapture() override; |
116 void SetCursorById(int32_t cursor) override; | 118 void SetCursorById(int32_t cursor) override; |
117 float GetDeviceScaleFactor() override; | 119 float GetDeviceScaleFactor() override; |
118 mojom::Rotation GetRotation() override; | 120 ::display::Display::Rotation GetRotation() override; |
119 void UpdateTextInputState(const ui::TextInputState& state) override; | 121 void UpdateTextInputState(const ui::TextInputState& state) override; |
120 void SetImeVisibility(bool visible) override; | 122 void SetImeVisibility(bool visible) override; |
121 bool IsFramePending() const override; | 123 bool IsFramePending() const override; |
122 void RequestCopyOfOutput( | 124 void RequestCopyOfOutput( |
123 std::unique_ptr<cc::CopyOutputRequest> output_request) override; | 125 std::unique_ptr<cc::CopyOutputRequest> output_request) override; |
124 int64_t GetDisplayId() const override; | 126 int64_t GetDisplayId() const override; |
125 | 127 |
126 private: | 128 private: |
127 void UpdateMetrics(const gfx::Size& size, float device_scale_factor); | 129 void UpdateMetrics(const gfx::Size& size, float device_scale_factor); |
128 | 130 |
(...skipping 29 matching lines...) Expand all Loading... |
158 std::unique_ptr<ui::PlatformWindow> platform_window_; | 160 std::unique_ptr<ui::PlatformWindow> platform_window_; |
159 | 161 |
160 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); | 162 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); |
161 }; | 163 }; |
162 | 164 |
163 } // namespace ws | 165 } // namespace ws |
164 | 166 |
165 } // namespace ui | 167 } // namespace ui |
166 | 168 |
167 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ | 169 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ |
OLD | NEW |