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

Unified Diff: ui/events/ozone/evdev/touch_event_converter.cc

Issue 137273009: evdev: Factor common code out of key & touch converters (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove duplicate variables & unneeded #include Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/ozone/evdev/touch_event_converter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/touch_event_converter.cc
diff --git a/ui/events/ozone/evdev/touch_event_converter.cc b/ui/events/ozone/evdev/touch_event_converter.cc
index d21225e3f36638d703e0a1405a865e1e866c2ca5..15766edfb8e8498e13a5e4b81006e44fa7580cb2 100644
--- a/ui/events/ozone/evdev/touch_event_converter.cc
+++ b/ui/events/ozone/evdev/touch_event_converter.cc
@@ -32,22 +32,22 @@ const float kFingerWidth = 25.f;
namespace ui {
-TouchEventConverterEvdev::TouchEventConverterEvdev(int fd, base::FilePath path)
- : pressure_min_(0),
+TouchEventConverterEvdev::TouchEventConverterEvdev(
+ int fd,
+ base::FilePath path,
+ EventModifiersEvdev* modifiers)
+ : EventConverterEvdev(fd, path, modifiers),
+ pressure_min_(0),
pressure_max_(0),
x_scale_(1.),
y_scale_(1.),
x_max_(std::numeric_limits<int>::max()),
y_max_(std::numeric_limits<int>::max()),
- current_slot_(0),
- fd_(fd),
- path_(path) {
+ current_slot_(0) {
Init();
}
TouchEventConverterEvdev::~TouchEventConverterEvdev() {
- if (fd_ >= 0 && close(fd_) < 0)
- DLOG(WARNING) << "failed close on " << path_.value();
}
void TouchEventConverterEvdev::Init() {
@@ -99,18 +99,9 @@ void TouchEventConverterEvdev::Init() {
}
}
-void TouchEventConverterEvdev::OnFileCanWriteWithoutBlocking(int /* fd */) {
- // Read-only file-descriptors.
- NOTREACHED();
-}
-
-void TouchEventConverterEvdev::OnFileCanReadWithoutBlocking(int fd) {
- input_event inputs[MAX_FINGERS * 6 + 1];
- ssize_t read_size = read(fd, inputs, sizeof(inputs));
- if (read_size <= 0)
- return;
-
- for (unsigned i = 0; i < read_size / sizeof(*inputs); i++) {
+void TouchEventConverterEvdev::ProcessEvents(const struct input_event* inputs,
+ int count) {
+ for (int i = 0; i < count; i++) {
const input_event& input = inputs[i];
if (input.type == EV_ABS) {
switch (input.code) {
« no previous file with comments | « ui/events/ozone/evdev/touch_event_converter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698