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/base/events/event.h" | 5 #include "ui/base/events/event.h" |
6 | 6 |
7 #if defined(USE_X11) | 7 #if defined(USE_X11) |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 data_(data), | 498 data_(data), |
499 source_operations_(source_operations) { | 499 source_operations_(source_operations) { |
500 } | 500 } |
501 | 501 |
502 //////////////////////////////////////////////////////////////////////////////// | 502 //////////////////////////////////////////////////////////////////////////////// |
503 // ScrollEvent | 503 // ScrollEvent |
504 | 504 |
505 ScrollEvent::ScrollEvent(const base::NativeEvent& native_event) | 505 ScrollEvent::ScrollEvent(const base::NativeEvent& native_event) |
506 : MouseEvent(native_event) { | 506 : MouseEvent(native_event) { |
507 if (type() == ET_SCROLL) { | 507 if (type() == ET_SCROLL) { |
508 GetScrollOffsets(native_event, &x_offset_, &y_offset_); | 508 GetScrollOffsets(native_event, &x_offset_, &y_offset_, &finger_count_); |
509 double start, end; | 509 double start, end; |
510 GetGestureTimes(native_event, &start, &end); | 510 GetGestureTimes(native_event, &start, &end); |
511 } else if (type() == ET_SCROLL_FLING_START) { | 511 } else if (type() == ET_SCROLL_FLING_START) { |
512 bool is_cancel; | 512 bool is_cancel; |
513 GetFlingData(native_event, &x_offset_, &y_offset_, &is_cancel); | 513 GetFlingData(native_event, &x_offset_, &y_offset_, &is_cancel); |
514 } | 514 } |
515 } | 515 } |
516 | 516 |
517 ScrollEvent::ScrollEvent(EventType type, | 517 ScrollEvent::ScrollEvent(EventType type, |
518 const gfx::Point& location, | 518 const gfx::Point& location, |
(...skipping 27 matching lines...) Expand all Loading... |
546 int GestureEvent::GetLowestTouchId() const { | 546 int GestureEvent::GetLowestTouchId() const { |
547 if (touch_ids_bitfield_ == 0) | 547 if (touch_ids_bitfield_ == 0) |
548 return -1; | 548 return -1; |
549 int i = -1; | 549 int i = -1; |
550 // Find the index of the least significant 1 bit | 550 // Find the index of the least significant 1 bit |
551 while (!(1 << ++i & touch_ids_bitfield_)); | 551 while (!(1 << ++i & touch_ids_bitfield_)); |
552 return i; | 552 return i; |
553 } | 553 } |
554 | 554 |
555 } // namespace ui | 555 } // namespace ui |
OLD | NEW |