| 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 SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ | 5 #ifndef SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ |
| 6 #define SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ | 6 #define SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 void SetViewportSize(const gfx::Size& size) override; | 37 void SetViewportSize(const gfx::Size& size) override; |
| 38 void SetTitle(const base::string16& title) override; | 38 void SetTitle(const base::string16& title) override; |
| 39 void SetCapture() override; | 39 void SetCapture() override; |
| 40 void ReleaseCapture() override; | 40 void ReleaseCapture() override; |
| 41 void SetCursorById(mojom::Cursor cursor) override; | 41 void SetCursorById(mojom::Cursor cursor) override; |
| 42 void UpdateTextInputState(const ui::TextInputState& state) override; | 42 void UpdateTextInputState(const ui::TextInputState& state) override; |
| 43 void SetImeVisibility(bool visible) override; | 43 void SetImeVisibility(bool visible) override; |
| 44 gfx::Rect GetBounds() const override; | 44 gfx::Rect GetBounds() const override; |
| 45 bool UpdateViewportMetrics(const display::ViewportMetrics& metrics) override; | 45 bool UpdateViewportMetrics(const display::ViewportMetrics& metrics) override; |
| 46 const display::ViewportMetrics& GetViewportMetrics() const override; | 46 const display::ViewportMetrics& GetViewportMetrics() const override; |
| 47 bool IsPrimaryDisplay() const override; | |
| 48 void OnGpuChannelEstablished( | 47 void OnGpuChannelEstablished( |
| 49 scoped_refptr<gpu::GpuChannelHost> gpu_channel) override; | 48 scoped_refptr<gpu::GpuChannelHost> gpu_channel) override; |
| 50 | 49 |
| 51 private: | 50 private: |
| 52 // Update the root_location of located events to be relative to the origin | 51 // Update the root_location of located events to be relative to the origin |
| 53 // of this display. For example, if the origin of this display is (1800, 0) | 52 // of this display. For example, if the origin of this display is (1800, 0) |
| 54 // and the location of the event is (100, 200) then the root_location will be | 53 // and the location of the event is (100, 200) then the root_location will be |
| 55 // updated to be (1900, 200). | 54 // updated to be (1900, 200). |
| 56 // TODO(riajiang): This is totally broken with HDPI. | 55 // TODO(riajiang): This is totally broken with HDPI. |
| 57 void UpdateEventRootLocation(ui::LocatedEvent* event); | 56 void UpdateEventRootLocation(ui::LocatedEvent* event); |
| 58 | 57 |
| 59 // ui::PlatformWindowDelegate: | 58 // ui::PlatformWindowDelegate: |
| 60 void OnBoundsChanged(const gfx::Rect& new_bounds) override; | 59 void OnBoundsChanged(const gfx::Rect& new_bounds) override; |
| 61 void OnDamageRect(const gfx::Rect& damaged_region) override; | 60 void OnDamageRect(const gfx::Rect& damaged_region) override; |
| 62 void DispatchEvent(ui::Event* event) override; | 61 void DispatchEvent(ui::Event* event) override; |
| 63 void OnCloseRequest() override; | 62 void OnCloseRequest() override; |
| 64 void OnClosed() override; | 63 void OnClosed() override; |
| 65 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; | 64 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; |
| 66 void OnLostCapture() override; | 65 void OnLostCapture() override; |
| 67 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, | 66 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, |
| 68 float device_scale_factor) override; | 67 float device_scale_factor) override; |
| 69 void OnAcceleratedWidgetDestroyed() override; | 68 void OnAcceleratedWidgetDestroyed() override; |
| 70 void OnActivationChanged(bool active) override; | 69 void OnActivationChanged(bool active) override; |
| 71 | 70 |
| 72 // FrameGeneratorDelegate: | 71 // FrameGeneratorDelegate: |
| 73 bool IsInHighContrastMode() override; | 72 bool IsInHighContrastMode() override; |
| 74 | 73 |
| 75 int64_t display_id_; | 74 const int64_t display_id_; |
| 76 | 75 |
| 77 #if !defined(OS_ANDROID) | 76 #if !defined(OS_ANDROID) |
| 78 std::unique_ptr<ui::CursorLoader> cursor_loader_; | 77 std::unique_ptr<ui::CursorLoader> cursor_loader_; |
| 79 #endif | 78 #endif |
| 80 | 79 |
| 81 PlatformDisplayDelegate* delegate_ = nullptr; | 80 PlatformDisplayDelegate* delegate_ = nullptr; |
| 82 std::unique_ptr<FrameGenerator> frame_generator_; | 81 std::unique_ptr<FrameGenerator> frame_generator_; |
| 83 | 82 |
| 84 display::ViewportMetrics metrics_; | 83 display::ViewportMetrics metrics_; |
| 85 std::unique_ptr<ui::PlatformWindow> platform_window_; | 84 std::unique_ptr<ui::PlatformWindow> platform_window_; |
| 86 | 85 |
| 87 DISALLOW_COPY_AND_ASSIGN(PlatformDisplayDefault); | 86 DISALLOW_COPY_AND_ASSIGN(PlatformDisplayDefault); |
| 88 }; | 87 }; |
| 89 | 88 |
| 90 } // namespace ws | 89 } // namespace ws |
| 91 } // namespace ui | 90 } // namespace ui |
| 92 | 91 |
| 93 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ | 92 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ |
| OLD | NEW |