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

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

Issue 613373004: Adopt ui::GestureConfiguration on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move all the methods to superclass Created 6 years, 1 month 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
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_EVENTS_GESTURES_GESTURE_CONFIGURATION_H_
6 #define UI_EVENTS_GESTURES_GESTURE_CONFIGURATION_H_
7
8 #include "base/basictypes.h"
9 #include "ui/events/events_base_export.h"
10
11 namespace ui {
12
13 // TODO: Expand this design to support multiple OS configuration
14 // approaches (windows, chrome, others). This would turn into an
15 // abstract base class.
16
17 class EVENTS_BASE_EXPORT GestureConfiguration {
18 public:
19 // Ordered alphabetically ignoring underscores, to align with the
20 // associated list of prefs in gesture_prefs_aura.cc.
21 static float default_radius() {
22 return default_radius_;
23 }
24 static void set_default_radius(float radius) {
25 default_radius_ = radius;
26 }
27 static int fling_max_cancel_to_down_time_in_ms() {
28 return fling_max_cancel_to_down_time_in_ms_;
29 }
30 static void set_fling_max_cancel_to_down_time_in_ms(int val) {
31 fling_max_cancel_to_down_time_in_ms_ = val;
32 }
33 static int fling_max_tap_gap_time_in_ms() {
34 return fling_max_tap_gap_time_in_ms_;
35 }
36 static void set_fling_max_tap_gap_time_in_ms(int val) {
37 fling_max_tap_gap_time_in_ms_ = val;
38 }
39 static int long_press_time_in_ms() {
40 return long_press_time_in_ms_;
41 }
42 static int semi_long_press_time_in_ms() {
43 return semi_long_press_time_in_ms_;
44 }
45 static float max_distance_for_two_finger_tap_in_pixels() {
46 return max_distance_for_two_finger_tap_in_pixels_;
47 }
48 static void set_max_distance_for_two_finger_tap_in_pixels(float val) {
49 max_distance_for_two_finger_tap_in_pixels_ = val;
50 }
51 static void set_long_press_time_in_ms(int val) {
52 long_press_time_in_ms_ = val;
53 }
54 static void set_semi_long_press_time_in_ms(int val) {
55 semi_long_press_time_in_ms_ = val;
56 }
57 static int max_time_between_double_click_in_ms() {
58 return max_time_between_double_click_in_ms_;
59 }
60 static void set_max_time_between_double_click_in_ms(int val) {
61 max_time_between_double_click_in_ms_ = val;
62 }
63 static float max_separation_for_gesture_touches_in_pixels() {
64 return max_separation_for_gesture_touches_in_pixels_;
65 }
66 static void set_max_separation_for_gesture_touches_in_pixels(float val) {
67 max_separation_for_gesture_touches_in_pixels_ = val;
68 }
69 static float max_swipe_deviation_angle() {
70 return max_swipe_deviation_angle_;
71 }
72 static void set_max_swipe_deviation_angle(float val) {
73 max_swipe_deviation_angle_ = val;
74 }
75 static int max_touch_down_duration_for_click_in_ms() {
76 return max_touch_down_duration_for_click_in_ms_;
77 }
78 static void set_max_touch_down_duration_for_click_in_ms(int val) {
79 max_touch_down_duration_for_click_in_ms_ = val;
80 }
81 static float max_touch_move_in_pixels_for_click() {
82 return max_touch_move_in_pixels_for_click_;
83 }
84 static void set_max_touch_move_in_pixels_for_click(float val) {
85 max_touch_move_in_pixels_for_click_ = val;
86 }
87 static float max_distance_between_taps_for_double_tap() {
88 return max_distance_between_taps_for_double_tap_;
89 }
90 static void set_max_distance_between_taps_for_double_tap(float val) {
91 max_distance_between_taps_for_double_tap_ = val;
92 }
93 static float min_distance_for_pinch_scroll_in_pixels() {
94 return min_distance_for_pinch_scroll_in_pixels_;
95 }
96 static void set_min_distance_for_pinch_scroll_in_pixels(float val) {
97 min_distance_for_pinch_scroll_in_pixels_ = val;
98 }
99 static float min_pinch_update_distance_in_pixels() {
100 return min_pinch_update_distance_in_pixels_;
101 }
102 static void set_min_pinch_update_distance_in_pixels(float val) {
103 min_pinch_update_distance_in_pixels_ = val;
104 }
105 static float min_scroll_velocity() {
106 return min_scroll_velocity_;
107 }
108 static void set_min_scroll_velocity(float val) {
109 min_scroll_velocity_ = val;
110 }
111 static float min_swipe_speed() {
112 return min_swipe_speed_;
113 }
114 static void set_min_swipe_speed(float val) {
115 min_swipe_speed_ = val;
116 }
117 static float min_scaling_span_in_pixels() {
118 return min_scaling_span_in_pixels_;
119 };
120 static void set_min_scaling_span_in_pixels(float val) {
121 min_scaling_span_in_pixels_ = val;
122 }
123 static int show_press_delay_in_ms() {
124 return show_press_delay_in_ms_;
125 }
126 static int set_show_press_delay_in_ms(int val) {
127 return show_press_delay_in_ms_ = val;
128 }
129 static int scroll_debounce_interval_in_ms() {
130 return scroll_debounce_interval_in_ms_;
131 }
132 static int set_scroll_debounce_interval_in_ms(int val) {
133 return scroll_debounce_interval_in_ms_ = val;
134 }
135 static float fling_velocity_cap() {
136 return fling_velocity_cap_;
137 }
138 static void set_fling_velocity_cap(float val) {
139 fling_velocity_cap_ = val;
140 }
141 // TODO(davemoore): Move into chrome/browser/ui.
142 static int tab_scrub_activation_delay_in_ms() {
143 return tab_scrub_activation_delay_in_ms_;
144 }
145 static void set_tab_scrub_activation_delay_in_ms(int val) {
146 tab_scrub_activation_delay_in_ms_ = val;
147 }
148
149 private:
150 // These are listed in alphabetical order ignoring underscores, to
151 // align with the associated list of preferences in
152 // gesture_prefs_aura.cc. These two lists should be kept in sync.
153
154 // The default touch radius length used when the only information given
155 // by the device is the touch center.
156 static float default_radius_;
157
158 // The maximum allowed distance between two fingers for a two finger tap. If
159 // the distance between two fingers is greater than this value, we will not
160 // recognize a two finger tap.
161 static float max_distance_for_two_finger_tap_in_pixels_;
162
163 // Maximum time between a GestureFlingCancel and a mousedown such that the
164 // mousedown is considered associated with the cancel event.
165 static int fling_max_cancel_to_down_time_in_ms_;
166
167 // Maxium time between a mousedown/mouseup pair that is considered to be a
168 // suppressable tap.
169 static int fling_max_tap_gap_time_in_ms_;
170
171 static int long_press_time_in_ms_;
172 static int semi_long_press_time_in_ms_;
173 static int max_time_between_double_click_in_ms_;
174 static float max_separation_for_gesture_touches_in_pixels_;
175 static float max_swipe_deviation_angle_;
176 static int max_touch_down_duration_for_click_in_ms_;
177 static float max_touch_move_in_pixels_for_click_;
178 static float max_distance_between_taps_for_double_tap_;
179 static float min_distance_for_pinch_scroll_in_pixels_;
180 // Only used with --compensate-for-unstable-pinch-zoom.
181 static float min_pinch_update_distance_in_pixels_;
182 static float min_scroll_velocity_;
183 static float min_swipe_speed_;
184 static float min_scaling_span_in_pixels_;
185 static int show_press_delay_in_ms_;
186 static int scroll_debounce_interval_in_ms_;
187 static float fling_velocity_cap_;
188 // TODO(davemoore): Move into chrome/browser/ui.
189 static int tab_scrub_activation_delay_in_ms_;
190
191 DISALLOW_COPY_AND_ASSIGN(GestureConfiguration);
192 };
193
194 } // namespace ui
195
196 #endif // UI_EVENTS_GESTURES_GESTURE_CONFIGURATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698