OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/webui/chromeos/salsa_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/salsa_ui.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
14 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 #include "content/public/browser/web_ui.h" | 16 #include "content/public/browser/web_ui.h" |
17 #include "content/public/browser/web_ui_data_source.h" | 17 #include "content/public/browser/web_ui_data_source.h" |
18 #include "grit/browser_resources.h" | 18 #include "grit/browser_resources.h" |
19 | 19 |
20 // Whitelist of which preferences are possible targets for Salsa treatments. | 20 // Whitelist of which preferences are possible targets for Salsa treatments. |
21 // If new preferences are added and they are to be used in an experiment, then | 21 // If new preferences are added and they are to be used in an experiment, then |
22 // they must be added to this list as well to keep chrome://salsa from | 22 // they must be added to this list as well to keep chrome://salsa from |
23 // changing arbitrary values. | 23 // changing arbitrary values. |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 const char* kWhitelist[] = { | 27 const char* kWhitelist[] = { |
28 prefs::kMaxSeparationForGestureTouchesInPixels, | 28 prefs::kMaxSeparationForGestureTouchesInPixels, |
29 prefs::kTabScrubActivationDelayInMS, | 29 prefs::kTabScrubActivationDelayInMs, |
30 prefs::kOverscrollHorizontalThresholdComplete, | 30 prefs::kOverscrollHorizontalThresholdComplete, |
31 prefs::kOverscrollVerticalThresholdComplete, | 31 prefs::kOverscrollVerticalThresholdComplete, |
32 prefs::kOverscrollMinimumThresholdStart, | 32 prefs::kOverscrollMinimumThresholdStart, |
33 prefs::kOverscrollVerticalThresholdStart, | 33 prefs::kOverscrollVerticalThresholdStart, |
34 prefs::kOverscrollHorizontalResistThreshold, | 34 prefs::kOverscrollHorizontalResistThreshold, |
35 prefs::kOverscrollVerticalResistThreshold, | 35 prefs::kOverscrollVerticalResistThreshold, |
36 }; | 36 }; |
37 | 37 |
38 void RevertPreferences(PrefService* prefs, | 38 void RevertPreferences(PrefService* prefs, |
39 std::map<int, const base::Value*>* vals) { | 39 std::map<int, const base::Value*>* vals) { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 148 |
149 if (!pref) | 149 if (!pref) |
150 return; | 150 return; |
151 | 151 |
152 // Get our own copy of the user defined value or NULL if they are using the | 152 // Get our own copy of the user defined value or NULL if they are using the |
153 // default. You have to make a copy since they'll be used in the destructor | 153 // default. You have to make a copy since they'll be used in the destructor |
154 // to restore the values and we need to make sure they're still around. | 154 // to restore the values and we need to make sure they're still around. |
155 orig_values_[index] = | 155 orig_values_[index] = |
156 pref->IsDefaultValue() ? NULL : pref->GetValue()->DeepCopy(); | 156 pref->IsDefaultValue() ? NULL : pref->GetValue()->DeepCopy(); |
157 } | 157 } |
OLD | NEW |