| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/renderer_host/input/touch_event_queue.h" | 5 #include "content/browser/renderer_host/input/touch_event_queue.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 if (event.type == WebInputEvent::TouchEnd || | 303 if (event.type == WebInputEvent::TouchEnd || |
| 304 event.type == WebInputEvent::TouchCancel) | 304 event.type == WebInputEvent::TouchCancel) |
| 305 suppressing_touchmoves_ = false; | 305 suppressing_touchmoves_ = false; |
| 306 | 306 |
| 307 if (event.type != WebInputEvent::TouchMove) | 307 if (event.type != WebInputEvent::TouchMove) |
| 308 return false; | 308 return false; |
| 309 | 309 |
| 310 if (suppressing_touchmoves_) { | 310 if (suppressing_touchmoves_) { |
| 311 if (event.touchesLength > 1) { | 311 if (event.touchesLength > 1) { |
| 312 suppressing_touchmoves_ = false; | 312 suppressing_touchmoves_ = false; |
| 313 } else if (event.causesScrollingIfUncanceled) { | 313 } else if (event.movedBeyondSlopRegion) { |
| 314 suppressing_touchmoves_ = false; | 314 suppressing_touchmoves_ = false; |
| 315 } else { | 315 } else { |
| 316 // No sane slop region should be larger than 60 DIPs. | 316 // No sane slop region should be larger than 60 DIPs. |
| 317 DCHECK_LT((gfx::PointF(event.touches[0].position) - | 317 DCHECK_LT((gfx::PointF(event.touches[0].position) - |
| 318 touch_start_location_).LengthSquared(), | 318 touch_start_location_).LengthSquared(), |
| 319 kMaxConceivablePlatformSlopRegionLengthDipsSquared); | 319 kMaxConceivablePlatformSlopRegionLengthDipsSquared); |
| 320 } | 320 } |
| 321 } | 321 } |
| 322 | 322 |
| 323 return suppressing_touchmoves_; | 323 return suppressing_touchmoves_; |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) | 878 if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) |
| 879 send_touch_events_async_ = false; | 879 send_touch_events_async_ = false; |
| 880 has_handler_for_current_sequence_ |= | 880 has_handler_for_current_sequence_ |= |
| 881 ack_result != INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; | 881 ack_result != INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; |
| 882 } else if (WebTouchEventTraits::IsTouchSequenceEnd(event)) { | 882 } else if (WebTouchEventTraits::IsTouchSequenceEnd(event)) { |
| 883 has_handler_for_current_sequence_ = false; | 883 has_handler_for_current_sequence_ = false; |
| 884 } | 884 } |
| 885 } | 885 } |
| 886 | 886 |
| 887 } // namespace content | 887 } // namespace content |
| OLD | NEW |