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

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

Issue 616633002: [Ozone-Evdev] Propagate touchscreen device information to DeviceDataManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/event_device_info.h" 5 #include "ui/events/ozone/evdev/event_device_info.h"
6 6
7 #include <linux/input.h> 7 #include <linux/input.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 28 matching lines...) Expand all
39 bool GetAbsInfo(int fd, int code, struct input_absinfo* absinfo) { 39 bool GetAbsInfo(int fd, int code, struct input_absinfo* absinfo) {
40 if (ioctl(fd, EVIOCGABS(code), absinfo)) { 40 if (ioctl(fd, EVIOCGABS(code), absinfo)) {
41 DLOG(ERROR) << "failed EVIOCGABS(" << code << ") on fd " << fd; 41 DLOG(ERROR) << "failed EVIOCGABS(" << code << ") on fd " << fd;
42 return false; 42 return false;
43 } 43 }
44 return true; 44 return true;
45 } 45 }
46 46
47 } // namespace 47 } // namespace
48 48
49 EventDeviceInfo::EventDeviceInfo() { 49 EventDeviceInfo::EventDeviceInfo(int id) : id_(id) {
50 memset(ev_bits_, 0, sizeof(ev_bits_)); 50 memset(ev_bits_, 0, sizeof(ev_bits_));
51 memset(key_bits_, 0, sizeof(key_bits_)); 51 memset(key_bits_, 0, sizeof(key_bits_));
52 memset(rel_bits_, 0, sizeof(rel_bits_)); 52 memset(rel_bits_, 0, sizeof(rel_bits_));
53 memset(abs_bits_, 0, sizeof(abs_bits_)); 53 memset(abs_bits_, 0, sizeof(abs_bits_));
54 memset(msc_bits_, 0, sizeof(msc_bits_)); 54 memset(msc_bits_, 0, sizeof(msc_bits_));
55 memset(sw_bits_, 0, sizeof(sw_bits_)); 55 memset(sw_bits_, 0, sizeof(sw_bits_));
56 memset(led_bits_, 0, sizeof(led_bits_)); 56 memset(led_bits_, 0, sizeof(led_bits_));
57 memset(prop_bits_, 0, sizeof(prop_bits_)); 57 memset(prop_bits_, 0, sizeof(prop_bits_));
58 memset(abs_info_, 0, sizeof(abs_info_)); 58 memset(abs_info_, 0, sizeof(abs_info_));
59 } 59 }
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 // Touchpads are not mapped to the screen. 180 // Touchpads are not mapped to the screen.
181 if (HasKeyEvent(BTN_LEFT) || HasKeyEvent(BTN_MIDDLE) || 181 if (HasKeyEvent(BTN_LEFT) || HasKeyEvent(BTN_MIDDLE) ||
182 HasKeyEvent(BTN_RIGHT) || HasKeyEvent(BTN_TOOL_FINGER)) 182 HasKeyEvent(BTN_RIGHT) || HasKeyEvent(BTN_TOOL_FINGER))
183 return false; 183 return false;
184 184
185 // Touchscreens are mapped to the screen. 185 // Touchscreens are mapped to the screen.
186 return true; 186 return true;
187 } 187 }
188 188
189 } // namespace ui 189 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698