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/gestures/gesture_sequence.h" | 5 #include "ui/events/gestures/gesture_sequence.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 } | 505 } |
506 | 506 |
507 GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture( | 507 GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture( |
508 const TouchEvent& event, | 508 const TouchEvent& event, |
509 EventResult result) { | 509 EventResult result) { |
510 StopTimersIfRequired(event); | 510 StopTimersIfRequired(event); |
511 last_touch_location_ = event.location(); | 511 last_touch_location_ = event.location(); |
512 if (result & ER_CONSUMED) | 512 if (result & ER_CONSUMED) |
513 return NULL; | 513 return NULL; |
514 | 514 |
| 515 LOG(ERROR) << "GS::ProcessTouchEventForGesture, type=" << event.type(); |
515 // Set a limit on the number of simultaneous touches in a gesture. | 516 // Set a limit on the number of simultaneous touches in a gesture. |
516 if (event.touch_id() >= kMaxGesturePoints) | 517 if (event.touch_id() >= kMaxGesturePoints) |
517 return NULL; | 518 return NULL; |
518 | 519 |
519 if (event.type() == ui::ET_TOUCH_PRESSED) { | 520 if (event.type() == ui::ET_TOUCH_PRESSED) { |
520 if (point_count_ == kMaxGesturePoints) | 521 if (point_count_ == kMaxGesturePoints) |
521 return NULL; | 522 return NULL; |
522 GesturePoint* new_point = &points_[event.touch_id()]; | 523 GesturePoint* new_point = &points_[event.touch_id()]; |
523 // We shouldn't be able to get two PRESSED events from the same | 524 // We shouldn't be able to get two PRESSED events from the same |
524 // finger without either a RELEASE or CANCEL in between. But let's not crash | 525 // finger without either a RELEASE or CANCEL in between. But let's not crash |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1478 } | 1479 } |
1479 | 1480 |
1480 void GestureSequence::StartRailFreeScroll(const GesturePoint& point, | 1481 void GestureSequence::StartRailFreeScroll(const GesturePoint& point, |
1481 Gestures* gestures) { | 1482 Gestures* gestures) { |
1482 AppendScrollGestureBegin(point, point.first_touch_position(), gestures); | 1483 AppendScrollGestureBegin(point, point.first_touch_position(), gestures); |
1483 scroll_type_ = ST_FREE; | 1484 scroll_type_ = ST_FREE; |
1484 set_state(GS_SCROLL); | 1485 set_state(GS_SCROLL); |
1485 } | 1486 } |
1486 | 1487 |
1487 } // namespace ui | 1488 } // namespace ui |
OLD | NEW |