OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/event.h" | 5 #include "ui/events/event.h" |
6 | 6 |
7 #if defined(USE_X11) | 7 #if defined(USE_X11) |
8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 #endif | 10 #endif |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 0, | 449 0, |
450 base::TimeTicks::FromInternalValue(time_stamp().ToInternalValue()), | 450 base::TimeTicks::FromInternalValue(time_stamp().ToInternalValue()), |
451 1); | 451 1); |
452 | 452 |
453 #if defined(USE_X11) | 453 #if defined(USE_X11) |
454 XIDeviceEvent* xiev = static_cast<XIDeviceEvent*>(native_event->xcookie.data); | 454 XIDeviceEvent* xiev = static_cast<XIDeviceEvent*>(native_event->xcookie.data); |
455 source_device_id_ = xiev->deviceid; | 455 source_device_id_ = xiev->deviceid; |
456 #endif | 456 #endif |
457 | 457 |
458 latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0); | 458 latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0); |
| 459 |
| 460 if (type() == ET_TOUCH_PRESSED) |
| 461 IncrementTouchIdRefCount(native_event); |
459 } | 462 } |
460 | 463 |
461 TouchEvent::TouchEvent(EventType type, | 464 TouchEvent::TouchEvent(EventType type, |
462 const gfx::PointF& location, | 465 const gfx::PointF& location, |
463 int touch_id, | 466 int touch_id, |
464 base::TimeDelta time_stamp) | 467 base::TimeDelta time_stamp) |
465 : LocatedEvent(type, location, location, time_stamp, 0), | 468 : LocatedEvent(type, location, location, time_stamp, 0), |
466 touch_id_(touch_id), | 469 touch_id_(touch_id), |
467 radius_x_(0.0f), | 470 radius_x_(0.0f), |
468 radius_y_(0.0f), | 471 radius_y_(0.0f), |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 int GestureEvent::GetLowestTouchId() const { | 771 int GestureEvent::GetLowestTouchId() const { |
769 if (touch_ids_bitfield_ == 0) | 772 if (touch_ids_bitfield_ == 0) |
770 return -1; | 773 return -1; |
771 int i = -1; | 774 int i = -1; |
772 // Find the index of the least significant 1 bit | 775 // Find the index of the least significant 1 bit |
773 while (!(1 << ++i & touch_ids_bitfield_)); | 776 while (!(1 << ++i & touch_ids_bitfield_)); |
774 return i; | 777 return i; |
775 } | 778 } |
776 | 779 |
777 } // namespace ui | 780 } // namespace ui |
OLD | NEW |