| 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 #include "ui/ozone/platform/wayland/ozone_platform_wayland.h" | 5 #include "ui/ozone/platform/wayland/ozone_platform_wayland.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "ui/ozone/common/native_display_delegate_ozone.h" | 8 #include "ui/ozone/common/native_display_delegate_ozone.h" |
| 9 #include "ui/ozone/common/stub_overlay_manager.h" | 9 #include "ui/ozone/common/stub_overlay_manager.h" |
| 10 #include "ui/ozone/platform/wayland/wayland_connection.h" | 10 #include "ui/ozone/platform/wayland/wayland_connection.h" |
| 11 #include "ui/ozone/platform/wayland/wayland_surface_factory.h" | 11 #include "ui/ozone/platform/wayland/wayland_surface_factory.h" |
| 12 #include "ui/ozone/platform/wayland/wayland_window.h" | 12 #include "ui/ozone/platform/wayland/wayland_window.h" |
| 13 #include "ui/ozone/public/cursor_factory_ozone.h" | 13 #include "ui/ozone/public/cursor_factory_ozone.h" |
| 14 #include "ui/ozone/public/gpu_platform_support_host.h" | 14 #include "ui/ozone/public/gpu_platform_support_host.h" |
| 15 #include "ui/ozone/public/input_controller.h" | 15 #include "ui/ozone/public/input_controller.h" |
| 16 #include "ui/ozone/public/ozone_platform.h" | 16 #include "ui/ozone/public/ozone_platform.h" |
| 17 #include "ui/ozone/public/ozone_platform_screen_delegate.h" |
| 17 #include "ui/ozone/public/system_input_injector.h" | 18 #include "ui/ozone/public/system_input_injector.h" |
| 18 | 19 |
| 19 namespace ui { | 20 namespace ui { |
| 20 | 21 |
| 21 namespace { | 22 namespace { |
| 22 | 23 |
| 23 class OzonePlatformWayland : public OzonePlatform { | 24 class OzonePlatformWayland : public OzonePlatform { |
| 24 public: | 25 public: |
| 25 OzonePlatformWayland() {} | 26 OzonePlatformWayland() {} |
| 26 ~OzonePlatformWayland() override {} | 27 ~OzonePlatformWayland() override {} |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // TODO(fwang): Separate processes can not share a Wayland connection | 97 // TODO(fwang): Separate processes can not share a Wayland connection |
| 97 // and so the current implementations of GLOzoneEGLWayland and | 98 // and so the current implementations of GLOzoneEGLWayland and |
| 98 // WaylandCanvasSurface may only work when UI and GPU live in the same | 99 // WaylandCanvasSurface may only work when UI and GPU live in the same |
| 99 // process. GetSurfaceFactoryOzone() must be non-null so a dummy instance | 100 // process. GetSurfaceFactoryOzone() must be non-null so a dummy instance |
| 100 // of WaylandSurfaceFactory is needed to make the GPU initialization | 101 // of WaylandSurfaceFactory is needed to make the GPU initialization |
| 101 // gracefully fail. | 102 // gracefully fail. |
| 102 surface_factory_.reset(new WaylandSurfaceFactory(nullptr)); | 103 surface_factory_.reset(new WaylandSurfaceFactory(nullptr)); |
| 103 } | 104 } |
| 104 } | 105 } |
| 105 | 106 |
| 107 void SetScreenOutputObserver( |
| 108 OzonePlatformScreenDelegate* screenDelegate) override { |
| 109 connection_->SetOutputObserver(screenDelegate); |
| 110 } |
| 111 |
| 106 private: | 112 private: |
| 107 std::unique_ptr<WaylandConnection> connection_; | 113 std::unique_ptr<WaylandConnection> connection_; |
| 108 std::unique_ptr<WaylandSurfaceFactory> surface_factory_; | 114 std::unique_ptr<WaylandSurfaceFactory> surface_factory_; |
| 109 std::unique_ptr<CursorFactoryOzone> cursor_factory_; | 115 std::unique_ptr<CursorFactoryOzone> cursor_factory_; |
| 110 std::unique_ptr<StubOverlayManager> overlay_manager_; | 116 std::unique_ptr<StubOverlayManager> overlay_manager_; |
| 111 std::unique_ptr<InputController> input_controller_; | 117 std::unique_ptr<InputController> input_controller_; |
| 112 std::unique_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; | 118 std::unique_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; |
| 113 | 119 |
| 114 DISALLOW_COPY_AND_ASSIGN(OzonePlatformWayland); | 120 DISALLOW_COPY_AND_ASSIGN(OzonePlatformWayland); |
| 115 }; | 121 }; |
| 116 | 122 |
| 117 } // namespace | 123 } // namespace |
| 118 | 124 |
| 119 OzonePlatform* CreateOzonePlatformWayland() { | 125 OzonePlatform* CreateOzonePlatformWayland() { |
| 120 return new OzonePlatformWayland; | 126 return new OzonePlatformWayland; |
| 121 } | 127 } |
| 122 | 128 |
| 123 } // namespace ui | 129 } // namespace ui |
| OLD | NEW |