| 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_aura.h" | 5 #include "ui/events/gestures/gesture_provider_aura.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_configuration.h" | 10 #include "ui/events/gesture_detection/gesture_configuration.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 ui::LatencyInfo* gesture_latency = event->latency(); | 89 ui::LatencyInfo* gesture_latency = event->latency(); |
| 90 | 90 |
| 91 gesture_latency->CopyLatencyFrom( | 91 gesture_latency->CopyLatencyFrom( |
| 92 last_touch_event_latency_info_, | 92 last_touch_event_latency_info_, |
| 93 ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT); | 93 ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT); |
| 94 gesture_latency->CopyLatencyFrom( | 94 gesture_latency->CopyLatencyFrom( |
| 95 last_touch_event_latency_info_, | 95 last_touch_event_latency_info_, |
| 96 ui::INPUT_EVENT_LATENCY_UI_COMPONENT); | 96 ui::INPUT_EVENT_LATENCY_UI_COMPONENT); |
| 97 gesture_latency->CopyLatencyFrom( | 97 gesture_latency->CopyLatencyFrom( |
| 98 last_touch_event_latency_info_, | 98 last_touch_event_latency_info_, |
| 99 ui::INPUT_EVENT_LATENCY_ACKED_TOUCH_COMPONENT); | 99 ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT); |
| 100 | 100 |
| 101 if (!handling_event_) { | 101 if (!handling_event_) { |
| 102 // Dispatching event caused by timer. | 102 // Dispatching event caused by timer. |
| 103 client_->OnGestureEvent(event.get()); | 103 client_->OnGestureEvent(event.get()); |
| 104 } else { | 104 } else { |
| 105 // Memory managed by ScopedVector pending_gestures_. | 105 // Memory managed by ScopedVector pending_gestures_. |
| 106 pending_gestures_.push_back(event.release()); | 106 pending_gestures_.push_back(event.release()); |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 | 109 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 130 float double_tap_slop_square = | 130 float double_tap_slop_square = |
| 131 GestureConfiguration::GetInstance() | 131 GestureConfiguration::GetInstance() |
| 132 ->max_distance_between_taps_for_double_tap(); | 132 ->max_distance_between_taps_for_double_tap(); |
| 133 double_tap_slop_square *= double_tap_slop_square; | 133 double_tap_slop_square *= double_tap_slop_square; |
| 134 const float delta_x = previous_tap.x - current_tap.x; | 134 const float delta_x = previous_tap.x - current_tap.x; |
| 135 const float delta_y = previous_tap.y - current_tap.y; | 135 const float delta_y = previous_tap.y - current_tap.y; |
| 136 return (delta_x * delta_x + delta_y * delta_y < double_tap_slop_square); | 136 return (delta_x * delta_x + delta_y * delta_y < double_tap_slop_square); |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace content | 139 } // namespace content |
| OLD | NEW |