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> |
11 | 11 |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "ui/display/fake_display_delegate.h" |
15 #include "ui/events/platform/x11/x11_event_source_libevent.h" | 16 #include "ui/events/platform/x11/x11_event_source_libevent.h" |
16 #include "ui/ozone/common/stub_overlay_manager.h" | 17 #include "ui/ozone/common/stub_overlay_manager.h" |
17 #include "ui/ozone/platform/x11/native_display_delegate_ozone_x11.h" | |
18 #include "ui/ozone/platform/x11/x11_cursor_factory_ozone.h" | 18 #include "ui/ozone/platform/x11/x11_cursor_factory_ozone.h" |
19 #include "ui/ozone/platform/x11/x11_surface_factory.h" | 19 #include "ui/ozone/platform/x11/x11_surface_factory.h" |
20 #include "ui/ozone/public/gpu_platform_support_host.h" | 20 #include "ui/ozone/public/gpu_platform_support_host.h" |
21 #include "ui/ozone/public/input_controller.h" | 21 #include "ui/ozone/public/input_controller.h" |
22 #include "ui/ozone/public/ozone_platform.h" | 22 #include "ui/ozone/public/ozone_platform.h" |
23 #include "ui/ozone/public/system_input_injector.h" | 23 #include "ui/ozone/public/system_input_injector.h" |
24 #include "ui/platform_window/platform_window.h" | 24 #include "ui/platform_window/platform_window.h" |
25 #include "ui/platform_window/x11/x11_window_manager_ozone.h" | 25 #include "ui/platform_window/x11/x11_window_manager_ozone.h" |
26 #include "ui/platform_window/x11/x11_window_ozone.h" | 26 #include "ui/platform_window/x11/x11_window_ozone.h" |
27 | 27 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 std::unique_ptr<X11WindowOzone> window = base::MakeUnique<X11WindowOzone>( | 79 std::unique_ptr<X11WindowOzone> window = base::MakeUnique<X11WindowOzone>( |
80 event_source_.get(), window_manager_.get(), delegate); | 80 event_source_.get(), window_manager_.get(), delegate); |
81 window->SetBounds(bounds); | 81 window->SetBounds(bounds); |
82 window->Create(); | 82 window->Create(); |
83 window->SetTitle(base::ASCIIToUTF16("Ozone X11")); | 83 window->SetTitle(base::ASCIIToUTF16("Ozone X11")); |
84 return std::move(window); | 84 return std::move(window); |
85 } | 85 } |
86 | 86 |
87 std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() | 87 std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() |
88 override { | 88 override { |
89 return base::MakeUnique<NativeDisplayDelegateOzoneX11>(); | 89 return base::MakeUnique<display::FakeDisplayDelegate>(); |
90 } | 90 } |
91 | 91 |
92 void InitializeUI() override { | 92 void InitializeUI() override { |
93 window_manager_.reset(new X11WindowManagerOzone); | 93 window_manager_.reset(new X11WindowManagerOzone); |
94 if (!event_source_) | 94 if (!event_source_) |
95 event_source_.reset(new X11EventSourceLibevent(gfx::GetXDisplay())); | 95 event_source_.reset(new X11EventSourceLibevent(gfx::GetXDisplay())); |
96 overlay_manager_.reset(new StubOverlayManager()); | 96 overlay_manager_.reset(new StubOverlayManager()); |
97 input_controller_ = CreateStubInputController(); | 97 input_controller_ = CreateStubInputController(); |
98 cursor_factory_ozone_.reset(new X11CursorFactoryOzone()); | 98 cursor_factory_ozone_.reset(new X11CursorFactoryOzone()); |
99 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); | 99 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); |
(...skipping 22 matching lines...) Expand all Loading... |
122 DISALLOW_COPY_AND_ASSIGN(OzonePlatformX11); | 122 DISALLOW_COPY_AND_ASSIGN(OzonePlatformX11); |
123 }; | 123 }; |
124 | 124 |
125 } // namespace | 125 } // namespace |
126 | 126 |
127 OzonePlatform* CreateOzonePlatformX11() { | 127 OzonePlatform* CreateOzonePlatformX11() { |
128 return new OzonePlatformX11; | 128 return new OzonePlatformX11; |
129 } | 129 } |
130 | 130 |
131 } // namespace ui | 131 } // namespace ui |
OLD | NEW |