| 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 #ifndef UI_EVENTS_GESTURE_DETECTION_GESTURE_DETECTOR_H_ | 5 #ifndef UI_EVENTS_GESTURE_DETECTION_GESTURE_DETECTOR_H_ |
| 6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_DETECTOR_H_ | 6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_DETECTOR_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // Note: The listener must never be changed while |is_double_tapping| is true. | 92 // Note: The listener must never be changed while |is_double_tapping| is true. |
| 93 void SetDoubleTapListener(DoubleTapListener* double_tap_listener); | 93 void SetDoubleTapListener(DoubleTapListener* double_tap_listener); |
| 94 | 94 |
| 95 bool has_doubletap_listener() const { return double_tap_listener_ != NULL; } | 95 bool has_doubletap_listener() const { return double_tap_listener_ != NULL; } |
| 96 | 96 |
| 97 bool is_double_tapping() const { return is_double_tapping_; } | 97 bool is_double_tapping() const { return is_double_tapping_; } |
| 98 | 98 |
| 99 void set_longpress_enabled(bool enabled) { longpress_enabled_ = enabled; } | 99 void set_longpress_enabled(bool enabled) { longpress_enabled_ = enabled; } |
| 100 void set_showpress_enabled(bool enabled) { showpress_enabled_ = enabled; } | 100 void set_showpress_enabled(bool enabled) { showpress_enabled_ = enabled; } |
| 101 | 101 |
| 102 // Returns the event storing the initial position of the pointer with given |
| 103 // pointer ID. This returns nullptr if the source event isn't |
| 104 // current_down_event_ or secondary_pointer_down_event_. |
| 105 const MotionEvent* GetSourcePointerDownEvent( |
| 106 const MotionEvent& current_down_event, |
| 107 const MotionEvent& secondary_pointer_down_event, |
| 108 const int pointer_id); |
| 109 |
| 102 private: | 110 private: |
| 103 void Init(const Config& config); | 111 void Init(const Config& config); |
| 104 void OnShowPressTimeout(); | 112 void OnShowPressTimeout(); |
| 105 void OnLongPressTimeout(); | 113 void OnLongPressTimeout(); |
| 106 void OnTapTimeout(); | 114 void OnTapTimeout(); |
| 107 void Cancel(); | 115 void Cancel(); |
| 108 void CancelTaps(); | 116 void CancelTaps(); |
| 109 bool IsRepeatedTap(const MotionEvent& first_down, | 117 bool IsRepeatedTap(const MotionEvent& first_down, |
| 110 const MotionEvent& first_up, | 118 const MotionEvent& first_up, |
| 111 const MotionEvent& second_down) const; | 119 const MotionEvent& second_down) const; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 178 |
| 171 // Determines speed during touch scrolling. | 179 // Determines speed during touch scrolling. |
| 172 VelocityTrackerState velocity_tracker_; | 180 VelocityTrackerState velocity_tracker_; |
| 173 | 181 |
| 174 DISALLOW_COPY_AND_ASSIGN(GestureDetector); | 182 DISALLOW_COPY_AND_ASSIGN(GestureDetector); |
| 175 }; | 183 }; |
| 176 | 184 |
| 177 } // namespace ui | 185 } // namespace ui |
| 178 | 186 |
| 179 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_DETECTOR_H_ | 187 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_DETECTOR_H_ |
| OLD | NEW |