| 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 10 matching lines...) Expand all Loading... |
| 21 using blink::WebTouchPoint; | 21 using blink::WebTouchPoint; |
| 22 using ui::LatencyInfo; | 22 using ui::LatencyInfo; |
| 23 | 23 |
| 24 namespace content { | 24 namespace content { |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 // Time interval at which touchmove events will be forwarded to the client while | 27 // Time interval at which touchmove events will be forwarded to the client while |
| 28 // scrolling is active and possible. | 28 // scrolling is active and possible. |
| 29 const double kAsyncTouchMoveIntervalSec = .2; | 29 const double kAsyncTouchMoveIntervalSec = .2; |
| 30 | 30 |
| 31 // A sanity check on touches received to ensure that touch movement outside |
| 32 // the platform slop region will cause scrolling. |
| 33 const double kMaxConceivablePlatformSlopRegionLengthDipsSquared = 60. * 60.; |
| 34 |
| 31 TouchEventWithLatencyInfo ObtainCancelEventForTouchEvent( | 35 TouchEventWithLatencyInfo ObtainCancelEventForTouchEvent( |
| 32 const TouchEventWithLatencyInfo& event_to_cancel) { | 36 const TouchEventWithLatencyInfo& event_to_cancel) { |
| 33 TouchEventWithLatencyInfo event = event_to_cancel; | 37 TouchEventWithLatencyInfo event = event_to_cancel; |
| 34 WebTouchEventTraits::ResetTypeAndTouchStates( | 38 WebTouchEventTraits::ResetTypeAndTouchStates( |
| 35 WebInputEvent::TouchCancel, | 39 WebInputEvent::TouchCancel, |
| 36 // TODO(rbyers): Shouldn't we use a fresh timestamp? | 40 // TODO(rbyers): Shouldn't we use a fresh timestamp? |
| 37 event.event.timeStampSeconds(), &event.event); | 41 event.event.timeStampSeconds(), &event.event); |
| 38 return event; | 42 return event; |
| 39 } | 43 } |
| 40 | 44 |
| (...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) | 912 if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) |
| 909 send_touch_events_async_ = false; | 913 send_touch_events_async_ = false; |
| 910 has_handler_for_current_sequence_ |= | 914 has_handler_for_current_sequence_ |= |
| 911 ack_result != INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; | 915 ack_result != INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; |
| 912 } else if (WebTouchEventTraits::IsTouchSequenceEnd(event)) { | 916 } else if (WebTouchEventTraits::IsTouchSequenceEnd(event)) { |
| 913 has_handler_for_current_sequence_ = false; | 917 has_handler_for_current_sequence_ = false; |
| 914 } | 918 } |
| 915 } | 919 } |
| 916 | 920 |
| 917 } // namespace content | 921 } // namespace content |
| OLD | NEW |