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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // slop determination when using fractional DIP coordinates (assuming the slop | 25 // slop determination when using fractional DIP coordinates (assuming the slop |
26 // region and DPI scale are reasonably proportioned). | 26 // region and DPI scale are reasonably proportioned). |
27 const float kSlopEpsilon = .05f; | 27 const float kSlopEpsilon = .05f; |
28 | 28 |
29 typedef std::vector<TouchEventWithLatencyInfo> WebTouchEventWithLatencyList; | 29 typedef std::vector<TouchEventWithLatencyInfo> WebTouchEventWithLatencyList; |
30 | 30 |
31 TouchEventWithLatencyInfo ObtainCancelEventForTouchEvent( | 31 TouchEventWithLatencyInfo ObtainCancelEventForTouchEvent( |
32 const TouchEventWithLatencyInfo& event_to_cancel) { | 32 const TouchEventWithLatencyInfo& event_to_cancel) { |
33 TouchEventWithLatencyInfo event = event_to_cancel; | 33 TouchEventWithLatencyInfo event = event_to_cancel; |
34 event.event.type = WebInputEvent::TouchCancel; | 34 event.event.type = WebInputEvent::TouchCancel; |
| 35 event.event.cancelable = false; |
35 for (size_t i = 0; i < event.event.touchesLength; i++) | 36 for (size_t i = 0; i < event.event.touchesLength; i++) |
36 event.event.touches[i].state = WebTouchPoint::StateCancelled; | 37 event.event.touches[i].state = WebTouchPoint::StateCancelled; |
37 return event; | 38 return event; |
38 } | 39 } |
39 | 40 |
40 bool ShouldTouchTypeTriggerTimeout(WebInputEvent::Type type) { | 41 bool ShouldTouchTypeTriggerTimeout(WebInputEvent::Type type) { |
41 return type == WebInputEvent::TouchStart || | 42 return type == WebInputEvent::TouchStart || |
42 type == WebInputEvent::TouchMove; | 43 type == WebInputEvent::TouchMove; |
43 } | 44 } |
44 | 45 |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 } else if (event.type == WebInputEvent::TouchStart) { | 636 } else if (event.type == WebInputEvent::TouchStart) { |
636 for (unsigned i = 0; i < event.touchesLength; ++i) { | 637 for (unsigned i = 0; i < event.touchesLength; ++i) { |
637 const WebTouchPoint& point = event.touches[i]; | 638 const WebTouchPoint& point = event.touches[i]; |
638 if (point.state == WebTouchPoint::StatePressed) | 639 if (point.state == WebTouchPoint::StatePressed) |
639 touch_ack_states_[point.id] = ack_result; | 640 touch_ack_states_[point.id] = ack_result; |
640 } | 641 } |
641 } | 642 } |
642 } | 643 } |
643 | 644 |
644 } // namespace content | 645 } // namespace content |
OLD | NEW |