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 28 matching lines...) Expand all Loading... |
39 WebInputEvent::TouchCancel, | 39 WebInputEvent::TouchCancel, |
40 // TODO(rbyers): Shouldn't we use a fresh timestamp? | 40 // TODO(rbyers): Shouldn't we use a fresh timestamp? |
41 event.event.timeStampSeconds, | 41 event.event.timeStampSeconds, |
42 &event.event); | 42 &event.event); |
43 return event; | 43 return event; |
44 } | 44 } |
45 | 45 |
46 bool ShouldTouchTriggerTimeout(const WebTouchEvent& event) { | 46 bool ShouldTouchTriggerTimeout(const WebTouchEvent& event) { |
47 return (event.type == WebInputEvent::TouchStart || | 47 return (event.type == WebInputEvent::TouchStart || |
48 event.type == WebInputEvent::TouchMove) && | 48 event.type == WebInputEvent::TouchMove) && |
49 WebInputEventTraits::WillReceiveAckFromRenderer(event) && | 49 WebInputEventTraits::ShouldBlockEventStream(event) && event.cancelable; |
50 event.cancelable; | |
51 } | 50 } |
52 | 51 |
53 // Compare all properties of touch points to determine the state. | 52 // Compare all properties of touch points to determine the state. |
54 bool HasPointChanged(const WebTouchPoint& point_1, | 53 bool HasPointChanged(const WebTouchPoint& point_1, |
55 const WebTouchPoint& point_2) { | 54 const WebTouchPoint& point_2) { |
56 DCHECK_EQ(point_1.id, point_2.id); | 55 DCHECK_EQ(point_1.id, point_2.id); |
57 if (point_1.screenPosition != point_2.screenPosition || | 56 if (point_1.screenPosition != point_2.screenPosition || |
58 point_1.position != point_2.position || | 57 point_1.position != point_2.position || |
59 point_1.radiusX != point_2.radiusX || | 58 point_1.radiusX != point_2.radiusX || |
60 point_1.radiusY != point_2.radiusY || | 59 point_1.radiusY != point_2.radiusY || |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) | 880 if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) |
882 send_touch_events_async_ = false; | 881 send_touch_events_async_ = false; |
883 has_handler_for_current_sequence_ |= | 882 has_handler_for_current_sequence_ |= |
884 ack_result != INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; | 883 ack_result != INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; |
885 } else if (WebTouchEventTraits::IsTouchSequenceEnd(event)) { | 884 } else if (WebTouchEventTraits::IsTouchSequenceEnd(event)) { |
886 has_handler_for_current_sequence_ = false; | 885 has_handler_for_current_sequence_ = false; |
887 } | 886 } |
888 } | 887 } |
889 | 888 |
890 } // namespace content | 889 } // namespace content |
OLD | NEW |