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 "ui/events/platform/x11/x11_event_source_libevent.h" | 15 #include "ui/events/platform/x11/x11_event_source_libevent.h" |
15 #include "ui/ozone/common/stub_overlay_manager.h" | 16 #include "ui/ozone/common/stub_overlay_manager.h" |
16 #include "ui/ozone/platform/x11/native_display_delegate_ozone_x11.h" | 17 #include "ui/ozone/platform/x11/native_display_delegate_ozone_x11.h" |
17 #include "ui/ozone/platform/x11/x11_cursor_factory_ozone.h" | 18 #include "ui/ozone/platform/x11/x11_cursor_factory_ozone.h" |
18 #include "ui/ozone/platform/x11/x11_surface_factory.h" | 19 #include "ui/ozone/platform/x11/x11_surface_factory.h" |
19 #include "ui/ozone/public/gpu_platform_support.h" | 20 #include "ui/ozone/public/gpu_platform_support.h" |
20 #include "ui/ozone/public/gpu_platform_support_host.h" | 21 #include "ui/ozone/public/gpu_platform_support_host.h" |
21 #include "ui/ozone/public/input_controller.h" | 22 #include "ui/ozone/public/input_controller.h" |
22 #include "ui/ozone/public/ozone_platform.h" | 23 #include "ui/ozone/public/ozone_platform.h" |
23 #include "ui/ozone/public/system_input_injector.h" | 24 #include "ui/ozone/public/system_input_injector.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 79 } |
79 | 80 |
80 std::unique_ptr<PlatformWindow> CreatePlatformWindow( | 81 std::unique_ptr<PlatformWindow> CreatePlatformWindow( |
81 PlatformWindowDelegate* delegate, | 82 PlatformWindowDelegate* delegate, |
82 const gfx::Rect& bounds) override { | 83 const gfx::Rect& bounds) override { |
83 std::unique_ptr<X11WindowOzone> window = | 84 std::unique_ptr<X11WindowOzone> window = |
84 base::WrapUnique(new X11WindowOzone(event_source_.get(), | 85 base::WrapUnique(new X11WindowOzone(event_source_.get(), |
85 window_manager_.get(), delegate)); | 86 window_manager_.get(), delegate)); |
86 window->SetBounds(bounds); | 87 window->SetBounds(bounds); |
87 window->Create(); | 88 window->Create(); |
| 89 window->SetTitle(base::ASCIIToUTF16("Ozone X11")); |
88 return std::move(window); | 90 return std::move(window); |
89 } | 91 } |
90 | 92 |
91 std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() | 93 std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() |
92 override { | 94 override { |
93 return base::WrapUnique(new NativeDisplayDelegateOzoneX11()); | 95 return base::WrapUnique(new NativeDisplayDelegateOzoneX11()); |
94 } | 96 } |
95 | 97 |
96 void InitializeUI() override { | 98 void InitializeUI() override { |
97 window_manager_.reset(new X11WindowManagerOzone); | 99 window_manager_.reset(new X11WindowManagerOzone); |
(...skipping 25 matching lines...) Expand all Loading... |
123 DISALLOW_COPY_AND_ASSIGN(OzonePlatformX11); | 125 DISALLOW_COPY_AND_ASSIGN(OzonePlatformX11); |
124 }; | 126 }; |
125 | 127 |
126 } // namespace | 128 } // namespace |
127 | 129 |
128 OzonePlatform* CreateOzonePlatformX11() { | 130 OzonePlatform* CreateOzonePlatformX11() { |
129 return new OzonePlatformX11; | 131 return new OzonePlatformX11; |
130 } | 132 } |
131 | 133 |
132 } // namespace ui | 134 } // namespace ui |
OLD | NEW |