| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 GetDisplayId() const = 0; |
| 89 | 89 |
| 90 virtual gfx::Rect GetBounds() const = 0; |
| 91 |
| 90 // Overrides factory for testing. Default (NULL) value indicates regular | 92 // Overrides factory for testing. Default (NULL) value indicates regular |
| 91 // (non-test) environment. | 93 // (non-test) environment. |
| 92 static void set_factory_for_testing(PlatformDisplayFactory* factory) { | 94 static void set_factory_for_testing(PlatformDisplayFactory* factory) { |
| 93 PlatformDisplay::factory_ = factory; | 95 PlatformDisplay::factory_ = factory; |
| 94 } | 96 } |
| 95 | 97 |
| 96 private: | 98 private: |
| 97 // Static factory instance (always NULL for non-test). | 99 // Static factory instance (always NULL for non-test). |
| 98 static PlatformDisplayFactory* factory_; | 100 static PlatformDisplayFactory* factory_; |
| 99 }; | 101 }; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 117 void ReleaseCapture() override; | 119 void ReleaseCapture() override; |
| 118 void SetCursorById(int32_t cursor) override; | 120 void SetCursorById(int32_t cursor) override; |
| 119 float GetDeviceScaleFactor() override; | 121 float GetDeviceScaleFactor() override; |
| 120 ::display::Display::Rotation GetRotation() override; | 122 ::display::Display::Rotation GetRotation() override; |
| 121 void UpdateTextInputState(const ui::TextInputState& state) override; | 123 void UpdateTextInputState(const ui::TextInputState& state) override; |
| 122 void SetImeVisibility(bool visible) override; | 124 void SetImeVisibility(bool visible) override; |
| 123 bool IsFramePending() const override; | 125 bool IsFramePending() const override; |
| 124 void RequestCopyOfOutput( | 126 void RequestCopyOfOutput( |
| 125 std::unique_ptr<cc::CopyOutputRequest> output_request) override; | 127 std::unique_ptr<cc::CopyOutputRequest> output_request) override; |
| 126 int64_t GetDisplayId() const override; | 128 int64_t GetDisplayId() const override; |
| 129 gfx::Rect GetBounds() const override; |
| 127 | 130 |
| 128 private: | 131 private: |
| 129 void UpdateMetrics(const gfx::Size& size, float device_scale_factor); | 132 void UpdateMetrics(const gfx::Rect& bounds, float device_scale_factor); |
| 130 | 133 |
| 131 // ui::PlatformWindowDelegate: | 134 // ui::PlatformWindowDelegate: |
| 132 void OnBoundsChanged(const gfx::Rect& new_bounds) override; | 135 void OnBoundsChanged(const gfx::Rect& new_bounds) override; |
| 133 void OnDamageRect(const gfx::Rect& damaged_region) override; | 136 void OnDamageRect(const gfx::Rect& damaged_region) override; |
| 134 void DispatchEvent(ui::Event* event) override; | 137 void DispatchEvent(ui::Event* event) override; |
| 135 void OnCloseRequest() override; | 138 void OnCloseRequest() override; |
| 136 void OnClosed() override; | 139 void OnClosed() override; |
| 137 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; | 140 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; |
| 138 void OnLostCapture() override; | 141 void OnLostCapture() override; |
| 139 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, | 142 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 160 std::unique_ptr<ui::PlatformWindow> platform_window_; | 163 std::unique_ptr<ui::PlatformWindow> platform_window_; |
| 161 | 164 |
| 162 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); | 165 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); |
| 163 }; | 166 }; |
| 164 | 167 |
| 165 } // namespace ws | 168 } // namespace ws |
| 166 | 169 |
| 167 } // namespace ui | 170 } // namespace ui |
| 168 | 171 |
| 169 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ | 172 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ |
| OLD | NEW |