| 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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 CHECK(delegate_); | 490 CHECK(delegate_); |
| 491 } | 491 } |
| 492 | 492 |
| 493 GestureSequence::~GestureSequence() { | 493 GestureSequence::~GestureSequence() { |
| 494 } | 494 } |
| 495 | 495 |
| 496 GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture( | 496 GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture( |
| 497 const TouchEvent& event, | 497 const TouchEvent& event, |
| 498 EventResult result) { | 498 EventResult result) { |
| 499 StopTimersIfRequired(event); | 499 StopTimersIfRequired(event); |
| 500 last_touch_location_ = event.location(); | 500 last_touch_location_ = gfx::ToFlooredPoint(event.location()); |
| 501 if (result & ER_CONSUMED) | 501 if (result & ER_CONSUMED) |
| 502 return NULL; | 502 return NULL; |
| 503 | 503 |
| 504 // Set a limit on the number of simultaneous touches in a gesture. | 504 // Set a limit on the number of simultaneous touches in a gesture. |
| 505 if (event.touch_id() >= kMaxGesturePoints) | 505 if (event.touch_id() >= kMaxGesturePoints) |
| 506 return NULL; | 506 return NULL; |
| 507 | 507 |
| 508 if (event.type() == ui::ET_TOUCH_PRESSED) { | 508 if (event.type() == ui::ET_TOUCH_PRESSED) { |
| 509 if (point_count_ == kMaxGesturePoints) | 509 if (point_count_ == kMaxGesturePoints) |
| 510 return NULL; | 510 return NULL; |
| (...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1458 } | 1458 } |
| 1459 | 1459 |
| 1460 void GestureSequence::StartRailFreeScroll(const GesturePoint& point, | 1460 void GestureSequence::StartRailFreeScroll(const GesturePoint& point, |
| 1461 Gestures* gestures) { | 1461 Gestures* gestures) { |
| 1462 AppendScrollGestureBegin(point, point.first_touch_position(), gestures); | 1462 AppendScrollGestureBegin(point, point.first_touch_position(), gestures); |
| 1463 scroll_type_ = ST_FREE; | 1463 scroll_type_ = ST_FREE; |
| 1464 set_state(GS_SCROLL); | 1464 set_state(GS_SCROLL); |
| 1465 } | 1465 } |
| 1466 | 1466 |
| 1467 } // namespace ui | 1467 } // namespace ui |
| OLD | NEW |