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

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

Issue 340343013: Provide max gesture bounds and option to ignore touch size during pinch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review Created 6 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_SCALE_GESTURE_DETECTOR_H_ 5 #ifndef UI_EVENTS_GESTURE_DETECTION_SCALE_GESTURE_DETECTOR_H_
6 #define UI_EVENTS_GESTURE_DETECTION_SCALE_GESTURE_DETECTOR_H_ 6 #define UI_EVENTS_GESTURE_DETECTION_SCALE_GESTURE_DETECTOR_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "ui/events/gesture_detection/gesture_detection_export.h" 10 #include "ui/events/gesture_detection/gesture_detection_export.h"
(...skipping 13 matching lines...) Expand all
24 Config(); 24 Config();
25 ~Config(); 25 ~Config();
26 GestureDetector::Config gesture_detector_config; 26 GestureDetector::Config gesture_detector_config;
27 27
28 // Minimum accepted value for TouchMajor while scaling (in dips). 28 // Minimum accepted value for TouchMajor while scaling (in dips).
29 float min_scaling_touch_major; 29 float min_scaling_touch_major;
30 30
31 // Minimum span needed to initiate a scaling gesture (in dips). 31 // Minimum span needed to initiate a scaling gesture (in dips).
32 float min_scaling_span; 32 float min_scaling_span;
33 33
34 // Whether to use touch major values when determining the scale span.
35 // Defaults to false.
36 bool use_touch_major_in_span;
37
34 // Whether double-tap drag scaling is enabled. 38 // Whether double-tap drag scaling is enabled.
35 bool quick_scale_enabled; 39 bool quick_scale_enabled;
36 40
37 // Minimum pinch span change before pinch occurs (in dips). See 41 // Minimum pinch span change before pinch occurs (in dips). See
38 // crbug.com/373318. 42 // crbug.com/373318.
39 float min_pinch_update_span_delta; 43 float min_pinch_update_span_delta;
40 }; 44 };
41 45
42 class ScaleGestureListener { 46 class ScaleGestureListener {
43 public: 47 public:
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 float curr_span_y_; 133 float curr_span_y_;
130 float prev_span_x_; 134 float prev_span_x_;
131 float prev_span_y_; 135 float prev_span_y_;
132 base::TimeTicks curr_time_; 136 base::TimeTicks curr_time_;
133 base::TimeTicks prev_time_; 137 base::TimeTicks prev_time_;
134 bool in_progress_; 138 bool in_progress_;
135 float span_slop_; 139 float span_slop_;
136 float min_span_; 140 float min_span_;
137 141
138 // Bounds for recently seen values. 142 // Bounds for recently seen values.
143 bool use_touch_major_in_span_;
139 float touch_upper_; 144 float touch_upper_;
140 float touch_lower_; 145 float touch_lower_;
141 float touch_history_last_accepted_; 146 float touch_history_last_accepted_;
142 int touch_history_direction_; 147 int touch_history_direction_;
143 base::TimeTicks touch_history_last_accepted_time_; 148 base::TimeTicks touch_history_last_accepted_time_;
144 float touch_min_major_; 149 float touch_min_major_;
150 float touch_max_major_;
145 float double_tap_focus_x_; 151 float double_tap_focus_x_;
146 float double_tap_focus_y_; 152 float double_tap_focus_y_;
147 DoubleTapMode double_tap_mode_; 153 DoubleTapMode double_tap_mode_;
148 154
149 bool event_before_or_above_starting_gesture_event_; 155 bool event_before_or_above_starting_gesture_event_;
150 156
151 scoped_ptr<GestureDetector> gesture_detector_; 157 scoped_ptr<GestureDetector> gesture_detector_;
152 158
153 DISALLOW_COPY_AND_ASSIGN(ScaleGestureDetector); 159 DISALLOW_COPY_AND_ASSIGN(ScaleGestureDetector);
154 }; 160 };
155 161
156 } // namespace ui 162 } // namespace ui
157 163
158 #endif // UI_EVENTS_GESTURE_DETECTION_SCALE_GESTURE_DETECTOR_H_ 164 #endif // UI_EVENTS_GESTURE_DETECTION_SCALE_GESTURE_DETECTOR_H_
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/gesture_provider_unittest.cc ('k') | ui/events/gesture_detection/scale_gesture_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698