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> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 virtual void UpdateTextInputState(const ui::TextInputState& state) = 0; | 79 virtual void UpdateTextInputState(const ui::TextInputState& state) = 0; |
80 virtual void SetImeVisibility(bool visible) = 0; | 80 virtual void SetImeVisibility(bool visible) = 0; |
81 | 81 |
82 // 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. |
83 virtual bool IsFramePending() const = 0; | 83 virtual bool IsFramePending() const = 0; |
84 | 84 |
85 virtual void RequestCopyOfOutput( | 85 virtual void RequestCopyOfOutput( |
86 std::unique_ptr<cc::CopyOutputRequest> output_request) = 0; | 86 std::unique_ptr<cc::CopyOutputRequest> output_request) = 0; |
87 | 87 |
88 virtual int64_t GetDisplayId() const = 0; | 88 virtual int64_t GetId() const = 0; |
89 | 89 |
90 virtual gfx::Rect GetBounds() const = 0; | 90 virtual gfx::Rect GetBounds() const = 0; |
91 | 91 |
92 // Overrides factory for testing. Default (NULL) value indicates regular | 92 // Overrides factory for testing. Default (NULL) value indicates regular |
93 // (non-test) environment. | 93 // (non-test) environment. |
94 static void set_factory_for_testing(PlatformDisplayFactory* factory) { | 94 static void set_factory_for_testing(PlatformDisplayFactory* factory) { |
95 PlatformDisplay::factory_ = factory; | 95 PlatformDisplay::factory_ = factory; |
96 } | 96 } |
97 | 97 |
98 private: | 98 private: |
(...skipping 19 matching lines...) Expand all Loading... |
118 void SetCapture() override; | 118 void SetCapture() override; |
119 void ReleaseCapture() override; | 119 void ReleaseCapture() override; |
120 void SetCursorById(int32_t cursor) override; | 120 void SetCursorById(int32_t cursor) override; |
121 float GetDeviceScaleFactor() override; | 121 float GetDeviceScaleFactor() override; |
122 ::display::Display::Rotation GetRotation() override; | 122 ::display::Display::Rotation GetRotation() override; |
123 void UpdateTextInputState(const ui::TextInputState& state) override; | 123 void UpdateTextInputState(const ui::TextInputState& state) override; |
124 void SetImeVisibility(bool visible) override; | 124 void SetImeVisibility(bool visible) override; |
125 bool IsFramePending() const override; | 125 bool IsFramePending() const override; |
126 void RequestCopyOfOutput( | 126 void RequestCopyOfOutput( |
127 std::unique_ptr<cc::CopyOutputRequest> output_request) override; | 127 std::unique_ptr<cc::CopyOutputRequest> output_request) override; |
128 int64_t GetDisplayId() const override; | 128 int64_t GetId() const override; |
129 gfx::Rect GetBounds() const override; | 129 gfx::Rect GetBounds() const override; |
130 | 130 |
131 private: | 131 private: |
132 void UpdateMetrics(const gfx::Rect& bounds, float device_scale_factor); | 132 void UpdateMetrics(const gfx::Rect& bounds, float device_scale_factor); |
133 | 133 |
134 // ui::PlatformWindowDelegate: | 134 // ui::PlatformWindowDelegate: |
135 void OnBoundsChanged(const gfx::Rect& new_bounds) override; | 135 void OnBoundsChanged(const gfx::Rect& new_bounds) override; |
136 void OnDamageRect(const gfx::Rect& damaged_region) override; | 136 void OnDamageRect(const gfx::Rect& damaged_region) override; |
137 void DispatchEvent(ui::Event* event) override; | 137 void DispatchEvent(ui::Event* event) override; |
138 void OnCloseRequest() override; | 138 void OnCloseRequest() override; |
139 void OnClosed() override; | 139 void OnClosed() override; |
140 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; | 140 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; |
141 void OnLostCapture() override; | 141 void OnLostCapture() override; |
142 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, | 142 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, |
143 float device_scale_factor) override; | 143 float device_scale_factor) override; |
144 void OnAcceleratedWidgetDestroyed() override; | 144 void OnAcceleratedWidgetDestroyed() override; |
145 void OnActivationChanged(bool active) override; | 145 void OnActivationChanged(bool active) override; |
146 | 146 |
147 // FrameGeneratorDelegate: | 147 // FrameGeneratorDelegate: |
148 ServerWindow* GetRootWindow() override; | 148 ServerWindow* GetRootWindow() override; |
149 void OnCompositorFrameDrawn() override; | 149 void OnCompositorFrameDrawn() override; |
150 bool IsInHighContrastMode() override; | 150 bool IsInHighContrastMode() override; |
151 const ViewportMetrics& GetViewportMetrics() override; | 151 const ViewportMetrics& GetViewportMetrics() override; |
152 | 152 |
153 int64_t display_id_; | 153 int64_t id_; |
154 | 154 |
155 #if !defined(OS_ANDROID) | 155 #if !defined(OS_ANDROID) |
156 std::unique_ptr<ui::CursorLoader> cursor_loader_; | 156 std::unique_ptr<ui::CursorLoader> cursor_loader_; |
157 #endif | 157 #endif |
158 | 158 |
159 PlatformDisplayDelegate* delegate_ = nullptr; | 159 PlatformDisplayDelegate* delegate_ = nullptr; |
160 std::unique_ptr<FrameGenerator> frame_generator_; | 160 std::unique_ptr<FrameGenerator> frame_generator_; |
161 | 161 |
162 ViewportMetrics metrics_; | 162 ViewportMetrics metrics_; |
163 std::unique_ptr<ui::PlatformWindow> platform_window_; | 163 std::unique_ptr<ui::PlatformWindow> platform_window_; |
164 | 164 |
165 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); | 165 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); |
166 }; | 166 }; |
167 | 167 |
168 } // namespace ws | 168 } // namespace ws |
169 | 169 |
170 } // namespace ui | 170 } // namespace ui |
171 | 171 |
172 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ | 172 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ |
OLD | NEW |