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

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

Issue 868043003: [PATCH 8/11] ozone: evdev: Plumb device changes to EventFactoryEvdev (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 10 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
« no previous file with comments | « ui/events/ozone/evdev/event_device_info.h ('k') | ui/events/ozone/evdev/event_factory_evdev.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 // Check first 31 keys: If we have all of them, consider it a full 231 // Check first 31 keys: If we have all of them, consider it a full
232 // keyboard. This is exactly what udev does for ID_INPUT_KEYBOARD. 232 // keyboard. This is exactly what udev does for ID_INPUT_KEYBOARD.
233 for (int key = KEY_ESC; key <= KEY_D; ++key) 233 for (int key = KEY_ESC; key <= KEY_D; ++key)
234 if (!HasKeyEvent(key)) 234 if (!HasKeyEvent(key))
235 return false; 235 return false;
236 236
237 return true; 237 return true;
238 } 238 }
239 239
240 bool EventDeviceInfo::HasMouse() const {
241 return HasRelXY();
242 }
243
240 bool EventDeviceInfo::HasTouchpad() const { 244 bool EventDeviceInfo::HasTouchpad() const {
241 return (HasAbsXY() || HasMTAbsXY()) && !IsMappedToScreen(); 245 return (HasAbsXY() || HasMTAbsXY()) && !IsMappedToScreen();
242 } 246 }
243 247
244 const std::vector<int32_t>& EventDeviceInfo::GetMtSlotsForCode(int code) const { 248 const std::vector<int32_t>& EventDeviceInfo::GetMtSlotsForCode(int code) const {
245 int index = code - ABS_MT_SLOT - 1; 249 int index = code - ABS_MT_SLOT - 1;
246 DCHECK_LE(0, index) << code << " is not a valid multi-touch code"; 250 DCHECK_LE(0, index) << code << " is not a valid multi-touch code";
247 DCHECK_LT(index, EVDEV_ABS_MT_COUNT) 251 DCHECK_LT(index, EVDEV_ABS_MT_COUNT)
248 << code << " is not a valid multi-touch code"; 252 << code << " is not a valid multi-touch code";
249 return slot_values_[index]; 253 return slot_values_[index];
250 } 254 }
251 255
252 } // namespace ui 256 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/event_device_info.h ('k') | ui/events/ozone/evdev/event_factory_evdev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698