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

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

Issue 1553493002: Global conversion of Pass()→std::move() on OS=linux chromecast=1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix fragile include order Created 4 years, 11 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"
6
7 #include <utility>
8
5 #include "ui/events/event.h" 9 #include "ui/events/event.h"
6 #include "ui/events/event_utils.h" 10 #include "ui/events/event_utils.h"
7 #include "ui/events/keycodes/dom/dom_code.h" 11 #include "ui/events/keycodes/dom/dom_code.h"
8 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" 12 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h"
9 #include "ui/events/ozone/evdev/device_event_dispatcher_evdev.h" 13 #include "ui/events/ozone/evdev/device_event_dispatcher_evdev.h"
10 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" 14 #include "ui/events/ozone/evdev/event_modifiers_evdev.h"
11 #include "ui/events/ozone/evdev/input_injector_evdev.h"
12 #include "ui/events/ozone/evdev/keyboard_evdev.h" 15 #include "ui/events/ozone/evdev/keyboard_evdev.h"
13 #include "ui/events/ozone/evdev/keyboard_util_evdev.h" 16 #include "ui/events/ozone/evdev/keyboard_util_evdev.h"
14 17
15 namespace ui { 18 namespace ui {
16 19
17 namespace { 20 namespace {
18 21
19 const int kDeviceIdForInjection = -1; 22 const int kDeviceIdForInjection = -1;
20 23
21 } // namespace 24 } // namespace
22 25
23 InputInjectorEvdev::InputInjectorEvdev( 26 InputInjectorEvdev::InputInjectorEvdev(
24 scoped_ptr<DeviceEventDispatcherEvdev> dispatcher, 27 scoped_ptr<DeviceEventDispatcherEvdev> dispatcher,
25 CursorDelegateEvdev* cursor) 28 CursorDelegateEvdev* cursor)
26 : cursor_(cursor), dispatcher_(dispatcher.Pass()) { 29 : cursor_(cursor), dispatcher_(std::move(dispatcher)) {}
27 }
28 30
29 InputInjectorEvdev::~InputInjectorEvdev() { 31 InputInjectorEvdev::~InputInjectorEvdev() {
30 } 32 }
31 33
32 void InputInjectorEvdev::InjectMouseButton(EventFlags button, bool down) { 34 void InputInjectorEvdev::InjectMouseButton(EventFlags button, bool down) {
33 unsigned int code; 35 unsigned int code;
34 switch (button) { 36 switch (button) {
35 case EF_LEFT_MOUSE_BUTTON: 37 case EF_LEFT_MOUSE_BUTTON:
36 code = BTN_LEFT; 38 code = BTN_LEFT;
37 break; 39 break;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 int native_keycode = KeycodeConverter::DomCodeToNativeKeycode(physical_key); 79 int native_keycode = KeycodeConverter::DomCodeToNativeKeycode(physical_key);
78 int evdev_code = NativeCodeToEvdevCode(native_keycode); 80 int evdev_code = NativeCodeToEvdevCode(native_keycode);
79 81
80 dispatcher_->DispatchKeyEvent( 82 dispatcher_->DispatchKeyEvent(
81 KeyEventParams(kDeviceIdForInjection, evdev_code, down, 83 KeyEventParams(kDeviceIdForInjection, evdev_code, down,
82 suppress_auto_repeat, EventTimeForNow())); 84 suppress_auto_repeat, EventTimeForNow()));
83 } 85 }
84 86
85 } // namespace ui 87 } // namespace ui
86 88
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/input_device_factory_evdev.cc ('k') | ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698