| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 // Updates the viewport metrics for the display, returning true if any | 84 // Updates the viewport metrics for the display, returning true if any |
| 85 // metrics have changed. | 85 // metrics have changed. |
| 86 virtual bool UpdateViewportMetrics( | 86 virtual bool UpdateViewportMetrics( |
| 87 const display::ViewportMetrics& metrics) = 0; | 87 const display::ViewportMetrics& metrics) = 0; |
| 88 | 88 |
| 89 virtual const display::ViewportMetrics& GetViewportMetrics() const = 0; | 89 virtual const display::ViewportMetrics& GetViewportMetrics() const = 0; |
| 90 | 90 |
| 91 virtual bool IsPrimaryDisplay() const = 0; | 91 virtual bool IsPrimaryDisplay() const = 0; |
| 92 | 92 |
| 93 virtual FrameGenerator* GetFrameGenerator() = 0; |
| 94 |
| 93 // Notifies the PlatformDisplay that a connection to the gpu has been | 95 // Notifies the PlatformDisplay that a connection to the gpu has been |
| 94 // established. | 96 // established. |
| 95 virtual void OnGpuChannelEstablished( | 97 virtual void OnGpuChannelEstablished( |
| 96 scoped_refptr<gpu::GpuChannelHost> gpu_channel) = 0; | 98 scoped_refptr<gpu::GpuChannelHost> gpu_channel) = 0; |
| 97 | 99 |
| 98 // Overrides factory for testing. Default (NULL) value indicates regular | 100 // Overrides factory for testing. Default (NULL) value indicates regular |
| 99 // (non-test) environment. | 101 // (non-test) environment. |
| 100 static void set_factory_for_testing(PlatformDisplayFactory* factory) { | 102 static void set_factory_for_testing(PlatformDisplayFactory* factory) { |
| 101 PlatformDisplay::factory_ = factory; | 103 PlatformDisplay::factory_ = factory; |
| 102 } | 104 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 124 void ReleaseCapture() override; | 126 void ReleaseCapture() override; |
| 125 void SetCursorById(mojom::Cursor cursor) override; | 127 void SetCursorById(mojom::Cursor cursor) override; |
| 126 void UpdateTextInputState(const ui::TextInputState& state) override; | 128 void UpdateTextInputState(const ui::TextInputState& state) override; |
| 127 void SetImeVisibility(bool visible) override; | 129 void SetImeVisibility(bool visible) override; |
| 128 gfx::Rect GetBounds() const override; | 130 gfx::Rect GetBounds() const override; |
| 129 bool UpdateViewportMetrics(const display::ViewportMetrics& metrics) override; | 131 bool UpdateViewportMetrics(const display::ViewportMetrics& metrics) override; |
| 130 const display::ViewportMetrics& GetViewportMetrics() const override; | 132 const display::ViewportMetrics& GetViewportMetrics() const override; |
| 131 bool IsPrimaryDisplay() const override; | 133 bool IsPrimaryDisplay() const override; |
| 132 void OnGpuChannelEstablished( | 134 void OnGpuChannelEstablished( |
| 133 scoped_refptr<gpu::GpuChannelHost> gpu_channel) override; | 135 scoped_refptr<gpu::GpuChannelHost> gpu_channel) override; |
| 136 FrameGenerator* GetFrameGenerator() override; |
| 134 | 137 |
| 135 private: | 138 private: |
| 136 // Update the root_location of located events to be relative to the origin | 139 // Update the root_location of located events to be relative to the origin |
| 137 // of this display. For example, if the origin of this display is (1800, 0) | 140 // of this display. For example, if the origin of this display is (1800, 0) |
| 138 // and the location of the event is (100, 200) then the root_location will be | 141 // and the location of the event is (100, 200) then the root_location will be |
| 139 // updated to be (1900, 200). | 142 // updated to be (1900, 200). |
| 140 void UpdateEventRootLocation(ui::LocatedEvent* event); | 143 void UpdateEventRootLocation(ui::LocatedEvent* event); |
| 141 | 144 |
| 142 // ui::PlatformWindowDelegate: | 145 // ui::PlatformWindowDelegate: |
| 143 void OnBoundsChanged(const gfx::Rect& new_bounds) override; | 146 void OnBoundsChanged(const gfx::Rect& new_bounds) override; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 168 std::unique_ptr<ui::PlatformWindow> platform_window_; | 171 std::unique_ptr<ui::PlatformWindow> platform_window_; |
| 169 | 172 |
| 170 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); | 173 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); |
| 171 }; | 174 }; |
| 172 | 175 |
| 173 } // namespace ws | 176 } // namespace ws |
| 174 | 177 |
| 175 } // namespace ui | 178 } // namespace ui |
| 176 | 179 |
| 177 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ | 180 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ |
| OLD | NEW |