| 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/x11/ozone_platform_x11.h" | 5 #include "ui/ozone/platform/x11/ozone_platform_x11.h" |
| 6 | 6 |
| 7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 return gpu_platform_support_.get(); | 74 return gpu_platform_support_.get(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 GpuPlatformSupportHost* GetGpuPlatformSupportHost() override { | 77 GpuPlatformSupportHost* GetGpuPlatformSupportHost() override { |
| 78 return gpu_platform_support_host_.get(); | 78 return gpu_platform_support_host_.get(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 std::unique_ptr<PlatformWindow> CreatePlatformWindow( | 81 std::unique_ptr<PlatformWindow> CreatePlatformWindow( |
| 82 PlatformWindowDelegate* delegate, | 82 PlatformWindowDelegate* delegate, |
| 83 const gfx::Rect& bounds) override { | 83 const gfx::Rect& bounds) override { |
| 84 std::unique_ptr<X11WindowOzone> window = | 84 std::unique_ptr<X11WindowOzone> window = base::MakeUnique<X11WindowOzone>( |
| 85 base::WrapUnique(new X11WindowOzone(event_source_.get(), | 85 event_source_.get(), window_manager_.get(), delegate); |
| 86 window_manager_.get(), delegate)); | |
| 87 window->SetBounds(bounds); | 86 window->SetBounds(bounds); |
| 88 window->Create(); | 87 window->Create(); |
| 89 window->SetTitle(base::ASCIIToUTF16("Ozone X11")); | 88 window->SetTitle(base::ASCIIToUTF16("Ozone X11")); |
| 90 return std::move(window); | 89 return std::move(window); |
| 91 } | 90 } |
| 92 | 91 |
| 93 std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() | 92 std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() |
| 94 override { | 93 override { |
| 95 return base::WrapUnique(new NativeDisplayDelegateOzoneX11()); | 94 return base::MakeUnique<NativeDisplayDelegateOzoneX11>(); |
| 96 } | 95 } |
| 97 | 96 |
| 98 void InitializeUI() override { | 97 void InitializeUI() override { |
| 99 window_manager_.reset(new X11WindowManagerOzone); | 98 window_manager_.reset(new X11WindowManagerOzone); |
| 100 event_source_.reset(new X11EventSourceLibevent(gfx::GetXDisplay())); | 99 event_source_.reset(new X11EventSourceLibevent(gfx::GetXDisplay())); |
| 101 overlay_manager_.reset(new StubOverlayManager()); | 100 overlay_manager_.reset(new StubOverlayManager()); |
| 102 input_controller_ = CreateStubInputController(); | 101 input_controller_ = CreateStubInputController(); |
| 103 cursor_factory_ozone_.reset(new X11CursorFactoryOzone()); | 102 cursor_factory_ozone_.reset(new X11CursorFactoryOzone()); |
| 104 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); | 103 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); |
| 105 } | 104 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 125 DISALLOW_COPY_AND_ASSIGN(OzonePlatformX11); | 124 DISALLOW_COPY_AND_ASSIGN(OzonePlatformX11); |
| 126 }; | 125 }; |
| 127 | 126 |
| 128 } // namespace | 127 } // namespace |
| 129 | 128 |
| 130 OzonePlatform* CreateOzonePlatformX11() { | 129 OzonePlatform* CreateOzonePlatformX11() { |
| 131 return new OzonePlatformX11; | 130 return new OzonePlatformX11; |
| 132 } | 131 } |
| 133 | 132 |
| 134 } // namespace ui | 133 } // namespace ui |
| OLD | NEW |