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

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

Issue 586933003: fling: Remove a bunch of code for configuring fling curves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar Created 6 years, 3 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 | « ui/aura/test/aura_test_base.cc ('k') | ui/events/gestures/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 (c) 2013 The Chromium Authors. All rights reserved. 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 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_GESTURES_GESTURE_CONFIGURATION_H_ 5 #ifndef UI_EVENTS_GESTURES_GESTURE_CONFIGURATION_H_
6 #define UI_EVENTS_GESTURES_GESTURE_CONFIGURATION_H_ 6 #define UI_EVENTS_GESTURES_GESTURE_CONFIGURATION_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "ui/events/events_base_export.h" 9 #include "ui/events/events_base_export.h"
10 10
11 namespace ui { 11 namespace ui {
12 12
13 // TODO: Expand this design to support multiple OS configuration 13 // TODO: Expand this design to support multiple OS configuration
14 // approaches (windows, chrome, others). This would turn into an 14 // approaches (windows, chrome, others). This would turn into an
15 // abstract base class. 15 // abstract base class.
16 16
17 class EVENTS_BASE_EXPORT GestureConfiguration { 17 class EVENTS_BASE_EXPORT GestureConfiguration {
18 public: 18 public:
19 // Number of parameters in the array of parameters for the fling acceleration
20 // curve.
21 static const int NumAccelParams = 4;
22
23 // Ordered alphabetically ignoring underscores, to align with the 19 // Ordered alphabetically ignoring underscores, to align with the
24 // associated list of prefs in gesture_prefs_aura.cc. 20 // associated list of prefs in gesture_prefs_aura.cc.
25 static int default_radius() { 21 static int default_radius() {
26 return default_radius_; 22 return default_radius_;
27 } 23 }
28 static void set_default_radius(int radius) { default_radius_ = radius; } 24 static void set_default_radius(int radius) { default_radius_ = radius; }
29 static int fling_max_cancel_to_down_time_in_ms() { 25 static int fling_max_cancel_to_down_time_in_ms() {
30 return fling_max_cancel_to_down_time_in_ms_; 26 return fling_max_cancel_to_down_time_in_ms_;
31 } 27 }
32 static void set_fling_max_cancel_to_down_time_in_ms(int val) { 28 static void set_fling_max_cancel_to_down_time_in_ms(int val) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 123 }
128 static int set_show_press_delay_in_ms(int val) { 124 static int set_show_press_delay_in_ms(int val) {
129 return show_press_delay_in_ms_ = val; 125 return show_press_delay_in_ms_ = val;
130 } 126 }
131 static int scroll_debounce_interval_in_ms() { 127 static int scroll_debounce_interval_in_ms() {
132 return scroll_debounce_interval_in_ms_; 128 return scroll_debounce_interval_in_ms_;
133 } 129 }
134 static int set_scroll_debounce_interval_in_ms(int val) { 130 static int set_scroll_debounce_interval_in_ms(int val) {
135 return scroll_debounce_interval_in_ms_ = val; 131 return scroll_debounce_interval_in_ms_ = val;
136 } 132 }
137 static void set_fling_acceleration_curve_coefficients(int i, float val) {
138 fling_acceleration_curve_coefficients_[i] = val;
139 }
140 static float fling_acceleration_curve_coefficients(int i) {
141 return fling_acceleration_curve_coefficients_[i];
142 }
143 static float fling_velocity_cap() { 133 static float fling_velocity_cap() {
144 return fling_velocity_cap_; 134 return fling_velocity_cap_;
145 } 135 }
146 static void set_fling_velocity_cap(float val) { 136 static void set_fling_velocity_cap(float val) {
147 fling_velocity_cap_ = val; 137 fling_velocity_cap_ = val;
148 } 138 }
149 // TODO(davemoore): Move into chrome/browser/ui. 139 // TODO(davemoore): Move into chrome/browser/ui.
150 static int tab_scrub_activation_delay_in_ms() { 140 static int tab_scrub_activation_delay_in_ms() {
151 return tab_scrub_activation_delay_in_ms_; 141 return tab_scrub_activation_delay_in_ms_;
152 } 142 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 static double max_touch_move_in_pixels_for_click_; 175 static double max_touch_move_in_pixels_for_click_;
186 static double max_distance_between_taps_for_double_tap_; 176 static double max_distance_between_taps_for_double_tap_;
187 static double min_distance_for_pinch_scroll_in_pixels_; 177 static double min_distance_for_pinch_scroll_in_pixels_;
188 // Only used with --compensate-for-unstable-pinch-zoom. 178 // Only used with --compensate-for-unstable-pinch-zoom.
189 static double min_pinch_update_distance_in_pixels_; 179 static double min_pinch_update_distance_in_pixels_;
190 static float min_scroll_velocity_; 180 static float min_scroll_velocity_;
191 static double min_swipe_speed_; 181 static double min_swipe_speed_;
192 static int min_scaling_span_in_pixels_; 182 static int min_scaling_span_in_pixels_;
193 static int show_press_delay_in_ms_; 183 static int show_press_delay_in_ms_;
194 static int scroll_debounce_interval_in_ms_; 184 static int scroll_debounce_interval_in_ms_;
195 static float fling_acceleration_curve_coefficients_[NumAccelParams];
196 static float fling_velocity_cap_; 185 static float fling_velocity_cap_;
197 // TODO(davemoore): Move into chrome/browser/ui. 186 // TODO(davemoore): Move into chrome/browser/ui.
198 static int tab_scrub_activation_delay_in_ms_; 187 static int tab_scrub_activation_delay_in_ms_;
199 188
200 DISALLOW_COPY_AND_ASSIGN(GestureConfiguration); 189 DISALLOW_COPY_AND_ASSIGN(GestureConfiguration);
201 }; 190 };
202 191
203 } // namespace ui 192 } // namespace ui
204 193
205 #endif // UI_EVENTS_GESTURES_GESTURE_CONFIGURATION_H_ 194 #endif // UI_EVENTS_GESTURES_GESTURE_CONFIGURATION_H_
OLDNEW
« no previous file with comments | « ui/aura/test/aura_test_base.cc ('k') | ui/events/gestures/gesture_configuration.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698