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

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

Issue 791743004: events: Generalize IsTouchscreenInternal to any device type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/touch_event_converter_evdev.h" 5 #include "ui/events/ozone/evdev/touch_event_converter_evdev.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <linux/input.h> 9 #include <linux/input.h>
10 #include <poll.h> 10 #include <poll.h>
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 TouchEventConverterEvdev::TouchEventConverterEvdev( 73 TouchEventConverterEvdev::TouchEventConverterEvdev(
74 int fd, 74 int fd,
75 base::FilePath path, 75 base::FilePath path,
76 int id, 76 int id,
77 const EventDispatchCallback& callback) 77 const EventDispatchCallback& callback)
78 : EventConverterEvdev(fd, path, id), 78 : EventConverterEvdev(fd, path, id),
79 callback_(callback), 79 callback_(callback),
80 syn_dropped_(false), 80 syn_dropped_(false),
81 is_type_a_(false), 81 is_type_a_(false),
82 current_slot_(0), 82 current_slot_(0),
83 is_internal_(IsTouchscreenInternal(path)) { 83 is_internal_(GetInputDeviceTypeFromPath(path) == INPUT_DEVICE_INTERNAL) {
84 } 84 }
85 85
86 TouchEventConverterEvdev::~TouchEventConverterEvdev() { 86 TouchEventConverterEvdev::~TouchEventConverterEvdev() {
87 Stop(); 87 Stop();
88 close(fd_); 88 close(fd_);
89 } 89 }
90 90
91 void TouchEventConverterEvdev::Initialize(const EventDeviceInfo& info) { 91 void TouchEventConverterEvdev::Initialize(const EventDeviceInfo& info) {
92 pressure_min_ = info.GetAbsMinimum(ABS_MT_PRESSURE); 92 pressure_min_ = info.GetAbsMinimum(ABS_MT_PRESSURE);
93 pressure_max_ = info.GetAbsMaximum(ABS_MT_PRESSURE); 93 pressure_max_ = info.GetAbsMaximum(ABS_MT_PRESSURE);
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 305
306 // Subsequent events for this finger will be touch-move until it 306 // Subsequent events for this finger will be touch-move until it
307 // is released. 307 // is released.
308 events_[i].type_ = ET_TOUCH_MOVED; 308 events_[i].type_ = ET_TOUCH_MOVED;
309 } 309 }
310 } 310 }
311 altered_slots_.reset(); 311 altered_slots_.reset();
312 } 312 }
313 313
314 } // namespace ui 314 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/devices/device_util_linux.cc ('k') | ui/events/platform/x11/x11_hotplug_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698