| 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 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1482 } | 1483 } |
| 1483 | 1484 |
| 1484 void GestureSequence::StartRailFreeScroll(const GesturePoint& point, | 1485 void GestureSequence::StartRailFreeScroll(const GesturePoint& point, |
| 1485 Gestures* gestures) { | 1486 Gestures* gestures) { |
| 1486 AppendScrollGestureBegin(point, point.first_touch_position(), gestures); | 1487 AppendScrollGestureBegin(point, point.first_touch_position(), gestures); |
| 1487 scroll_type_ = ST_FREE; | 1488 scroll_type_ = ST_FREE; |
| 1488 set_state(GS_SCROLL); | 1489 set_state(GS_SCROLL); |
| 1489 } | 1490 } |
| 1490 | 1491 |
| 1491 } // namespace ui | 1492 } // namespace ui |
| OLD | NEW |