| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_provider_impl.h" | 5 #include "ui/events/gestures/gesture_provider_impl.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "ui/events/event.h" | 9 #include "ui/events/event.h" |
| 10 #include "ui/events/gesture_detection/gesture_config_helper.h" | 10 #include "ui/events/gesture_detection/gesture_config_helper.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 gesture.time - base::TimeTicks(), details)); | 84 gesture.time - base::TimeTicks(), details)); |
| 85 | 85 |
| 86 ui::LatencyInfo* gesture_latency = event->latency(); | 86 ui::LatencyInfo* gesture_latency = event->latency(); |
| 87 | 87 |
| 88 gesture_latency->CopyLatencyFrom(last_touch_event_latency_info_, | 88 gesture_latency->CopyLatencyFrom(last_touch_event_latency_info_, |
| 89 ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT); | 89 ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT); |
| 90 gesture_latency->CopyLatencyFrom(last_touch_event_latency_info_, | 90 gesture_latency->CopyLatencyFrom(last_touch_event_latency_info_, |
| 91 ui::INPUT_EVENT_LATENCY_UI_COMPONENT); | 91 ui::INPUT_EVENT_LATENCY_UI_COMPONENT); |
| 92 gesture_latency->CopyLatencyFrom( | 92 gesture_latency->CopyLatencyFrom( |
| 93 last_touch_event_latency_info_, | 93 last_touch_event_latency_info_, |
| 94 ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT); | 94 ui::INPUT_EVENT_LATENCY_ACKED_TOUCH_COMPONENT); |
| 95 | 95 |
| 96 if (!handling_event_) { | 96 if (!handling_event_) { |
| 97 // Dispatching event caused by timer. | 97 // Dispatching event caused by timer. |
| 98 client_->OnGestureEvent(event.get()); | 98 client_->OnGestureEvent(event.get()); |
| 99 } else { | 99 } else { |
| 100 // Memory managed by ScopedVector pending_gestures_. | 100 // Memory managed by ScopedVector pending_gestures_. |
| 101 pending_gestures_.push_back(event.release()); | 101 pending_gestures_.push_back(event.release()); |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 123 | 123 |
| 124 float double_tap_slop_square = | 124 float double_tap_slop_square = |
| 125 GestureConfiguration::max_distance_between_taps_for_double_tap(); | 125 GestureConfiguration::max_distance_between_taps_for_double_tap(); |
| 126 double_tap_slop_square *= double_tap_slop_square; | 126 double_tap_slop_square *= double_tap_slop_square; |
| 127 const float delta_x = previous_tap.x - current_tap.x; | 127 const float delta_x = previous_tap.x - current_tap.x; |
| 128 const float delta_y = previous_tap.y - current_tap.y; | 128 const float delta_y = previous_tap.y - current_tap.y; |
| 129 return (delta_x * delta_x + delta_y * delta_y < double_tap_slop_square); | 129 return (delta_x * delta_x + delta_y * delta_y < double_tap_slop_square); |
| 130 } | 130 } |
| 131 | 131 |
| 132 } // namespace content | 132 } // namespace content |
| OLD | NEW |