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

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

Issue 868823002: Expose double-tap platform support via ui::GestureConfiguration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix propagation Created 5 years, 11 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
« no previous file with comments | « no previous file | ui/events/gesture_detection/gesture_configuration.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_CONFIGURATION_H_ 5 #ifndef UI_EVENTS_GESTURE_DETECTION_GESTURE_CONFIGURATION_H_
6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_CONFIGURATION_H_ 6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_CONFIGURATION_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "ui/events/gesture_detection/gesture_detection_export.h" 10 #include "ui/events/gesture_detection/gesture_detection_export.h"
11 #include "ui/events/gesture_detection/velocity_tracker.h" 11 #include "ui/events/gesture_detection/velocity_tracker.h"
12 12
13 namespace ui { 13 namespace ui {
14 14
15 class GESTURE_DETECTION_EXPORT GestureConfiguration { 15 class GESTURE_DETECTION_EXPORT GestureConfiguration {
16 public: 16 public:
17 // Returns the singleton GestureConfiguration. 17 // Returns the singleton GestureConfiguration.
18 static GestureConfiguration* GetInstance(); 18 static GestureConfiguration* GetInstance();
19 19
20 // Ordered alphabetically ignoring underscores. 20 // Ordered alphabetically ignoring underscores.
21 float default_radius() const { return default_radius_; } 21 float default_radius() const { return default_radius_; }
22 void set_default_radius(float radius) { 22 void set_default_radius(float radius) {
23 default_radius_ = radius; 23 default_radius_ = radius;
24 min_scaling_touch_major_ = default_radius_ * 2; 24 min_scaling_touch_major_ = default_radius_ * 2;
25 min_gesture_bounds_length_ = default_radius_; 25 min_gesture_bounds_length_ = default_radius_;
26 } 26 }
27 bool double_tap_enabled() const { return double_tap_enabled_; }
28 void set_double_tap_enabled(bool enabled) { double_tap_enabled_ = enabled; }
27 int double_tap_timeout_in_ms() const { return double_tap_timeout_in_ms_; } 29 int double_tap_timeout_in_ms() const { return double_tap_timeout_in_ms_; }
28 int fling_max_cancel_to_down_time_in_ms() const { 30 int fling_max_cancel_to_down_time_in_ms() const {
29 return fling_max_cancel_to_down_time_in_ms_; 31 return fling_max_cancel_to_down_time_in_ms_;
30 } 32 }
31 void set_fling_max_cancel_to_down_time_in_ms(int val) { 33 void set_fling_max_cancel_to_down_time_in_ms(int val) {
32 fling_max_cancel_to_down_time_in_ms_ = val; 34 fling_max_cancel_to_down_time_in_ms_ = val;
33 } 35 }
34 int fling_max_tap_gap_time_in_ms() const { 36 int fling_max_tap_gap_time_in_ms() const {
35 return fling_max_tap_gap_time_in_ms_; 37 return fling_max_tap_gap_time_in_ms_;
36 } 38 }
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 void set_span_slop(float val) { span_slop_ = val; } 180 void set_span_slop(float val) { span_slop_ = val; }
179 181
180 private: 182 private:
181 // These are listed in alphabetical order ignoring underscores. 183 // These are listed in alphabetical order ignoring underscores.
182 // NOTE: Adding new configuration parameters requires initializing 184 // NOTE: Adding new configuration parameters requires initializing
183 // corresponding entries in aura_test_base.cc's SetUp(). 185 // corresponding entries in aura_test_base.cc's SetUp().
184 186
185 // The default touch radius length used when the only information given 187 // The default touch radius length used when the only information given
186 // by the device is the touch center. 188 // by the device is the touch center.
187 float default_radius_; 189 float default_radius_;
190
191 bool double_tap_enabled_;
188 int double_tap_timeout_in_ms_; 192 int double_tap_timeout_in_ms_;
193
189 // Maximum time between a GestureFlingCancel and a mousedown such that the 194 // Maximum time between a GestureFlingCancel and a mousedown such that the
190 // mousedown is considered associated with the cancel event. 195 // mousedown is considered associated with the cancel event.
191 int fling_max_cancel_to_down_time_in_ms_; 196 int fling_max_cancel_to_down_time_in_ms_;
192 197
193 // Maxium time between a mousedown/mouseup pair that is considered to be a 198 // Maxium time between a mousedown/mouseup pair that is considered to be a
194 // suppressable tap. 199 // suppressable tap.
195 int fling_max_tap_gap_time_in_ms_; 200 int fling_max_tap_gap_time_in_ms_;
196 bool gesture_begin_end_types_enabled_; 201 bool gesture_begin_end_types_enabled_;
197 int long_press_time_in_ms_; 202 int long_press_time_in_ms_;
198 float max_distance_between_taps_for_double_tap_; 203 float max_distance_between_taps_for_double_tap_;
(...skipping 28 matching lines...) Expand all
227 bool two_finger_tap_enabled_; 232 bool two_finger_tap_enabled_;
228 VelocityTracker::Strategy velocity_tracker_strategy_; 233 VelocityTracker::Strategy velocity_tracker_strategy_;
229 234
230 friend struct DefaultSingletonTraits<GestureConfiguration>; 235 friend struct DefaultSingletonTraits<GestureConfiguration>;
231 DISALLOW_COPY_AND_ASSIGN(GestureConfiguration); 236 DISALLOW_COPY_AND_ASSIGN(GestureConfiguration);
232 }; 237 };
233 238
234 } // namespace ui 239 } // namespace ui
235 240
236 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_CONFIGURATION_H_ 241 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_CONFIGURATION_H_
OLDNEW
« no previous file with comments | « no previous file | ui/events/gesture_detection/gesture_configuration.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698