Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(530)

Side by Side Diff: ui/ozone/platform/x11/ozone_platform_x11.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <utility> 10 #include <utility>
10 11
11 #include "base/command_line.h" 12 #include "base/command_line.h"
12 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/ptr_util.h"
13 #include "ui/events/platform/x11/x11_event_source_libevent.h" 14 #include "ui/events/platform/x11/x11_event_source_libevent.h"
14 #include "ui/ozone/common/native_display_delegate_ozone.h" 15 #include "ui/ozone/common/native_display_delegate_ozone.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/x11_cursor_factory_ozone.h" 17 #include "ui/ozone/platform/x11/x11_cursor_factory_ozone.h"
17 #include "ui/ozone/platform/x11/x11_surface_factory.h" 18 #include "ui/ozone/platform/x11/x11_surface_factory.h"
18 #include "ui/ozone/public/gpu_platform_support.h" 19 #include "ui/ozone/public/gpu_platform_support.h"
19 #include "ui/ozone/public/gpu_platform_support_host.h" 20 #include "ui/ozone/public/gpu_platform_support_host.h"
20 #include "ui/ozone/public/input_controller.h" 21 #include "ui/ozone/public/input_controller.h"
21 #include "ui/ozone/public/ozone_platform.h" 22 #include "ui/ozone/public/ozone_platform.h"
22 #include "ui/ozone/public/system_input_injector.h" 23 #include "ui/ozone/public/system_input_injector.h"
(...skipping 30 matching lines...) Expand all
53 } 54 }
54 55
55 ui::OverlayManagerOzone* GetOverlayManager() override { 56 ui::OverlayManagerOzone* GetOverlayManager() override {
56 return overlay_manager_.get(); 57 return overlay_manager_.get();
57 } 58 }
58 59
59 CursorFactoryOzone* GetCursorFactoryOzone() override { 60 CursorFactoryOzone* GetCursorFactoryOzone() override {
60 return cursor_factory_ozone_.get(); 61 return cursor_factory_ozone_.get();
61 } 62 }
62 63
63 scoped_ptr<SystemInputInjector> CreateSystemInputInjector() override { 64 std::unique_ptr<SystemInputInjector> CreateSystemInputInjector() override {
64 return nullptr; 65 return nullptr;
65 } 66 }
66 67
67 InputController* GetInputController() override { 68 InputController* GetInputController() override {
68 return input_controller_.get(); 69 return input_controller_.get();
69 } 70 }
70 71
71 GpuPlatformSupport* GetGpuPlatformSupport() override { 72 GpuPlatformSupport* GetGpuPlatformSupport() override {
72 return gpu_platform_support_.get(); 73 return gpu_platform_support_.get();
73 } 74 }
74 75
75 GpuPlatformSupportHost* GetGpuPlatformSupportHost() override { 76 GpuPlatformSupportHost* GetGpuPlatformSupportHost() override {
76 return gpu_platform_support_host_.get(); 77 return gpu_platform_support_host_.get();
77 } 78 }
78 79
79 scoped_ptr<PlatformWindow> CreatePlatformWindow( 80 std::unique_ptr<PlatformWindow> CreatePlatformWindow(
80 PlatformWindowDelegate* delegate, 81 PlatformWindowDelegate* delegate,
81 const gfx::Rect& bounds) override { 82 const gfx::Rect& bounds) override {
82 scoped_ptr<X11WindowOzone> window = make_scoped_ptr(new X11WindowOzone( 83 std::unique_ptr<X11WindowOzone> window =
83 event_source_.get(), window_manager_.get(), delegate)); 84 base::WrapUnique(new X11WindowOzone(event_source_.get(),
85 window_manager_.get(), delegate));
84 window->SetBounds(bounds); 86 window->SetBounds(bounds);
85 window->Create(); 87 window->Create();
86 return std::move(window); 88 return std::move(window);
87 } 89 }
88 90
89 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override { 91 std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
90 return make_scoped_ptr(new NativeDisplayDelegateOzone()); 92 override {
93 return base::WrapUnique(new NativeDisplayDelegateOzone());
91 } 94 }
92 95
93 void InitializeUI() override { 96 void InitializeUI() override {
94 window_manager_.reset(new X11WindowManagerOzone); 97 window_manager_.reset(new X11WindowManagerOzone);
95 event_source_.reset(new X11EventSourceLibevent(gfx::GetXDisplay())); 98 event_source_.reset(new X11EventSourceLibevent(gfx::GetXDisplay()));
96 overlay_manager_.reset(new StubOverlayManager()); 99 overlay_manager_.reset(new StubOverlayManager());
97 input_controller_ = CreateStubInputController(); 100 input_controller_ = CreateStubInputController();
98 cursor_factory_ozone_.reset(new X11CursorFactoryOzone()); 101 cursor_factory_ozone_.reset(new X11CursorFactoryOzone());
99 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); 102 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost());
100 } 103 }
101 104
102 void InitializeGPU() override { 105 void InitializeGPU() override {
103 surface_factory_ozone_.reset(new X11SurfaceFactory()); 106 surface_factory_ozone_.reset(new X11SurfaceFactory());
104 gpu_platform_support_.reset(CreateStubGpuPlatformSupport()); 107 gpu_platform_support_.reset(CreateStubGpuPlatformSupport());
105 } 108 }
106 109
107 private: 110 private:
108 // Objects in the Browser process. 111 // Objects in the Browser process.
109 scoped_ptr<X11WindowManagerOzone> window_manager_; 112 std::unique_ptr<X11WindowManagerOzone> window_manager_;
110 scoped_ptr<X11EventSourceLibevent> event_source_; 113 std::unique_ptr<X11EventSourceLibevent> event_source_;
111 scoped_ptr<OverlayManagerOzone> overlay_manager_; 114 std::unique_ptr<OverlayManagerOzone> overlay_manager_;
112 scoped_ptr<InputController> input_controller_; 115 std::unique_ptr<InputController> input_controller_;
113 scoped_ptr<X11CursorFactoryOzone> cursor_factory_ozone_; 116 std::unique_ptr<X11CursorFactoryOzone> cursor_factory_ozone_;
114 scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; 117 std::unique_ptr<GpuPlatformSupportHost> gpu_platform_support_host_;
115 118
116 // Objects in the GPU process. 119 // Objects in the GPU process.
117 scoped_ptr<X11SurfaceFactory> surface_factory_ozone_; 120 std::unique_ptr<X11SurfaceFactory> surface_factory_ozone_;
118 scoped_ptr<GpuPlatformSupport> gpu_platform_support_; 121 std::unique_ptr<GpuPlatformSupport> gpu_platform_support_;
119 122
120 DISALLOW_COPY_AND_ASSIGN(OzonePlatformX11); 123 DISALLOW_COPY_AND_ASSIGN(OzonePlatformX11);
121 }; 124 };
122 125
123 } // namespace 126 } // namespace
124 127
125 OzonePlatform* CreateOzonePlatformX11() { 128 OzonePlatform* CreateOzonePlatformX11() {
126 return new OzonePlatformX11; 129 return new OzonePlatformX11;
127 } 130 }
128 131
129 } // namespace ui 132 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/wayland/wayland_window_unittest.cc ('k') | ui/ozone/platform/x11/x11_cursor_factory_ozone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698