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

Side by Side Diff: ui/events/ozone/evdev/input_injector_evdev.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 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/input_injector_evdev.h" 5 #include "ui/events/ozone/evdev/input_injector_evdev.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/events/event_utils.h" 10 #include "ui/events/event_utils.h"
11 #include "ui/events/keycodes/dom/dom_code.h" 11 #include "ui/events/keycodes/dom/dom_code.h"
12 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" 12 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h"
13 #include "ui/events/ozone/evdev/device_event_dispatcher_evdev.h" 13 #include "ui/events/ozone/evdev/device_event_dispatcher_evdev.h"
14 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" 14 #include "ui/events/ozone/evdev/event_modifiers_evdev.h"
15 #include "ui/events/ozone/evdev/keyboard_evdev.h" 15 #include "ui/events/ozone/evdev/keyboard_evdev.h"
16 #include "ui/events/ozone/evdev/keyboard_util_evdev.h" 16 #include "ui/events/ozone/evdev/keyboard_util_evdev.h"
17 17
18 namespace ui { 18 namespace ui {
19 19
20 namespace { 20 namespace {
21 21
22 const int kDeviceIdForInjection = -1; 22 const int kDeviceIdForInjection = -1;
23 23
24 } // namespace 24 } // namespace
25 25
26 InputInjectorEvdev::InputInjectorEvdev( 26 InputInjectorEvdev::InputInjectorEvdev(
27 scoped_ptr<DeviceEventDispatcherEvdev> dispatcher, 27 std::unique_ptr<DeviceEventDispatcherEvdev> dispatcher,
28 CursorDelegateEvdev* cursor) 28 CursorDelegateEvdev* cursor)
29 : cursor_(cursor), dispatcher_(std::move(dispatcher)) {} 29 : cursor_(cursor), dispatcher_(std::move(dispatcher)) {}
30 30
31 InputInjectorEvdev::~InputInjectorEvdev() { 31 InputInjectorEvdev::~InputInjectorEvdev() {
32 } 32 }
33 33
34 void InputInjectorEvdev::InjectMouseButton(EventFlags button, bool down) { 34 void InputInjectorEvdev::InjectMouseButton(EventFlags button, bool down) {
35 unsigned int code; 35 unsigned int code;
36 switch (button) { 36 switch (button) {
37 case EF_LEFT_MOUSE_BUTTON: 37 case EF_LEFT_MOUSE_BUTTON:
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 int native_keycode = KeycodeConverter::DomCodeToNativeKeycode(physical_key); 79 int native_keycode = KeycodeConverter::DomCodeToNativeKeycode(physical_key);
80 int evdev_code = NativeCodeToEvdevCode(native_keycode); 80 int evdev_code = NativeCodeToEvdevCode(native_keycode);
81 81
82 dispatcher_->DispatchKeyEvent( 82 dispatcher_->DispatchKeyEvent(
83 KeyEventParams(kDeviceIdForInjection, evdev_code, down, 83 KeyEventParams(kDeviceIdForInjection, evdev_code, down,
84 suppress_auto_repeat, EventTimeForNow())); 84 suppress_auto_repeat, EventTimeForNow()));
85 } 85 }
86 86
87 } // namespace ui 87 } // namespace ui
88 88
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/input_injector_evdev.h ('k') | ui/events/ozone/evdev/input_injector_evdev_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698