OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/gesture_prefs_observer_factory_aura.h" | 5 #include "chrome/browser/ui/gesture_prefs_observer_factory_aura.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "chrome/browser/api/prefs/pref_change_registrar.h" | 8 #include "chrome/browser/api/prefs/pref_change_registrar.h" |
9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 prefs::kMaxSeparationForGestureTouchesInPixels)); | 106 prefs::kMaxSeparationForGestureTouchesInPixels)); |
107 GestureConfiguration::set_max_swipe_deviation_ratio( | 107 GestureConfiguration::set_max_swipe_deviation_ratio( |
108 prefs_->GetDouble( | 108 prefs_->GetDouble( |
109 prefs::kMaxSwipeDeviationRatio)); | 109 prefs::kMaxSwipeDeviationRatio)); |
110 GestureConfiguration::set_max_touch_down_duration_in_seconds_for_click( | 110 GestureConfiguration::set_max_touch_down_duration_in_seconds_for_click( |
111 prefs_->GetDouble( | 111 prefs_->GetDouble( |
112 prefs::kMaxTouchDownDurationInSecondsForClick)); | 112 prefs::kMaxTouchDownDurationInSecondsForClick)); |
113 GestureConfiguration::set_max_touch_move_in_pixels_for_click( | 113 GestureConfiguration::set_max_touch_move_in_pixels_for_click( |
114 prefs_->GetDouble( | 114 prefs_->GetDouble( |
115 prefs::kMaxTouchMoveInPixelsForClick)); | 115 prefs::kMaxTouchMoveInPixelsForClick)); |
| 116 GestureConfiguration::set_max_distance_between_taps_for_double_tap( |
| 117 prefs_->GetDouble( |
| 118 prefs::kMaxDistanceBetweenTapsForDoubleTap)); |
116 GestureConfiguration::set_min_distance_for_pinch_scroll_in_pixels( | 119 GestureConfiguration::set_min_distance_for_pinch_scroll_in_pixels( |
117 prefs_->GetDouble( | 120 prefs_->GetDouble( |
118 prefs::kMinDistanceForPinchScrollInPixels)); | 121 prefs::kMinDistanceForPinchScrollInPixels)); |
119 GestureConfiguration::set_min_flick_speed_squared( | 122 GestureConfiguration::set_min_flick_speed_squared( |
120 prefs_->GetDouble( | 123 prefs_->GetDouble( |
121 prefs::kMinFlickSpeedSquared)); | 124 prefs::kMinFlickSpeedSquared)); |
122 GestureConfiguration::set_min_pinch_update_distance_in_pixels( | 125 GestureConfiguration::set_min_pinch_update_distance_in_pixels( |
123 prefs_->GetDouble( | 126 prefs_->GetDouble( |
124 prefs::kMinPinchUpdateDistanceInPixels)); | 127 prefs::kMinPinchUpdateDistanceInPixels)); |
125 GestureConfiguration::set_min_rail_break_velocity( | 128 GestureConfiguration::set_min_rail_break_velocity( |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 PrefService::UNSYNCABLE_PREF); | 197 PrefService::UNSYNCABLE_PREF); |
195 prefs->RegisterDoublePref( | 198 prefs->RegisterDoublePref( |
196 prefs::kMaxTouchDownDurationInSecondsForClick, | 199 prefs::kMaxTouchDownDurationInSecondsForClick, |
197 GestureConfiguration::max_touch_down_duration_in_seconds_for_click(), | 200 GestureConfiguration::max_touch_down_duration_in_seconds_for_click(), |
198 PrefService::UNSYNCABLE_PREF); | 201 PrefService::UNSYNCABLE_PREF); |
199 prefs->RegisterDoublePref( | 202 prefs->RegisterDoublePref( |
200 prefs::kMaxTouchMoveInPixelsForClick, | 203 prefs::kMaxTouchMoveInPixelsForClick, |
201 GestureConfiguration::max_touch_move_in_pixels_for_click(), | 204 GestureConfiguration::max_touch_move_in_pixels_for_click(), |
202 PrefService::UNSYNCABLE_PREF); | 205 PrefService::UNSYNCABLE_PREF); |
203 prefs->RegisterDoublePref( | 206 prefs->RegisterDoublePref( |
| 207 prefs::kMaxDistanceBetweenTapsForDoubleTap, |
| 208 GestureConfiguration::max_distance_between_taps_for_double_tap(), |
| 209 PrefService::UNSYNCABLE_PREF); |
| 210 prefs->RegisterDoublePref( |
204 prefs::kMinDistanceForPinchScrollInPixels, | 211 prefs::kMinDistanceForPinchScrollInPixels, |
205 GestureConfiguration::min_distance_for_pinch_scroll_in_pixels(), | 212 GestureConfiguration::min_distance_for_pinch_scroll_in_pixels(), |
206 PrefService::UNSYNCABLE_PREF); | 213 PrefService::UNSYNCABLE_PREF); |
207 prefs->RegisterDoublePref( | 214 prefs->RegisterDoublePref( |
208 prefs::kMinFlickSpeedSquared, | 215 prefs::kMinFlickSpeedSquared, |
209 GestureConfiguration::min_flick_speed_squared(), | 216 GestureConfiguration::min_flick_speed_squared(), |
210 PrefService::UNSYNCABLE_PREF); | 217 PrefService::UNSYNCABLE_PREF); |
211 prefs->RegisterDoublePref( | 218 prefs->RegisterDoublePref( |
212 prefs::kMinPinchUpdateDistanceInPixels, | 219 prefs::kMinPinchUpdateDistanceInPixels, |
213 GestureConfiguration::min_pinch_update_distance_in_pixels(), | 220 GestureConfiguration::min_pinch_update_distance_in_pixels(), |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 // Use same gesture preferences on incognito windows. | 262 // Use same gesture preferences on incognito windows. |
256 return true; | 263 return true; |
257 } | 264 } |
258 | 265 |
259 bool GesturePrefsObserverFactoryAura::ServiceIsNULLWhileTesting() { | 266 bool GesturePrefsObserverFactoryAura::ServiceIsNULLWhileTesting() { |
260 // Some tests replace the PrefService of the TestingProfile after the | 267 // Some tests replace the PrefService of the TestingProfile after the |
261 // GesturePrefsObserver has been created, which makes Shutdown() | 268 // GesturePrefsObserver has been created, which makes Shutdown() |
262 // remove the registrar from a non-existent PrefService. | 269 // remove the registrar from a non-existent PrefService. |
263 return true; | 270 return true; |
264 } | 271 } |
OLD | NEW |