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 "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/events/gesture_detection/gesture_detection_export.h" | 10 #include "ui/events/gesture_detection/gesture_detection_export.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 DoubleTapListener* optional_double_tap_listener); | 81 DoubleTapListener* optional_double_tap_listener); |
82 ~GestureDetector(); | 82 ~GestureDetector(); |
83 | 83 |
84 bool OnTouchEvent(const MotionEvent& ev); | 84 bool OnTouchEvent(const MotionEvent& ev); |
85 | 85 |
86 void set_doubletap_listener(DoubleTapListener* double_tap_listener) { | 86 void set_doubletap_listener(DoubleTapListener* double_tap_listener) { |
87 DCHECK(!is_double_tapping_ || double_tap_listener_); | 87 DCHECK(!is_double_tapping_ || double_tap_listener_); |
88 double_tap_listener_ = double_tap_listener; | 88 double_tap_listener_ = double_tap_listener; |
89 } | 89 } |
90 | 90 |
| 91 bool has_doubletap_listener() const { return double_tap_listener_ != NULL; } |
| 92 |
| 93 bool is_double_tapping() const { return is_double_tapping_; } |
| 94 |
91 void set_is_longpress_enabled(bool is_longpress_enabled) { | 95 void set_is_longpress_enabled(bool is_longpress_enabled) { |
92 is_longpress_enabled_ = is_longpress_enabled; | 96 is_longpress_enabled_ = is_longpress_enabled; |
93 } | 97 } |
94 | 98 |
95 bool is_longpress_enabled() const { return is_longpress_enabled_; } | 99 bool is_longpress_enabled() const { return is_longpress_enabled_; } |
96 | 100 |
97 private: | 101 private: |
98 void Init(const Config& config); | 102 void Init(const Config& config); |
99 void OnShowPressTimeout(); | 103 void OnShowPressTimeout(); |
100 void OnLongPressTimeout(); | 104 void OnLongPressTimeout(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 143 |
140 // Determines speed during touch scrolling. | 144 // Determines speed during touch scrolling. |
141 VelocityTrackerState velocity_tracker_; | 145 VelocityTrackerState velocity_tracker_; |
142 | 146 |
143 DISALLOW_COPY_AND_ASSIGN(GestureDetector); | 147 DISALLOW_COPY_AND_ASSIGN(GestureDetector); |
144 }; | 148 }; |
145 | 149 |
146 } // namespace ui | 150 } // namespace ui |
147 | 151 |
148 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_DETECTOR_H_ | 152 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_DETECTOR_H_ |
OLD | NEW |