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

Side by Side Diff: ui/events/ozone/evdev/event_factory_evdev.cc

Issue 2259753003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/events/ozone/evdev/event_factory_evdev.h" 5 #include "ui/events/ozone/evdev/event_factory_evdev.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 151 }
152 152
153 std::unique_ptr<SystemInputInjector> 153 std::unique_ptr<SystemInputInjector>
154 EventFactoryEvdev::CreateSystemInputInjector() { 154 EventFactoryEvdev::CreateSystemInputInjector() {
155 // Use forwarding dispatcher for the injector rather than dispatching 155 // Use forwarding dispatcher for the injector rather than dispatching
156 // directly. We cannot assume it is safe to (re-)enter ui::Event dispatch 156 // directly. We cannot assume it is safe to (re-)enter ui::Event dispatch
157 // synchronously from the injection point. 157 // synchronously from the injection point.
158 std::unique_ptr<DeviceEventDispatcherEvdev> proxy_dispatcher( 158 std::unique_ptr<DeviceEventDispatcherEvdev> proxy_dispatcher(
159 new ProxyDeviceEventDispatcher(base::ThreadTaskRunnerHandle::Get(), 159 new ProxyDeviceEventDispatcher(base::ThreadTaskRunnerHandle::Get(),
160 weak_ptr_factory_.GetWeakPtr())); 160 weak_ptr_factory_.GetWeakPtr()));
161 return base::WrapUnique( 161 return base::MakeUnique<InputInjectorEvdev>(std::move(proxy_dispatcher),
162 new InputInjectorEvdev(std::move(proxy_dispatcher), cursor_)); 162 cursor_);
163 } 163 }
164 164
165 void EventFactoryEvdev::DispatchKeyEvent(const KeyEventParams& params) { 165 void EventFactoryEvdev::DispatchKeyEvent(const KeyEventParams& params) {
166 TRACE_EVENT1("evdev", "EventFactoryEvdev::DispatchKeyEvent", "device", 166 TRACE_EVENT1("evdev", "EventFactoryEvdev::DispatchKeyEvent", "device",
167 params.device_id); 167 params.device_id);
168 keyboard_.OnKeyChange(params.code, params.down, params.suppress_auto_repeat, 168 keyboard_.OnKeyChange(params.code, params.down, params.suppress_auto_repeat,
169 params.timestamp, params.device_id); 169 params.timestamp, params.device_id);
170 } 170 }
171 171
172 void EventFactoryEvdev::DispatchMouseMoveEvent( 172 void EventFactoryEvdev::DispatchMouseMoveEvent(
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 425
426 // Scan & monitor devices. 426 // Scan & monitor devices.
427 device_manager_->AddObserver(this); 427 device_manager_->AddObserver(this);
428 device_manager_->ScanDevices(this); 428 device_manager_->ScanDevices(this);
429 429
430 // Notify device thread that initial scan is done. 430 // Notify device thread that initial scan is done.
431 input_device_factory_proxy_->OnStartupScanComplete(); 431 input_device_factory_proxy_->OnStartupScanComplete();
432 } 432 }
433 433
434 } // namespace ui 434 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/event_converter_test_util.cc ('k') | ui/events/ozone/evdev/input_device_factory_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698