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

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

Issue 12212040: Make the workspace cycler animation parameters editable via chrome://gesture (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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) 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 <vector>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
9 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
10 #include "base/prefs/pref_service.h" 12 #include "base/prefs/pref_service.h"
11 #include "base/prefs/public/pref_change_registrar.h" 13 #include "base/prefs/public/pref_change_registrar.h"
12 #include "chrome/browser/prefs/pref_registry_syncable.h" 14 #include "chrome/browser/prefs/pref_registry_syncable.h"
13 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/profiles/profile_dependency_manager.h" 16 #include "chrome/browser/profiles/profile_dependency_manager.h"
15 #include "chrome/common/chrome_notification_types.h" 17 #include "chrome/common/chrome_notification_types.h"
16 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
17 #include "content/public/browser/notification_observer.h" 19 #include "content/public/browser/notification_observer.h"
18 #include "content/public/browser/notification_service.h" 20 #include "content/public/browser/notification_service.h"
19 #include "content/public/browser/overscroll_configuration.h" 21 #include "content/public/browser/overscroll_configuration.h"
20 #include "content/public/common/renderer_preferences.h" 22 #include "content/public/common/renderer_preferences.h"
21 #include "ui/base/gestures/gesture_configuration.h" 23 #include "ui/base/gestures/gesture_configuration.h"
22 24
25 #if defined(USE_ASH)
26 #include "ash/wm/workspace/workspace_cycler_configuration.h"
27 #endif // USE_ASH
28
29 using ash::WorkspaceCyclerConfiguration;
23 using ui::GestureConfiguration; 30 using ui::GestureConfiguration;
24 31
25 namespace { 32 namespace {
26 33
27 struct OverscrollPref { 34 struct OverscrollPref {
28 const char* pref_name; 35 const char* pref_name;
29 content::OverscrollConfig config; 36 content::OverscrollConfig config;
30 }; 37 };
31 38
32 // This class manages gesture configuration preferences. 39 const std::vector<OverscrollPref>& GetOverscrollPrefs() {
33 class GesturePrefsObserver : public ProfileKeyedService { 40 CR_DEFINE_STATIC_LOCAL(std::vector<OverscrollPref>, overscroll_prefs, ());
34 public: 41 if (overscroll_prefs.empty()) {
35 explicit GesturePrefsObserver(PrefService* prefs);
36 virtual ~GesturePrefsObserver();
37
38 static const OverscrollPref* GetOverscrollPrefs() {
39 using namespace content; 42 using namespace content;
40 static OverscrollPref overscroll_prefs[] = { 43 const OverscrollPref kOverscrollPrefs[] = {
41 { prefs::kOverscrollHorizontalThresholdComplete, 44 { prefs::kOverscrollHorizontalThresholdComplete,
42 OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE }, 45 OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE },
43 { prefs::kOverscrollVerticalThresholdComplete, 46 { prefs::kOverscrollVerticalThresholdComplete,
44 OVERSCROLL_CONFIG_VERT_THRESHOLD_COMPLETE }, 47 OVERSCROLL_CONFIG_VERT_THRESHOLD_COMPLETE },
45 { prefs::kOverscrollMinimumThresholdStart, 48 { prefs::kOverscrollMinimumThresholdStart,
46 OVERSCROLL_CONFIG_MIN_THRESHOLD_START }, 49 OVERSCROLL_CONFIG_MIN_THRESHOLD_START },
47 { prefs::kOverscrollHorizontalResistThreshold, 50 { prefs::kOverscrollHorizontalResistThreshold,
48 OVERSCROLL_CONFIG_HORIZ_RESIST_AFTER }, 51 OVERSCROLL_CONFIG_HORIZ_RESIST_AFTER },
49 { prefs::kOverscrollVerticalResistThreshold, 52 { prefs::kOverscrollVerticalResistThreshold,
50 OVERSCROLL_CONFIG_VERT_RESIST_AFTER }, 53 OVERSCROLL_CONFIG_VERT_RESIST_AFTER },
51 { NULL,
52 OVERSCROLL_CONFIG_NONE },
53 }; 54 };
55 overscroll_prefs.assign(kOverscrollPrefs,
56 kOverscrollPrefs + arraysize(kOverscrollPrefs));
57 }
58 return overscroll_prefs;
59 }
54 60
55 return overscroll_prefs; 61 #if defined(USE_ASH)
62 struct WorkspaceCyclerPref {
63 const char* pref_name;
64 WorkspaceCyclerConfiguration::Property property;
65 };
66
67 const std::vector<WorkspaceCyclerPref>& GetWorkspaceCyclerPrefs() {
68 CR_DEFINE_STATIC_LOCAL(std::vector<WorkspaceCyclerPref>, cycler_prefs, ());
69 if (cycler_prefs.empty() && WorkspaceCyclerConfiguration::IsCyclerEnabled()) {
70 const WorkspaceCyclerPref kCyclerPrefs[] = {
71 { prefs::kWorkspaceCyclerShallowerThanSelectedYOffsets,
72 WorkspaceCyclerConfiguration::SHALLOWER_THAN_SELECTED_Y_OFFSETS },
73 { prefs::kWorkspaceCyclerDeeperThanSelectedYOffsets,
74 WorkspaceCyclerConfiguration::DEEPER_THAN_SELECTED_Y_OFFSETS },
75 { prefs::kWorkspaceCyclerSelectedYOffset,
76 WorkspaceCyclerConfiguration::SELECTED_Y_OFFSET },
77 { prefs::kWorkspaceCyclerSelectedScale,
78 WorkspaceCyclerConfiguration::SELECTED_SCALE },
79 { prefs::kWorkspaceCyclerMinScale,
80 WorkspaceCyclerConfiguration::MIN_SCALE },
81 { prefs::kWorkspaceCyclerMaxScale,
82 WorkspaceCyclerConfiguration::MAX_SCALE },
83 { prefs::kWorkspaceCyclerMinBrightness,
84 WorkspaceCyclerConfiguration::MIN_BRIGHTNESS },
85 { prefs::kWorkspaceCyclerBackgroundOpacity,
86 WorkspaceCyclerConfiguration::BACKGROUND_OPACITY },
87 { prefs::kWorkspaceCyclerDistanceToInitiateCycling,
88 WorkspaceCyclerConfiguration::DISTANCE_TO_INITIATE_CYCLING },
89 { prefs::kWorkspaceCyclerScrollDistanceToCycleToNextWorkspace,
90 WorkspaceCyclerConfiguration::
91 SCROLL_DISTANCE_TO_CYCLE_TO_NEXT_WORKSPACE },
92 { prefs::kWorkspaceCyclerCyclerStepAnimationDurationRatio,
93 WorkspaceCyclerConfiguration::CYCLER_STEP_ANIMATION_DURATION_RATIO },
94 { prefs::kWorkspaceCyclerStartCyclerAnimationDuration,
95 WorkspaceCyclerConfiguration::START_CYCLER_ANIMATION_DURATION },
96 { prefs::kWorkspaceCyclerStopCyclerAnimationDuration,
97 WorkspaceCyclerConfiguration::STOP_CYCLER_ANIMATION_DURATION },
98 };
99 cycler_prefs.assign(kCyclerPrefs, kCyclerPrefs + arraysize(kCyclerPrefs));
56 } 100 }
101 return cycler_prefs;
102 }
103 #endif // USE_ASH
104
105 // This class manages gesture configuration preferences.
106 class GesturePrefsObserver : public ProfileKeyedService {
107 public:
108 explicit GesturePrefsObserver(PrefService* prefs);
109 virtual ~GesturePrefsObserver();
57 110
58 // ProfileKeyedService implementation. 111 // ProfileKeyedService implementation.
59 virtual void Shutdown() OVERRIDE; 112 virtual void Shutdown() OVERRIDE;
60 113
61 private: 114 private:
62 // Notification callback invoked when browser-side preferences 115 // Notification callback invoked when browser-side preferences
63 // are updated and need to be pushed into ui::GesturePreferences. 116 // are updated and need to be pushed into ui::GesturePreferences.
64 void Update(); 117 void Update();
65 118
66 // Notification callback invoked when the fling deacceleration 119 // Notification callback invoked when the fling deacceleration
67 // gesture preferences are changed from chrome://gesture. 120 // gesture preferences are changed from chrome://gesture.
68 // Broadcasts the changes all renderers where they are used. 121 // Broadcasts the changes all renderers where they are used.
69 void Notify(); 122 void Notify();
70 123
71 // Notification helper to push overscroll preferences into 124 // Notification helper to push overscroll preferences into
72 // content. 125 // content.
73 void UpdateOverscrollPrefs(); 126 void UpdateOverscrollPrefs();
127 void UpdateWorkspaceCyclerPrefs();
74 128
75 PrefChangeRegistrar registrar_; 129 PrefChangeRegistrar registrar_;
76 PrefService* prefs_; 130 PrefService* prefs_;
77 131
78 DISALLOW_COPY_AND_ASSIGN(GesturePrefsObserver); 132 DISALLOW_COPY_AND_ASSIGN(GesturePrefsObserver);
79 }; 133 };
80 134
81 // The list of prefs we want to observe. 135 // The list of prefs we want to observe.
82 // Note that this collection of settings should correspond to the settings used 136 // Note that this collection of settings should correspond to the settings used
83 // in ui/base/gestures/gesture_configuration.h 137 // in ui/base/gestures/gesture_configuration.h
(...skipping 18 matching lines...) Expand all
102 prefs::kMinRailBreakVelocity, 156 prefs::kMinRailBreakVelocity,
103 prefs::kMinScrollDeltaSquared, 157 prefs::kMinScrollDeltaSquared,
104 prefs::kMinSwipeSpeed, 158 prefs::kMinSwipeSpeed,
105 prefs::kMinTouchDownDurationInSecondsForClick, 159 prefs::kMinTouchDownDurationInSecondsForClick,
106 prefs::kPointsBufferedForVelocity, 160 prefs::kPointsBufferedForVelocity,
107 prefs::kRailBreakProportion, 161 prefs::kRailBreakProportion,
108 prefs::kRailStartProportion, 162 prefs::kRailStartProportion,
109 prefs::kSemiLongPressTimeInSeconds, 163 prefs::kSemiLongPressTimeInSeconds,
110 }; 164 };
111 165
112 const char* kOverscrollPrefs[] = {
113 prefs::kOverscrollHorizontalThresholdComplete,
114 prefs::kOverscrollVerticalThresholdComplete,
115 prefs::kOverscrollMinimumThresholdStart,
116 prefs::kOverscrollHorizontalResistThreshold,
117 prefs::kOverscrollVerticalResistThreshold,
118 };
119
120 const char* kFlingTouchpadPrefs[] = { 166 const char* kFlingTouchpadPrefs[] = {
121 prefs::kFlingCurveTouchpadAlpha, 167 prefs::kFlingCurveTouchpadAlpha,
122 prefs::kFlingCurveTouchpadBeta, 168 prefs::kFlingCurveTouchpadBeta,
123 prefs::kFlingCurveTouchpadGamma 169 prefs::kFlingCurveTouchpadGamma
124 }; 170 };
125 171
126 const char* kFlingTouchscreenPrefs[] = { 172 const char* kFlingTouchscreenPrefs[] = {
127 prefs::kFlingCurveTouchscreenAlpha, 173 prefs::kFlingCurveTouchscreenAlpha,
128 prefs::kFlingCurveTouchscreenBeta, 174 prefs::kFlingCurveTouchscreenBeta,
129 prefs::kFlingCurveTouchscreenGamma, 175 prefs::kFlingCurveTouchscreenGamma,
130 }; 176 };
131 177
132 GesturePrefsObserver::GesturePrefsObserver(PrefService* prefs) 178 GesturePrefsObserver::GesturePrefsObserver(PrefService* prefs)
133 : prefs_(prefs) { 179 : prefs_(prefs) {
134 registrar_.Init(prefs); 180 registrar_.Init(prefs);
135 registrar_.RemoveAll(); 181 registrar_.RemoveAll();
136 base::Closure callback = base::Bind(&GesturePrefsObserver::Update, 182 base::Closure callback = base::Bind(&GesturePrefsObserver::Update,
137 base::Unretained(this)); 183 base::Unretained(this));
138 184
139 base::Closure notify_callback = base::Bind(&GesturePrefsObserver::Notify, 185 base::Closure notify_callback = base::Bind(&GesturePrefsObserver::Notify,
140 base::Unretained(this)); 186 base::Unretained(this));
141 187
142 for (size_t i = 0; i < arraysize(kPrefsToObserve); ++i) 188 for (size_t i = 0; i < arraysize(kPrefsToObserve); ++i)
143 registrar_.Add(kPrefsToObserve[i], callback); 189 registrar_.Add(kPrefsToObserve[i], callback);
144 for (size_t i = 0; i < arraysize(kOverscrollPrefs); ++i) 190
145 registrar_.Add(kOverscrollPrefs[i], callback); 191 const std::vector<OverscrollPref>& overscroll_prefs = GetOverscrollPrefs();
192 for (size_t i = 0; i < overscroll_prefs.size(); ++i)
193 registrar_.Add(overscroll_prefs[i].pref_name, callback);
146 194
147 for (size_t i = 0; i < arraysize(kFlingTouchpadPrefs); ++i) 195 for (size_t i = 0; i < arraysize(kFlingTouchpadPrefs); ++i)
148 registrar_.Add(kFlingTouchpadPrefs[i], notify_callback); 196 registrar_.Add(kFlingTouchpadPrefs[i], notify_callback);
149 for (size_t i = 0; i < arraysize(kFlingTouchscreenPrefs); ++i) 197 for (size_t i = 0; i < arraysize(kFlingTouchscreenPrefs); ++i)
150 registrar_.Add(kFlingTouchscreenPrefs[i], notify_callback); 198 registrar_.Add(kFlingTouchscreenPrefs[i], notify_callback);
199
200 #if defined(USE_ASH)
201 const std::vector<WorkspaceCyclerPref>& cycler_prefs =
202 GetWorkspaceCyclerPrefs();
203 for (size_t i = 0; i < cycler_prefs.size(); ++i)
204 registrar_.Add(cycler_prefs[i].pref_name, callback);
205 #endif // USE_ASH
151 } 206 }
152 207
153 GesturePrefsObserver::~GesturePrefsObserver() {} 208 GesturePrefsObserver::~GesturePrefsObserver() {}
154 209
155 void GesturePrefsObserver::Shutdown() { 210 void GesturePrefsObserver::Shutdown() {
156 registrar_.RemoveAll(); 211 registrar_.RemoveAll();
157 } 212 }
158 213
159 void GesturePrefsObserver::Update() { 214 void GesturePrefsObserver::Update() {
160 GestureConfiguration::set_fling_acceleration_curve_coefficients(0, 215 GestureConfiguration::set_fling_acceleration_curve_coefficients(0,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 prefs_->GetInteger( 278 prefs_->GetInteger(
224 prefs::kPointsBufferedForVelocity)); 279 prefs::kPointsBufferedForVelocity));
225 GestureConfiguration::set_rail_break_proportion( 280 GestureConfiguration::set_rail_break_proportion(
226 prefs_->GetDouble( 281 prefs_->GetDouble(
227 prefs::kRailBreakProportion)); 282 prefs::kRailBreakProportion));
228 GestureConfiguration::set_rail_start_proportion( 283 GestureConfiguration::set_rail_start_proportion(
229 prefs_->GetDouble( 284 prefs_->GetDouble(
230 prefs::kRailStartProportion)); 285 prefs::kRailStartProportion));
231 286
232 UpdateOverscrollPrefs(); 287 UpdateOverscrollPrefs();
288 UpdateWorkspaceCyclerPrefs();
233 } 289 }
234 290
235 void GesturePrefsObserver::UpdateOverscrollPrefs() { 291 void GesturePrefsObserver::UpdateOverscrollPrefs() {
236 const OverscrollPref* overscroll_prefs = 292 const std::vector<OverscrollPref>& overscroll_prefs = GetOverscrollPrefs();
237 GesturePrefsObserver::GetOverscrollPrefs(); 293 for (size_t i = 0; i < overscroll_prefs.size(); ++i) {
238 for (int i = 0; overscroll_prefs[i].pref_name; ++i) {
239 content::SetOverscrollConfig(overscroll_prefs[i].config, 294 content::SetOverscrollConfig(overscroll_prefs[i].config,
240 static_cast<float>(prefs_->GetDouble(overscroll_prefs[i].pref_name))); 295 static_cast<float>(prefs_->GetDouble(overscroll_prefs[i].pref_name)));
241 } 296 }
242 } 297 }
243 298
299 void GesturePrefsObserver::UpdateWorkspaceCyclerPrefs() {
300 #if defined(USE_ASH)
301 const std::vector<WorkspaceCyclerPref>& cycler_prefs =
302 GetWorkspaceCyclerPrefs();
303 for (size_t i = 0; i < cycler_prefs.size(); ++i) {
304 WorkspaceCyclerConfiguration::Property property =
305 cycler_prefs[i].property;
306 if (WorkspaceCyclerConfiguration::IsListProperty(property)) {
307 WorkspaceCyclerConfiguration::SetListValue(property,
308 *prefs_->GetList(cycler_prefs[i].pref_name));
309 } else {
310 WorkspaceCyclerConfiguration::SetDouble(property,
311 prefs_->GetDouble(cycler_prefs[i].pref_name));
312 }
313 }
314 #endif // USE_ASH
315 }
316
244 void GesturePrefsObserver::Notify() { 317 void GesturePrefsObserver::Notify() {
245 // Must do a notify to distribute the changes to all renderers. 318 // Must do a notify to distribute the changes to all renderers.
246 content::NotificationService* service = 319 content::NotificationService* service =
247 content::NotificationService::current(); 320 content::NotificationService::current();
248 service->Notify(chrome::NOTIFICATION_BROWSER_FLING_CURVE_PARAMETERS_CHANGED, 321 service->Notify(chrome::NOTIFICATION_BROWSER_FLING_CURVE_PARAMETERS_CHANGED,
249 content::Source<GesturePrefsObserver>(this), 322 content::Source<GesturePrefsObserver>(this),
250 content::NotificationService::NoDetails()); 323 content::NotificationService::NoDetails());
251 } 324 }
252 325
253 } // namespace 326 } // namespace
(...skipping 10 matching lines...) Expand all
264 337
265 GesturePrefsObserverFactoryAura::~GesturePrefsObserverFactoryAura() {} 338 GesturePrefsObserverFactoryAura::~GesturePrefsObserverFactoryAura() {}
266 339
267 ProfileKeyedService* GesturePrefsObserverFactoryAura::BuildServiceInstanceFor( 340 ProfileKeyedService* GesturePrefsObserverFactoryAura::BuildServiceInstanceFor(
268 Profile* profile) const { 341 Profile* profile) const {
269 return new GesturePrefsObserver(profile->GetPrefs()); 342 return new GesturePrefsObserver(profile->GetPrefs());
270 } 343 }
271 344
272 void GesturePrefsObserverFactoryAura::RegisterOverscrollPrefs( 345 void GesturePrefsObserverFactoryAura::RegisterOverscrollPrefs(
273 PrefRegistrySyncable* registry) { 346 PrefRegistrySyncable* registry) {
274 const OverscrollPref* overscroll_prefs = 347 const std::vector<OverscrollPref>& overscroll_prefs = GetOverscrollPrefs();
275 GesturePrefsObserver::GetOverscrollPrefs();
276 348
277 for (int i = 0; overscroll_prefs[i].pref_name; ++i) { 349 for (size_t i = 0; i < overscroll_prefs.size(); ++i) {
278 registry->RegisterDoublePref( 350 registry->RegisterDoublePref(
279 overscroll_prefs[i].pref_name, 351 overscroll_prefs[i].pref_name,
280 content::GetOverscrollConfig(overscroll_prefs[i].config), 352 content::GetOverscrollConfig(overscroll_prefs[i].config),
281 PrefRegistrySyncable::UNSYNCABLE_PREF); 353 PrefRegistrySyncable::UNSYNCABLE_PREF);
282 } 354 }
283 } 355 }
284 356
285 void GesturePrefsObserverFactoryAura::RegisterFlingCurveParameters( 357 void GesturePrefsObserverFactoryAura::RegisterFlingCurveParameters(
286 PrefRegistrySyncable* registry) { 358 PrefRegistrySyncable* registry) {
287 content::RendererPreferences def_prefs; 359 content::RendererPreferences def_prefs;
288 360
289 for (size_t i = 0; i < arraysize(kFlingTouchpadPrefs); i++) 361 for (size_t i = 0; i < arraysize(kFlingTouchpadPrefs); i++)
290 registry->RegisterDoublePref(kFlingTouchpadPrefs[i], 362 registry->RegisterDoublePref(kFlingTouchpadPrefs[i],
291 def_prefs.touchpad_fling_profile[i], 363 def_prefs.touchpad_fling_profile[i],
292 PrefRegistrySyncable::UNSYNCABLE_PREF); 364 PrefRegistrySyncable::UNSYNCABLE_PREF);
293 365
294 for (size_t i = 0; i < arraysize(kFlingTouchscreenPrefs); i++) 366 for (size_t i = 0; i < arraysize(kFlingTouchscreenPrefs); i++)
295 registry->RegisterDoublePref(kFlingTouchscreenPrefs[i], 367 registry->RegisterDoublePref(kFlingTouchscreenPrefs[i],
296 def_prefs.touchscreen_fling_profile[i], 368 def_prefs.touchscreen_fling_profile[i],
297 PrefRegistrySyncable::UNSYNCABLE_PREF); 369 PrefRegistrySyncable::UNSYNCABLE_PREF);
298 } 370 }
299 371
372 void GesturePrefsObserverFactoryAura::RegisterWorkspaceCyclerPrefs(
373 PrefRegistrySyncable* registry) {
374 #if defined(USE_ASH)
375 const std::vector<WorkspaceCyclerPref>& cycler_prefs =
376 GetWorkspaceCyclerPrefs();
377 for (size_t i = 0; i < cycler_prefs.size(); ++i) {
378 WorkspaceCyclerConfiguration::Property property =
379 cycler_prefs[i].property;
380 if (WorkspaceCyclerConfiguration::IsListProperty(property)) {
381 registry->RegisterListPref(
382 cycler_prefs[i].pref_name,
383 WorkspaceCyclerConfiguration::GetListValue(property).DeepCopy(),
384 PrefRegistrySyncable::UNSYNCABLE_PREF);
385 } else {
386 registry->RegisterDoublePref(
387 cycler_prefs[i].pref_name,
388 WorkspaceCyclerConfiguration::GetDouble(property),
389 PrefRegistrySyncable::UNSYNCABLE_PREF);
390 }
391 }
392 #endif // USE_ASH
393 }
394
300 void GesturePrefsObserverFactoryAura::DeprecatedRegisterUserPrefs( 395 void GesturePrefsObserverFactoryAura::DeprecatedRegisterUserPrefs(
301 PrefService* prefs, 396 PrefService* prefs,
302 PrefRegistrySyncable* registry) { 397 PrefRegistrySyncable* registry) {
303 registry->RegisterDoublePref( 398 registry->RegisterDoublePref(
304 prefs::kFlingAccelerationCurveCoefficient0, 399 prefs::kFlingAccelerationCurveCoefficient0,
305 GestureConfiguration::fling_acceleration_curve_coefficients(0), 400 GestureConfiguration::fling_acceleration_curve_coefficients(0),
306 PrefRegistrySyncable::UNSYNCABLE_PREF); 401 PrefRegistrySyncable::UNSYNCABLE_PREF);
307 registry->RegisterDoublePref( 402 registry->RegisterDoublePref(
308 prefs::kFlingAccelerationCurveCoefficient1, 403 prefs::kFlingAccelerationCurveCoefficient1,
309 GestureConfiguration::fling_acceleration_curve_coefficients(1), 404 GestureConfiguration::fling_acceleration_curve_coefficients(1),
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 // TODO(rjkroege): Remove this in M29. http://crbug.com/160243. 503 // TODO(rjkroege): Remove this in M29. http://crbug.com/160243.
409 const char kTouchScreenFlingAccelerationAdjustment[] = 504 const char kTouchScreenFlingAccelerationAdjustment[] =
410 "gesture.touchscreen_fling_acceleration_adjustment"; 505 "gesture.touchscreen_fling_acceleration_adjustment";
411 registry->RegisterDoublePref(kTouchScreenFlingAccelerationAdjustment, 506 registry->RegisterDoublePref(kTouchScreenFlingAccelerationAdjustment,
412 0.0, 507 0.0,
413 PrefRegistrySyncable::UNSYNCABLE_PREF); 508 PrefRegistrySyncable::UNSYNCABLE_PREF);
414 prefs->ClearPref(kTouchScreenFlingAccelerationAdjustment); 509 prefs->ClearPref(kTouchScreenFlingAccelerationAdjustment);
415 510
416 RegisterOverscrollPrefs(registry); 511 RegisterOverscrollPrefs(registry);
417 RegisterFlingCurveParameters(registry); 512 RegisterFlingCurveParameters(registry);
513 RegisterWorkspaceCyclerPrefs(registry);
418 } 514 }
419 515
420 bool GesturePrefsObserverFactoryAura::ServiceIsCreatedWithProfile() const { 516 bool GesturePrefsObserverFactoryAura::ServiceIsCreatedWithProfile() const {
421 // Create the observer as soon as the profile is created. 517 // Create the observer as soon as the profile is created.
422 return true; 518 return true;
423 } 519 }
424 520
425 bool GesturePrefsObserverFactoryAura::ServiceRedirectedInIncognito() const { 521 bool GesturePrefsObserverFactoryAura::ServiceRedirectedInIncognito() const {
426 // Use same gesture preferences on incognito windows. 522 // Use same gesture preferences on incognito windows.
427 return true; 523 return true;
428 } 524 }
429 525
430 bool GesturePrefsObserverFactoryAura::ServiceIsNULLWhileTesting() const { 526 bool GesturePrefsObserverFactoryAura::ServiceIsNULLWhileTesting() const {
431 // Some tests replace the PrefService of the TestingProfile after the 527 // Some tests replace the PrefService of the TestingProfile after the
432 // GesturePrefsObserver has been created, which makes Shutdown() 528 // GesturePrefsObserver has been created, which makes Shutdown()
433 // remove the registrar from a non-existent PrefService. 529 // remove the registrar from a non-existent PrefService.
434 return true; 530 return true;
435 } 531 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698