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

Side by Side Diff: chrome/browser/ui/gesture_prefs_observer_factory_aura.cc

Issue 313473002: Remove gesture configuration from about://gesture (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace fix. Created 6 years, 6 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 | Annotate | Revision Log
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 #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 <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/prefs/pref_change_registrar.h" 12 #include "base/prefs/pref_change_registrar.h"
13 #include "base/prefs/pref_service.h" 13 #include "base/prefs/pref_service.h"
14 #include "chrome/browser/chrome_notification_types.h" 14 #include "chrome/browser/chrome_notification_types.h"
15 #include "chrome/browser/profiles/incognito_helpers.h" 15 #include "chrome/browser/profiles/incognito_helpers.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/common/pref_names.h" 17 #include "chrome/common/pref_names.h"
18 #include "components/keyed_service/content/browser_context_dependency_manager.h" 18 #include "components/keyed_service/content/browser_context_dependency_manager.h"
19 #include "components/pref_registry/pref_registry_syncable.h" 19 #include "components/pref_registry/pref_registry_syncable.h"
20 #include "content/public/browser/notification_observer.h" 20 #include "content/public/browser/notification_observer.h"
21 #include "content/public/browser/notification_service.h" 21 #include "content/public/browser/notification_service.h"
22 #include "content/public/browser/overscroll_configuration.h" 22 #include "content/public/browser/overscroll_configuration.h"
23 #include "content/public/common/renderer_preferences.h" 23 #include "content/public/common/renderer_preferences.h"
24 #include "ui/events/gestures/gesture_configuration.h" 24 #include "ui/events/gestures/gesture_configuration.h"
25 25
26 using ui::GestureConfiguration; 26 using ui::GestureConfiguration;
27 27
28 namespace { 28 namespace {
29 29
30 // TODO(tdresser): Remove these deprecated prefs in M38. See crbug.com/379912.
31
32 const char kFlingVelocityCap[] = "gesture.fling_velocity_cap";
33 const char kLongPressTimeInSeconds[] =
34 "gesture.long_press_time_in_seconds";
35 const char kMaxDistanceBetweenTapsForDoubleTap[] =
36 "gesture.max_distance_between_taps_for_double_tap";
37 const char kMaxDistanceForTwoFingerTapInPixels[] =
38 "gesture.max_distance_for_two_finger_tap_in_pixels";
39 const char kMaxSecondsBetweenDoubleClick[] =
40 "gesture.max_seconds_between_double_click";
41 const char kMaxSwipeDeviationRatio[] =
42 "gesture.max_swipe_deviation_ratio";
43 const char kMaxTouchDownDurationInSecondsForClick[] =
44 "gesture.max_touch_down_duration_in_seconds_for_click";
45 const char kMaxTouchMoveInPixelsForClick[] =
46 "gesture.max_touch_move_in_pixels_for_click";
47 const char kMinDistanceForPinchScrollInPixels[] =
48 "gesture.min_distance_for_pinch_scroll_in_pixels";
49 const char kMinFlickSpeedSquared[] =
50 "gesture.min_flick_speed_squared";
51 const char kMinPinchUpdateDistanceInPixels[] =
52 "gesture.min_pinch_update_distance_in_pixels";
53 const char kMinRailBreakVelocity[] =
54 "gesture.min_rail_break_velocity";
55 const char kMinScrollDeltaSquared[] =
56 "gesture.min_scroll_delta_squared";
57 const char kMinSwipeSpeed[] =
58 "gesture.min_swipe_speed";
59 const char kMinTouchDownDurationInSecondsForClick[] =
60 "gesture.min_touch_down_duration_in_seconds_for_click";
61 const char kPointsBufferedForVelocity[] =
62 "gesture.points_buffered_for_velocity";
63 const char kRailBreakProportion[] =
64 "gesture.rail_break_proportion";
65 const char kRailStartProportion[] =
66 "gesture.rail_start_proportion";
67 const char kScrollPredictionSeconds[] =
68 "gesture.scroll_prediction_seconds";
69 const char kShowPressDelayInMS[] =
70 "gesture.show_press_delay_in_ms";
71
30 struct OverscrollPref { 72 struct OverscrollPref {
31 const char* pref_name; 73 const char* pref_name;
32 content::OverscrollConfig config; 74 content::OverscrollConfig config;
33 }; 75 };
34 76
35 const std::vector<OverscrollPref>& GetOverscrollPrefs() { 77 const std::vector<OverscrollPref>& GetOverscrollPrefs() {
36 CR_DEFINE_STATIC_LOCAL(std::vector<OverscrollPref>, overscroll_prefs, ()); 78 CR_DEFINE_STATIC_LOCAL(std::vector<OverscrollPref>, overscroll_prefs, ());
37 if (overscroll_prefs.empty()) { 79 if (overscroll_prefs.empty()) {
38 using namespace content; 80 using namespace content;
39 const OverscrollPref kOverscrollPrefs[] = { 81 const OverscrollPref kOverscrollPrefs[] = {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // Note that this collection of settings should correspond to the settings used 133 // Note that this collection of settings should correspond to the settings used
92 // in ui/events/gestures/gesture_configuration.h 134 // in ui/events/gestures/gesture_configuration.h
93 const char* kPrefsToObserve[] = { 135 const char* kPrefsToObserve[] = {
94 prefs::kFlingAccelerationCurveCoefficient0, 136 prefs::kFlingAccelerationCurveCoefficient0,
95 prefs::kFlingAccelerationCurveCoefficient1, 137 prefs::kFlingAccelerationCurveCoefficient1,
96 prefs::kFlingAccelerationCurveCoefficient2, 138 prefs::kFlingAccelerationCurveCoefficient2,
97 prefs::kFlingAccelerationCurveCoefficient3, 139 prefs::kFlingAccelerationCurveCoefficient3,
98 prefs::kFlingMaxCancelToDownTimeInMs, 140 prefs::kFlingMaxCancelToDownTimeInMs,
99 prefs::kFlingMaxTapGapTimeInMs, 141 prefs::kFlingMaxTapGapTimeInMs,
100 prefs::kTabScrubActivationDelayInMS, 142 prefs::kTabScrubActivationDelayInMS,
101 prefs::kFlingVelocityCap,
102 prefs::kLongPressTimeInSeconds,
103 prefs::kMaxDistanceForTwoFingerTapInPixels,
104 prefs::kMaxSecondsBetweenDoubleClick,
105 prefs::kMaxSeparationForGestureTouchesInPixels, 143 prefs::kMaxSeparationForGestureTouchesInPixels,
106 prefs::kMaxSwipeDeviationRatio,
107 prefs::kMaxTouchDownDurationInSecondsForClick,
108 prefs::kMaxTouchMoveInPixelsForClick,
109 prefs::kMinDistanceForPinchScrollInPixels,
110 prefs::kMinFlickSpeedSquared,
111 prefs::kMinPinchUpdateDistanceInPixels,
112 prefs::kMinRailBreakVelocity,
113 prefs::kMinScrollDeltaSquared,
114 prefs::kMinSwipeSpeed,
115 prefs::kMinTouchDownDurationInSecondsForClick,
116 prefs::kPointsBufferedForVelocity,
117 prefs::kRailBreakProportion,
118 prefs::kRailStartProportion,
119 prefs::kSemiLongPressTimeInSeconds, 144 prefs::kSemiLongPressTimeInSeconds,
120 prefs::kShowPressDelayInMS,
121 }; 145 };
122 146
123 const char* kFlingTouchpadPrefs[] = { 147 const char* kFlingTouchpadPrefs[] = {
124 prefs::kFlingCurveTouchpadAlpha, 148 prefs::kFlingCurveTouchpadAlpha,
125 prefs::kFlingCurveTouchpadBeta, 149 prefs::kFlingCurveTouchpadBeta,
126 prefs::kFlingCurveTouchpadGamma 150 prefs::kFlingCurveTouchpadGamma
127 }; 151 };
128 152
129 const char* kFlingTouchscreenPrefs[] = { 153 const char* kFlingTouchscreenPrefs[] = {
130 prefs::kFlingCurveTouchscreenAlpha, 154 prefs::kFlingCurveTouchscreenAlpha,
131 prefs::kFlingCurveTouchscreenBeta, 155 prefs::kFlingCurveTouchscreenBeta,
132 prefs::kFlingCurveTouchscreenGamma, 156 prefs::kFlingCurveTouchscreenGamma,
133 }; 157 };
134 158
159 const char* kPrefsToRemove[] = {
160 kFlingVelocityCap,
161 kLongPressTimeInSeconds,
162 kMaxDistanceBetweenTapsForDoubleTap,
163 kMaxDistanceForTwoFingerTapInPixels,
164 kMaxSecondsBetweenDoubleClick,
165 kMaxSwipeDeviationRatio,
166 kMaxTouchDownDurationInSecondsForClick,
167 kMaxTouchMoveInPixelsForClick,
168 kMinDistanceForPinchScrollInPixels,
169 kMinFlickSpeedSquared,
170 kMinPinchUpdateDistanceInPixels,
171 kMinRailBreakVelocity,
172 kMinScrollDeltaSquared,
173 kMinSwipeSpeed,
174 kMinTouchDownDurationInSecondsForClick,
175 kPointsBufferedForVelocity,
176 kRailBreakProportion,
177 kRailStartProportion,
178 kScrollPredictionSeconds,
179 kShowPressDelayInMS,
180 };
181
135 GesturePrefsObserver::GesturePrefsObserver(PrefService* prefs) 182 GesturePrefsObserver::GesturePrefsObserver(PrefService* prefs)
136 : prefs_(prefs) { 183 : prefs_(prefs) {
184 // Clear for migration.
185 for (size_t i = 0; i < arraysize(kPrefsToRemove); ++i) {
186 if (prefs->FindPreference(kPrefsToRemove[i]))
187 prefs->ClearPref(kPrefsToRemove[i]);
188 }
189
137 registrar_.Init(prefs); 190 registrar_.Init(prefs);
138 registrar_.RemoveAll(); 191 registrar_.RemoveAll();
139 base::Closure callback = base::Bind(&GesturePrefsObserver::Update, 192 base::Closure callback = base::Bind(&GesturePrefsObserver::Update,
140 base::Unretained(this)); 193 base::Unretained(this));
141 194
142 base::Closure notify_callback = base::Bind(&GesturePrefsObserver::Notify, 195 base::Closure notify_callback = base::Bind(&GesturePrefsObserver::Notify,
143 base::Unretained(this)); 196 base::Unretained(this));
144 197
145 for (size_t i = 0; i < arraysize(kPrefsToObserve); ++i) 198 for (size_t i = 0; i < arraysize(kPrefsToObserve); ++i)
146 registrar_.Add(kPrefsToObserve[i], callback); 199 registrar_.Add(kPrefsToObserve[i], callback);
(...skipping 24 matching lines...) Expand all
171 GestureConfiguration::set_fling_acceleration_curve_coefficients(2, 224 GestureConfiguration::set_fling_acceleration_curve_coefficients(2,
172 prefs_->GetDouble(prefs::kFlingAccelerationCurveCoefficient2)); 225 prefs_->GetDouble(prefs::kFlingAccelerationCurveCoefficient2));
173 GestureConfiguration::set_fling_acceleration_curve_coefficients(3, 226 GestureConfiguration::set_fling_acceleration_curve_coefficients(3,
174 prefs_->GetDouble(prefs::kFlingAccelerationCurveCoefficient3)); 227 prefs_->GetDouble(prefs::kFlingAccelerationCurveCoefficient3));
175 GestureConfiguration::set_fling_max_cancel_to_down_time_in_ms( 228 GestureConfiguration::set_fling_max_cancel_to_down_time_in_ms(
176 prefs_->GetInteger(prefs::kFlingMaxCancelToDownTimeInMs)); 229 prefs_->GetInteger(prefs::kFlingMaxCancelToDownTimeInMs));
177 GestureConfiguration::set_fling_max_tap_gap_time_in_ms( 230 GestureConfiguration::set_fling_max_tap_gap_time_in_ms(
178 prefs_->GetInteger(prefs::kFlingMaxTapGapTimeInMs)); 231 prefs_->GetInteger(prefs::kFlingMaxTapGapTimeInMs));
179 GestureConfiguration::set_tab_scrub_activation_delay_in_ms( 232 GestureConfiguration::set_tab_scrub_activation_delay_in_ms(
180 prefs_->GetInteger(prefs::kTabScrubActivationDelayInMS)); 233 prefs_->GetInteger(prefs::kTabScrubActivationDelayInMS));
181 GestureConfiguration::set_fling_velocity_cap(
182 prefs_->GetDouble(prefs::kFlingVelocityCap));
183 GestureConfiguration::set_long_press_time_in_seconds(
184 prefs_->GetDouble(
185 prefs::kLongPressTimeInSeconds));
186 GestureConfiguration::set_semi_long_press_time_in_seconds( 234 GestureConfiguration::set_semi_long_press_time_in_seconds(
187 prefs_->GetDouble( 235 prefs_->GetDouble(
188 prefs::kSemiLongPressTimeInSeconds)); 236 prefs::kSemiLongPressTimeInSeconds));
189 GestureConfiguration::set_max_distance_for_two_finger_tap_in_pixels(
190 prefs_->GetDouble(
191 prefs::kMaxDistanceForTwoFingerTapInPixels));
192 GestureConfiguration::set_max_seconds_between_double_click(
193 prefs_->GetDouble(
194 prefs::kMaxSecondsBetweenDoubleClick));
195 GestureConfiguration::set_max_separation_for_gesture_touches_in_pixels( 237 GestureConfiguration::set_max_separation_for_gesture_touches_in_pixels(
196 prefs_->GetDouble( 238 prefs_->GetDouble(
197 prefs::kMaxSeparationForGestureTouchesInPixels)); 239 prefs::kMaxSeparationForGestureTouchesInPixels));
198 GestureConfiguration::set_max_swipe_deviation_ratio(
199 prefs_->GetDouble(
200 prefs::kMaxSwipeDeviationRatio));
201 GestureConfiguration::set_max_touch_down_duration_in_seconds_for_click(
202 prefs_->GetDouble(
203 prefs::kMaxTouchDownDurationInSecondsForClick));
204 GestureConfiguration::set_max_touch_move_in_pixels_for_click(
205 prefs_->GetDouble(
206 prefs::kMaxTouchMoveInPixelsForClick));
207 GestureConfiguration::set_max_distance_between_taps_for_double_tap(
208 prefs_->GetDouble(
209 prefs::kMaxDistanceBetweenTapsForDoubleTap));
210 GestureConfiguration::set_min_distance_for_pinch_scroll_in_pixels(
211 prefs_->GetDouble(
212 prefs::kMinDistanceForPinchScrollInPixels));
213 GestureConfiguration::set_min_flick_speed_squared(
214 prefs_->GetDouble(
215 prefs::kMinFlickSpeedSquared));
216 GestureConfiguration::set_min_pinch_update_distance_in_pixels(
217 prefs_->GetDouble(
218 prefs::kMinPinchUpdateDistanceInPixels));
219 GestureConfiguration::set_min_rail_break_velocity(
220 prefs_->GetDouble(
221 prefs::kMinRailBreakVelocity));
222 GestureConfiguration::set_min_scroll_delta_squared(
223 prefs_->GetDouble(
224 prefs::kMinScrollDeltaSquared));
225 GestureConfiguration::set_min_swipe_speed(
226 prefs_->GetDouble(
227 prefs::kMinSwipeSpeed));
228 GestureConfiguration::set_min_touch_down_duration_in_seconds_for_click(
229 prefs_->GetDouble(
230 prefs::kMinTouchDownDurationInSecondsForClick));
231 GestureConfiguration::set_points_buffered_for_velocity(
232 prefs_->GetInteger(
233 prefs::kPointsBufferedForVelocity));
234 GestureConfiguration::set_rail_break_proportion(
235 prefs_->GetDouble(
236 prefs::kRailBreakProportion));
237 GestureConfiguration::set_rail_start_proportion(
238 prefs_->GetDouble(
239 prefs::kRailStartProportion));
240 GestureConfiguration::set_scroll_prediction_seconds(
241 prefs_->GetDouble(prefs::kScrollPredictionSeconds));
242 GestureConfiguration::set_show_press_delay_in_ms(
243 prefs_->GetInteger(prefs::kShowPressDelayInMS));
244 240
245 UpdateOverscrollPrefs(); 241 UpdateOverscrollPrefs();
246 } 242 }
247 243
248 void GesturePrefsObserver::UpdateOverscrollPrefs() { 244 void GesturePrefsObserver::UpdateOverscrollPrefs() {
249 const std::vector<OverscrollPref>& overscroll_prefs = GetOverscrollPrefs(); 245 const std::vector<OverscrollPref>& overscroll_prefs = GetOverscrollPrefs();
250 for (size_t i = 0; i < overscroll_prefs.size(); ++i) { 246 for (size_t i = 0; i < overscroll_prefs.size(); ++i) {
251 content::SetOverscrollConfig(overscroll_prefs[i].config, 247 content::SetOverscrollConfig(overscroll_prefs[i].config,
252 static_cast<float>(prefs_->GetDouble(overscroll_prefs[i].pref_name))); 248 static_cast<float>(prefs_->GetDouble(overscroll_prefs[i].pref_name)));
253 } 249 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 331 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
336 registry->RegisterIntegerPref( 332 registry->RegisterIntegerPref(
337 prefs::kFlingMaxTapGapTimeInMs, 333 prefs::kFlingMaxTapGapTimeInMs,
338 GestureConfiguration::fling_max_tap_gap_time_in_ms(), 334 GestureConfiguration::fling_max_tap_gap_time_in_ms(),
339 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 335 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
340 registry->RegisterIntegerPref( 336 registry->RegisterIntegerPref(
341 prefs::kTabScrubActivationDelayInMS, 337 prefs::kTabScrubActivationDelayInMS,
342 GestureConfiguration::tab_scrub_activation_delay_in_ms(), 338 GestureConfiguration::tab_scrub_activation_delay_in_ms(),
343 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 339 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
344 registry->RegisterDoublePref( 340 registry->RegisterDoublePref(
345 prefs::kFlingVelocityCap,
346 GestureConfiguration::fling_velocity_cap(),
347 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
348 registry->RegisterDoublePref(
349 prefs::kLongPressTimeInSeconds,
350 GestureConfiguration::long_press_time_in_seconds(),
351 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
352 registry->RegisterDoublePref(
353 prefs::kSemiLongPressTimeInSeconds, 341 prefs::kSemiLongPressTimeInSeconds,
354 GestureConfiguration::semi_long_press_time_in_seconds(), 342 GestureConfiguration::semi_long_press_time_in_seconds(),
355 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 343 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
356 registry->RegisterDoublePref( 344 registry->RegisterDoublePref(
357 prefs::kMaxDistanceForTwoFingerTapInPixels,
358 GestureConfiguration::max_distance_for_two_finger_tap_in_pixels(),
359 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
360 registry->RegisterDoublePref(
361 prefs::kMaxSecondsBetweenDoubleClick,
362 GestureConfiguration::max_seconds_between_double_click(),
363 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
364 registry->RegisterDoublePref(
365 prefs::kMaxSeparationForGestureTouchesInPixels, 345 prefs::kMaxSeparationForGestureTouchesInPixels,
366 GestureConfiguration::max_separation_for_gesture_touches_in_pixels(), 346 GestureConfiguration::max_separation_for_gesture_touches_in_pixels(),
367 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 347 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
368 registry->RegisterDoublePref(
369 prefs::kMaxSwipeDeviationRatio,
370 GestureConfiguration::max_swipe_deviation_ratio(),
371 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
372 registry->RegisterDoublePref(
373 prefs::kMaxTouchDownDurationInSecondsForClick,
374 GestureConfiguration::max_touch_down_duration_in_seconds_for_click(),
375 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
376 registry->RegisterDoublePref(
377 prefs::kMaxTouchMoveInPixelsForClick,
378 GestureConfiguration::max_touch_move_in_pixels_for_click(),
379 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
380 registry->RegisterDoublePref(
381 prefs::kMaxDistanceBetweenTapsForDoubleTap,
382 GestureConfiguration::max_distance_between_taps_for_double_tap(),
383 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
384 registry->RegisterDoublePref(
385 prefs::kMinDistanceForPinchScrollInPixels,
386 GestureConfiguration::min_distance_for_pinch_scroll_in_pixels(),
387 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
388 registry->RegisterDoublePref(
389 prefs::kMinFlickSpeedSquared,
390 GestureConfiguration::min_flick_speed_squared(),
391 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
392 registry->RegisterDoublePref(
393 prefs::kMinPinchUpdateDistanceInPixels,
394 GestureConfiguration::min_pinch_update_distance_in_pixels(),
395 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
396 registry->RegisterDoublePref(
397 prefs::kMinRailBreakVelocity,
398 GestureConfiguration::min_rail_break_velocity(),
399 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
400 registry->RegisterDoublePref(
401 prefs::kMinScrollDeltaSquared,
402 GestureConfiguration::min_scroll_delta_squared(),
403 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
404 registry->RegisterDoublePref(
405 prefs::kMinSwipeSpeed,
406 GestureConfiguration::min_swipe_speed(),
407 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
408 registry->RegisterDoublePref(
409 prefs::kMinTouchDownDurationInSecondsForClick,
410 GestureConfiguration::min_touch_down_duration_in_seconds_for_click(),
411 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
412 registry->RegisterIntegerPref(
413 prefs::kPointsBufferedForVelocity,
414 GestureConfiguration::points_buffered_for_velocity(),
415 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
416 registry->RegisterDoublePref(
417 prefs::kRailBreakProportion,
418 GestureConfiguration::rail_break_proportion(),
419 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
420 registry->RegisterDoublePref(
421 prefs::kRailStartProportion,
422 GestureConfiguration::rail_start_proportion(),
423 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
424 registry->RegisterDoublePref(
425 prefs::kScrollPredictionSeconds,
426 GestureConfiguration::scroll_prediction_seconds(),
427 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
428 registry->RegisterIntegerPref(
429 prefs::kShowPressDelayInMS,
430 GestureConfiguration::show_press_delay_in_ms(),
431 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
432 RegisterOverscrollPrefs(registry); 348 RegisterOverscrollPrefs(registry);
433 RegisterFlingCurveParameters(registry); 349 RegisterFlingCurveParameters(registry);
434 } 350 }
435 351
436 bool 352 bool
437 GesturePrefsObserverFactoryAura::ServiceIsCreatedWithBrowserContext() const { 353 GesturePrefsObserverFactoryAura::ServiceIsCreatedWithBrowserContext() const {
438 // Create the observer as soon as the profile is created. 354 // Create the observer as soon as the profile is created.
439 return true; 355 return true;
440 } 356 }
441 357
442 content::BrowserContext* 358 content::BrowserContext*
443 GesturePrefsObserverFactoryAura::GetBrowserContextToUse( 359 GesturePrefsObserverFactoryAura::GetBrowserContextToUse(
444 content::BrowserContext* context) const { 360 content::BrowserContext* context) const {
445 // Use same gesture preferences on incognito windows. 361 // Use same gesture preferences on incognito windows.
446 return chrome::GetBrowserContextRedirectedInIncognito(context); 362 return chrome::GetBrowserContextRedirectedInIncognito(context);
447 } 363 }
448 364
449 bool GesturePrefsObserverFactoryAura::ServiceIsNULLWhileTesting() const { 365 bool GesturePrefsObserverFactoryAura::ServiceIsNULLWhileTesting() const {
450 // Some tests replace the PrefService of the TestingProfile after the 366 // Some tests replace the PrefService of the TestingProfile after the
451 // GesturePrefsObserver has been created, which makes Shutdown() 367 // GesturePrefsObserver has been created, which makes Shutdown()
452 // remove the registrar from a non-existent PrefService. 368 // remove the registrar from a non-existent PrefService.
453 return true; 369 return true;
454 } 370 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/gesture_config.js ('k') | chrome/browser/ui/webui/chromeos/salsa_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698