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

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

Issue 1073573002: Ozone support for device special cases in keyboard event rewriting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix crash (thanks spang) Created 5 years, 7 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 <linux/input.h> 5 #include <linux/input.h>
6 6
7 #include "ui/events/ozone/evdev/event_converter_evdev.h" 7 #include "ui/events/ozone/evdev/event_converter_evdev.h"
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "ui/events/devices/input_device.h" 12 #include "ui/events/devices/input_device.h"
13 13
14 namespace ui { 14 namespace ui {
15 15
16 EventConverterEvdev::EventConverterEvdev(int fd, 16 EventConverterEvdev::EventConverterEvdev(int fd,
17 const base::FilePath& path, 17 const base::FilePath& path,
18 int id, 18 int id,
19 InputDeviceType type) 19 InputDeviceType type,
20 : fd_(fd), path_(path), id_(id), type_(type), ignore_events_(false) { 20 const std::string& name,
21 uint16_t vendor_id,
22 uint16_t product_id)
23 : fd_(fd),
24 path_(path),
25 input_device_(id, type, name, vendor_id, product_id),
26 ignore_events_(false) {
21 } 27 }
22 28
23 EventConverterEvdev::~EventConverterEvdev() { 29 EventConverterEvdev::~EventConverterEvdev() {
24 Stop(); 30 Stop();
25 } 31 }
26 32
27 void EventConverterEvdev::Start() { 33 void EventConverterEvdev::Start() {
28 base::MessageLoopForUI::current()->WatchFileDescriptor( 34 base::MessageLoopForUI::current()->WatchFileDescriptor(
29 fd_, true, base::MessagePumpLibevent::WATCH_READ, &controller_, this); 35 fd_, true, base::MessagePumpLibevent::WATCH_READ, &controller_, this);
30 } 36 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 Stop(); 113 Stop();
108 } 114 }
109 } 115 }
110 116
111 base::TimeDelta EventConverterEvdev::TimeDeltaFromInputEvent( 117 base::TimeDelta EventConverterEvdev::TimeDeltaFromInputEvent(
112 const input_event& event) { 118 const input_event& event) {
113 return base::TimeDelta::FromMicroseconds(event.time.tv_sec * 1000000 + 119 return base::TimeDelta::FromMicroseconds(event.time.tv_sec * 1000000 +
114 event.time.tv_usec); 120 event.time.tv_usec);
115 } 121 }
116 } // namespace ui 122 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/event_converter_evdev.h ('k') | ui/events/ozone/evdev/event_converter_evdev_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698