Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: ui/events/gesture_detection/gesture_detector.h

Issue 2175803002: The helper functions for slop region check and subtraction are modified. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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. The source could be either the current_down_event_ or
104 // secondary_pointer_down_event_.
tdresser 2016/07/22 19:51:28 State that this returns nullptr if the source even
sahel 2016/07/25 15:16:33 Done.
105 const MotionEvent* GetSourcePointerDownEvent(
106 const MotionEvent& current_down_event,
107 const MotionEvent& secondary_pointer_down_event,
108 const int pointer_id);
109 int getPointerIndex(const MotionEvent& event, const int pointer_id);
tdresser 2016/07/22 19:51:28 State that this returns -1 if it can't find it.
sahel 2016/07/25 15:16:33 Done.
110
102 private: 111 private:
103 void Init(const Config& config); 112 void Init(const Config& config);
104 void OnShowPressTimeout(); 113 void OnShowPressTimeout();
105 void OnLongPressTimeout(); 114 void OnLongPressTimeout();
106 void OnTapTimeout(); 115 void OnTapTimeout();
107 void Cancel(); 116 void Cancel();
108 void CancelTaps(); 117 void CancelTaps();
109 bool IsRepeatedTap(const MotionEvent& first_down, 118 bool IsRepeatedTap(const MotionEvent& first_down,
110 const MotionEvent& first_up, 119 const MotionEvent& first_up,
111 const MotionEvent& second_down) const; 120 const MotionEvent& second_down) const;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 179
171 // Determines speed during touch scrolling. 180 // Determines speed during touch scrolling.
172 VelocityTrackerState velocity_tracker_; 181 VelocityTrackerState velocity_tracker_;
173 182
174 DISALLOW_COPY_AND_ASSIGN(GestureDetector); 183 DISALLOW_COPY_AND_ASSIGN(GestureDetector);
175 }; 184 };
176 185
177 } // namespace ui 186 } // namespace ui
178 187
179 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_DETECTOR_H_ 188 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_DETECTOR_H_
OLDNEW
« no previous file with comments | « no previous file | ui/events/gesture_detection/gesture_detector.cc » ('j') | ui/events/gesture_detection/gesture_detector.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698