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

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

Issue 806693009: Port ScopedDisableInternalMouseAndKeyboardX11 to Ozone (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 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::HasTouchpad() const {
241 // TODO(pkotwicz): Investigate whether this is correct.
242 return (HasAbsXY() || HasMTAbsXY()) && !IsMappedToScreen();
pkotwicz 2014/12/17 04:29:45 This function may return true for multi-touch mice
243 }
244
240 const std::vector<int32_t>& EventDeviceInfo::GetMtSlotsForCode(int code) const { 245 const std::vector<int32_t>& EventDeviceInfo::GetMtSlotsForCode(int code) const {
241 int index = code - ABS_MT_SLOT - 1; 246 int index = code - ABS_MT_SLOT - 1;
242 DCHECK_LE(0, index) << code << " is not a valid multi-touch code"; 247 DCHECK_LE(0, index) << code << " is not a valid multi-touch code";
243 DCHECK_LT(index, EVDEV_ABS_MT_COUNT) 248 DCHECK_LT(index, EVDEV_ABS_MT_COUNT)
244 << code << " is not a valid multi-touch code"; 249 << code << " is not a valid multi-touch code";
245 return slot_values_[index]; 250 return slot_values_[index];
246 } 251 }
247 252
248 } // namespace ui 253 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698