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

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

Issue 52363006: Clear gesture.config_is_truthworthy pref (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/common/pref_names.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 #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"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 prefs::kFlingCurveTouchscreenAlpha, 134 prefs::kFlingCurveTouchscreenAlpha,
135 prefs::kFlingCurveTouchscreenBeta, 135 prefs::kFlingCurveTouchscreenBeta,
136 prefs::kFlingCurveTouchscreenGamma, 136 prefs::kFlingCurveTouchscreenGamma,
137 }; 137 };
138 138
139 GesturePrefsObserver::GesturePrefsObserver(PrefService* prefs) 139 GesturePrefsObserver::GesturePrefsObserver(PrefService* prefs)
140 : prefs_(prefs) { 140 : prefs_(prefs) {
141 // Clear for migration. 141 // Clear for migration.
142 prefs->ClearPref(kTouchScreenFlingAccelerationAdjustment); 142 prefs->ClearPref(kTouchScreenFlingAccelerationAdjustment);
143 143
144 // TODO(mohsen): Remove following code in M32. By then, gesture prefs will 144 // Clear temporary pref gesture.config_is_trustworthy, so that in M33, we can
145 // have been cleared for majority of the users: crbug.com/269292. 145 // remove it completely: crbug.com/269292.
146 // Do a one-time wipe of all gesture preferences. 146 prefs->ClearPref(prefs::kGestureConfigIsTrustworthy);
147 if (!prefs->GetBoolean(prefs::kGestureConfigIsTrustworthy)) {
148 for (size_t i = 0; i < arraysize(kPrefsToObserve); ++i)
149 prefs->ClearPref(kPrefsToObserve[i]);
150
151 const std::vector<OverscrollPref>& overscroll_prefs = GetOverscrollPrefs();
152 for (size_t i = 0; i < overscroll_prefs.size(); ++i)
153 prefs->ClearPref(overscroll_prefs[i].pref_name);
154
155 for (size_t i = 0; i < arraysize(kFlingTouchpadPrefs); ++i)
156 prefs->ClearPref(kFlingTouchpadPrefs[i]);
157
158 for (size_t i = 0; i < arraysize(kFlingTouchscreenPrefs); ++i)
159 prefs->ClearPref(kFlingTouchscreenPrefs[i]);
160
161 prefs->SetBoolean(prefs::kGestureConfigIsTrustworthy, true);
162 }
163 147
164 registrar_.Init(prefs); 148 registrar_.Init(prefs);
165 registrar_.RemoveAll(); 149 registrar_.RemoveAll();
166 base::Closure callback = base::Bind(&GesturePrefsObserver::Update, 150 base::Closure callback = base::Bind(&GesturePrefsObserver::Update,
167 base::Unretained(this)); 151 base::Unretained(this));
168 152
169 base::Closure notify_callback = base::Bind(&GesturePrefsObserver::Notify, 153 base::Closure notify_callback = base::Bind(&GesturePrefsObserver::Notify,
170 base::Unretained(this)); 154 base::Unretained(this));
171 155
172 for (size_t i = 0; i < arraysize(kPrefsToObserve); ++i) 156 for (size_t i = 0; i < arraysize(kPrefsToObserve); ++i)
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 // Use same gesture preferences on incognito windows. 477 // Use same gesture preferences on incognito windows.
494 return chrome::GetBrowserContextRedirectedInIncognito(context); 478 return chrome::GetBrowserContextRedirectedInIncognito(context);
495 } 479 }
496 480
497 bool GesturePrefsObserverFactoryAura::ServiceIsNULLWhileTesting() const { 481 bool GesturePrefsObserverFactoryAura::ServiceIsNULLWhileTesting() const {
498 // Some tests replace the PrefService of the TestingProfile after the 482 // Some tests replace the PrefService of the TestingProfile after the
499 // GesturePrefsObserver has been created, which makes Shutdown() 483 // GesturePrefsObserver has been created, which makes Shutdown()
500 // remove the registrar from a non-existent PrefService. 484 // remove the registrar from a non-existent PrefService.
501 return true; 485 return true;
502 } 486 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/pref_names.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698