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

Side by Side Diff: chrome/browser/chromeos/preferences.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years 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/chromeos/preferences.h" 5 #include "chrome/browser/chromeos/preferences.h"
6 6
7 #include "base/chromeos/chromeos_version.h" 7 #include "base/chromeos/chromeos_version.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/i18n/time_formatting.h" 9 #include "base/i18n/time_formatting.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 input_method_manager_(input_method::GetInputMethodManager()) { 44 input_method_manager_(input_method::GetInputMethodManager()) {
45 } 45 }
46 46
47 Preferences::Preferences(input_method::InputMethodManager* input_method_manager) 47 Preferences::Preferences(input_method::InputMethodManager* input_method_manager)
48 : input_method_manager_(input_method_manager) { 48 : input_method_manager_(input_method_manager) {
49 } 49 }
50 50
51 Preferences::~Preferences() {} 51 Preferences::~Preferences() {}
52 52
53 // static 53 // static
54 void Preferences::RegisterUserPrefs(PrefService* prefs) { 54 void Preferences::RegisterUserPrefs(PrefServiceSyncable* prefs) {
55 std::string hardware_keyboard_id; 55 std::string hardware_keyboard_id;
56 // TODO(yusukes): Remove the runtime hack. 56 // TODO(yusukes): Remove the runtime hack.
57 if (base::chromeos::IsRunningOnChromeOS()) { 57 if (base::chromeos::IsRunningOnChromeOS()) {
58 input_method::InputMethodManager* manager = 58 input_method::InputMethodManager* manager =
59 input_method::GetInputMethodManager(); 59 input_method::GetInputMethodManager();
60 if (manager) { 60 if (manager) {
61 hardware_keyboard_id = 61 hardware_keyboard_id =
62 manager->GetInputMethodUtil()->GetHardwareInputMethodId(); 62 manager->GetInputMethodUtil()->GetHardwareInputMethodId();
63 } 63 }
64 } else { 64 } else {
65 hardware_keyboard_id = "xkb:us::eng"; // only for testing. 65 hardware_keyboard_id = "xkb:us::eng"; // only for testing.
66 } 66 }
67 67
68 prefs->RegisterBooleanPref(prefs::kTapToClickEnabled, 68 prefs->RegisterBooleanPref(prefs::kTapToClickEnabled,
69 true, 69 true,
70 PrefService::SYNCABLE_PREF); 70 PrefServiceSyncable::SYNCABLE_PREF);
71 prefs->RegisterBooleanPref(prefs::kTapDraggingEnabled, 71 prefs->RegisterBooleanPref(prefs::kTapDraggingEnabled,
72 false, 72 false,
73 PrefService::SYNCABLE_PREF); 73 PrefServiceSyncable::SYNCABLE_PREF);
74 prefs->RegisterBooleanPref(prefs::kEnableTouchpadThreeFingerClick, 74 prefs->RegisterBooleanPref(prefs::kEnableTouchpadThreeFingerClick,
75 false, 75 false,
76 PrefService::UNSYNCABLE_PREF); 76 PrefServiceSyncable::UNSYNCABLE_PREF);
77 prefs->RegisterBooleanPref(prefs::kEnableTouchpadThreeFingerSwipe, 77 prefs->RegisterBooleanPref(prefs::kEnableTouchpadThreeFingerSwipe,
78 false, 78 false,
79 PrefService::UNSYNCABLE_PREF); 79 PrefServiceSyncable::UNSYNCABLE_PREF);
80 prefs->RegisterBooleanPref( 80 prefs->RegisterBooleanPref(
81 prefs::kNaturalScroll, 81 prefs::kNaturalScroll,
82 CommandLine::ForCurrentProcess()->HasSwitch( 82 CommandLine::ForCurrentProcess()->HasSwitch(
83 switches::kNaturalScrollDefault), 83 switches::kNaturalScrollDefault),
84 PrefService::SYNCABLE_PREF); 84 PrefServiceSyncable::SYNCABLE_PREF);
85 prefs->RegisterBooleanPref(prefs::kPrimaryMouseButtonRight, 85 prefs->RegisterBooleanPref(prefs::kPrimaryMouseButtonRight,
86 false, 86 false,
87 PrefService::SYNCABLE_PREF); 87 PrefServiceSyncable::SYNCABLE_PREF);
88 prefs->RegisterBooleanPref(prefs::kLabsMediaplayerEnabled, 88 prefs->RegisterBooleanPref(prefs::kLabsMediaplayerEnabled,
89 false, 89 false,
90 PrefService::UNSYNCABLE_PREF); 90 PrefServiceSyncable::UNSYNCABLE_PREF);
91 prefs->RegisterBooleanPref(prefs::kLabsAdvancedFilesystemEnabled, 91 prefs->RegisterBooleanPref(prefs::kLabsAdvancedFilesystemEnabled,
92 false, 92 false,
93 PrefService::UNSYNCABLE_PREF); 93 PrefServiceSyncable::UNSYNCABLE_PREF);
94 // Check if the accessibility pref is already registered, which can happen 94 // Check if the accessibility pref is already registered, which can happen
95 // in WizardController::RegisterPrefs. We still want to try to register 95 // in WizardController::RegisterPrefs. We still want to try to register
96 // the pref here in case of Chrome/Linux with ChromeOS=1. 96 // the pref here in case of Chrome/Linux with ChromeOS=1.
97 if (prefs->FindPreference(prefs::kSpokenFeedbackEnabled) == NULL) { 97 if (prefs->FindPreference(prefs::kSpokenFeedbackEnabled) == NULL) {
98 prefs->RegisterBooleanPref(prefs::kSpokenFeedbackEnabled, 98 prefs->RegisterBooleanPref(prefs::kSpokenFeedbackEnabled,
99 false, 99 false,
100 PrefService::UNSYNCABLE_PREF); 100 PrefServiceSyncable::UNSYNCABLE_PREF);
101 } 101 }
102 if (prefs->FindPreference(prefs::kHighContrastEnabled) == NULL) { 102 if (prefs->FindPreference(prefs::kHighContrastEnabled) == NULL) {
103 prefs->RegisterBooleanPref(prefs::kHighContrastEnabled, 103 prefs->RegisterBooleanPref(prefs::kHighContrastEnabled,
104 false, 104 false,
105 PrefService::UNSYNCABLE_PREF); 105 PrefServiceSyncable::UNSYNCABLE_PREF);
106 } 106 }
107 if (prefs->FindPreference(prefs::kScreenMagnifierEnabled) == NULL) { 107 if (prefs->FindPreference(prefs::kScreenMagnifierEnabled) == NULL) {
108 prefs->RegisterBooleanPref(prefs::kScreenMagnifierEnabled, 108 prefs->RegisterBooleanPref(prefs::kScreenMagnifierEnabled,
109 false, 109 false,
110 PrefService::SYNCABLE_PREF); 110 PrefServiceSyncable::SYNCABLE_PREF);
111 } 111 }
112 if (prefs->FindPreference(prefs::kScreenMagnifierScale) == NULL) { 112 if (prefs->FindPreference(prefs::kScreenMagnifierScale) == NULL) {
113 prefs->RegisterDoublePref(prefs::kScreenMagnifierScale, 113 prefs->RegisterDoublePref(prefs::kScreenMagnifierScale,
114 std::numeric_limits<double>::min(), 114 std::numeric_limits<double>::min(),
115 PrefService::UNSYNCABLE_PREF); 115 PrefServiceSyncable::UNSYNCABLE_PREF);
116 } 116 }
117 if (prefs->FindPreference(prefs::kShouldAlwaysShowAccessibilityMenu) == 117 if (prefs->FindPreference(prefs::kShouldAlwaysShowAccessibilityMenu) ==
118 NULL) { 118 NULL) {
119 prefs->RegisterBooleanPref(prefs::kShouldAlwaysShowAccessibilityMenu, 119 prefs->RegisterBooleanPref(prefs::kShouldAlwaysShowAccessibilityMenu,
120 false, 120 false,
121 PrefService::UNSYNCABLE_PREF); 121 PrefServiceSyncable::UNSYNCABLE_PREF);
122 } 122 }
123 if (prefs->FindPreference(prefs::kVirtualKeyboardEnabled) == NULL) { 123 if (prefs->FindPreference(prefs::kVirtualKeyboardEnabled) == NULL) {
124 prefs->RegisterBooleanPref(prefs::kVirtualKeyboardEnabled, 124 prefs->RegisterBooleanPref(prefs::kVirtualKeyboardEnabled,
125 false, 125 false,
126 PrefService::UNSYNCABLE_PREF); 126 PrefServiceSyncable::UNSYNCABLE_PREF);
127 } 127 }
128 prefs->RegisterIntegerPref(prefs::kMouseSensitivity, 128 prefs->RegisterIntegerPref(prefs::kMouseSensitivity,
129 3, 129 3,
130 PrefService::SYNCABLE_PREF); 130 PrefServiceSyncable::SYNCABLE_PREF);
131 prefs->RegisterIntegerPref(prefs::kTouchpadSensitivity, 131 prefs->RegisterIntegerPref(prefs::kTouchpadSensitivity,
132 3, 132 3,
133 PrefService::SYNCABLE_PREF); 133 PrefServiceSyncable::SYNCABLE_PREF);
134 prefs->RegisterBooleanPref(prefs::kUse24HourClock, 134 prefs->RegisterBooleanPref(prefs::kUse24HourClock,
135 base::GetHourClockType() == base::k24HourClock, 135 base::GetHourClockType() == base::k24HourClock,
136 PrefService::SYNCABLE_PREF); 136 PrefServiceSyncable::SYNCABLE_PREF);
137 prefs->RegisterBooleanPref(prefs::kDisableDrive, 137 prefs->RegisterBooleanPref(prefs::kDisableDrive,
138 false, 138 false,
139 PrefService::SYNCABLE_PREF); 139 PrefServiceSyncable::SYNCABLE_PREF);
140 prefs->RegisterBooleanPref(prefs::kDisableDriveOverCellular, 140 prefs->RegisterBooleanPref(prefs::kDisableDriveOverCellular,
141 true, 141 true,
142 PrefService::SYNCABLE_PREF); 142 PrefServiceSyncable::SYNCABLE_PREF);
143 prefs->RegisterBooleanPref(prefs::kDisableDriveHostedFiles, 143 prefs->RegisterBooleanPref(prefs::kDisableDriveHostedFiles,
144 false, 144 false,
145 PrefService::SYNCABLE_PREF); 145 PrefServiceSyncable::SYNCABLE_PREF);
146 // We don't sync prefs::kLanguageCurrentInputMethod and PreviousInputMethod 146 // We don't sync prefs::kLanguageCurrentInputMethod and PreviousInputMethod
147 // because they're just used to track the logout state of the device. 147 // because they're just used to track the logout state of the device.
148 prefs->RegisterStringPref(prefs::kLanguageCurrentInputMethod, 148 prefs->RegisterStringPref(prefs::kLanguageCurrentInputMethod,
149 "", 149 "",
150 PrefService::UNSYNCABLE_PREF); 150 PrefServiceSyncable::UNSYNCABLE_PREF);
151 prefs->RegisterStringPref(prefs::kLanguagePreviousInputMethod, 151 prefs->RegisterStringPref(prefs::kLanguagePreviousInputMethod,
152 "", 152 "",
153 PrefService::UNSYNCABLE_PREF); 153 PrefServiceSyncable::UNSYNCABLE_PREF);
154 // We don't sync the list of input methods and preferred languages since a 154 // We don't sync the list of input methods and preferred languages since a
155 // user might use two or more devices with different hardware keyboards. 155 // user might use two or more devices with different hardware keyboards.
156 // crosbug.com/15181 156 // crosbug.com/15181
157 prefs->RegisterStringPref(prefs::kLanguagePreferredLanguages, 157 prefs->RegisterStringPref(prefs::kLanguagePreferredLanguages,
158 kFallbackInputMethodLocale, 158 kFallbackInputMethodLocale,
159 PrefService::UNSYNCABLE_PREF); 159 PrefServiceSyncable::UNSYNCABLE_PREF);
160 prefs->RegisterStringPref(prefs::kLanguagePreloadEngines, 160 prefs->RegisterStringPref(prefs::kLanguagePreloadEngines,
161 hardware_keyboard_id, 161 hardware_keyboard_id,
162 PrefService::UNSYNCABLE_PREF); 162 PrefServiceSyncable::UNSYNCABLE_PREF);
163 prefs->RegisterStringPref(prefs::kLanguageFilteredExtensionImes, 163 prefs->RegisterStringPref(prefs::kLanguageFilteredExtensionImes,
164 "", 164 "",
165 PrefService::UNSYNCABLE_PREF); 165 PrefServiceSyncable::UNSYNCABLE_PREF);
166 for (size_t i = 0; i < language_prefs::kNumChewingBooleanPrefs; ++i) { 166 for (size_t i = 0; i < language_prefs::kNumChewingBooleanPrefs; ++i) {
167 prefs->RegisterBooleanPref( 167 prefs->RegisterBooleanPref(
168 language_prefs::kChewingBooleanPrefs[i].pref_name, 168 language_prefs::kChewingBooleanPrefs[i].pref_name,
169 language_prefs::kChewingBooleanPrefs[i].default_pref_value, 169 language_prefs::kChewingBooleanPrefs[i].default_pref_value,
170 language_prefs::kChewingBooleanPrefs[i].sync_status); 170 language_prefs::kChewingBooleanPrefs[i].sync_status);
171 } 171 }
172 for (size_t i = 0; i < language_prefs::kNumChewingMultipleChoicePrefs; ++i) { 172 for (size_t i = 0; i < language_prefs::kNumChewingMultipleChoicePrefs; ++i) {
173 prefs->RegisterStringPref( 173 prefs->RegisterStringPref(
174 language_prefs::kChewingMultipleChoicePrefs[i].pref_name, 174 language_prefs::kChewingMultipleChoicePrefs[i].pref_name,
175 language_prefs::kChewingMultipleChoicePrefs[i].default_pref_value, 175 language_prefs::kChewingMultipleChoicePrefs[i].default_pref_value,
176 language_prefs::kChewingMultipleChoicePrefs[i].sync_status); 176 language_prefs::kChewingMultipleChoicePrefs[i].sync_status);
177 } 177 }
178 prefs->RegisterIntegerPref( 178 prefs->RegisterIntegerPref(
179 language_prefs::kChewingHsuSelKeyType.pref_name, 179 language_prefs::kChewingHsuSelKeyType.pref_name,
180 language_prefs::kChewingHsuSelKeyType.default_pref_value, 180 language_prefs::kChewingHsuSelKeyType.default_pref_value,
181 language_prefs::kChewingHsuSelKeyType.sync_status); 181 language_prefs::kChewingHsuSelKeyType.sync_status);
182 182
183 for (size_t i = 0; i < language_prefs::kNumChewingIntegerPrefs; ++i) { 183 for (size_t i = 0; i < language_prefs::kNumChewingIntegerPrefs; ++i) {
184 prefs->RegisterIntegerPref( 184 prefs->RegisterIntegerPref(
185 language_prefs::kChewingIntegerPrefs[i].pref_name, 185 language_prefs::kChewingIntegerPrefs[i].pref_name,
186 language_prefs::kChewingIntegerPrefs[i].default_pref_value, 186 language_prefs::kChewingIntegerPrefs[i].default_pref_value,
187 language_prefs::kChewingIntegerPrefs[i].sync_status); 187 language_prefs::kChewingIntegerPrefs[i].sync_status);
188 } 188 }
189 prefs->RegisterStringPref( 189 prefs->RegisterStringPref(
190 prefs::kLanguageHangulKeyboard, 190 prefs::kLanguageHangulKeyboard,
191 language_prefs::kHangulKeyboardNameIDPairs[0].keyboard_id, 191 language_prefs::kHangulKeyboardNameIDPairs[0].keyboard_id,
192 PrefService::SYNCABLE_PREF); 192 PrefServiceSyncable::SYNCABLE_PREF);
193 prefs->RegisterStringPref(prefs::kLanguageHangulHanjaBindingKeys, 193 prefs->RegisterStringPref(prefs::kLanguageHangulHanjaBindingKeys,
194 language_prefs::kHangulHanjaBindingKeys, 194 language_prefs::kHangulHanjaBindingKeys,
195 // Don't sync the pref as it's not user-configurable 195 // Don't sync the pref as it's not user-configurable
196 PrefService::UNSYNCABLE_PREF); 196 PrefServiceSyncable::UNSYNCABLE_PREF);
197 for (size_t i = 0; i < language_prefs::kNumPinyinBooleanPrefs; ++i) { 197 for (size_t i = 0; i < language_prefs::kNumPinyinBooleanPrefs; ++i) {
198 prefs->RegisterBooleanPref( 198 prefs->RegisterBooleanPref(
199 language_prefs::kPinyinBooleanPrefs[i].pref_name, 199 language_prefs::kPinyinBooleanPrefs[i].pref_name,
200 language_prefs::kPinyinBooleanPrefs[i].default_pref_value, 200 language_prefs::kPinyinBooleanPrefs[i].default_pref_value,
201 language_prefs::kPinyinBooleanPrefs[i].sync_status); 201 language_prefs::kPinyinBooleanPrefs[i].sync_status);
202 } 202 }
203 for (size_t i = 0; i < language_prefs::kNumPinyinIntegerPrefs; ++i) { 203 for (size_t i = 0; i < language_prefs::kNumPinyinIntegerPrefs; ++i) {
204 prefs->RegisterIntegerPref( 204 prefs->RegisterIntegerPref(
205 language_prefs::kPinyinIntegerPrefs[i].pref_name, 205 language_prefs::kPinyinIntegerPrefs[i].pref_name,
206 language_prefs::kPinyinIntegerPrefs[i].default_pref_value, 206 language_prefs::kPinyinIntegerPrefs[i].default_pref_value,
207 language_prefs::kPinyinIntegerPrefs[i].sync_status); 207 language_prefs::kPinyinIntegerPrefs[i].sync_status);
208 } 208 }
209 prefs->RegisterIntegerPref( 209 prefs->RegisterIntegerPref(
210 language_prefs::kPinyinDoublePinyinSchema.pref_name, 210 language_prefs::kPinyinDoublePinyinSchema.pref_name,
211 language_prefs::kPinyinDoublePinyinSchema.default_pref_value, 211 language_prefs::kPinyinDoublePinyinSchema.default_pref_value,
212 PrefService::UNSYNCABLE_PREF); 212 PrefServiceSyncable::UNSYNCABLE_PREF);
213 213
214 for (size_t i = 0; i < language_prefs::kNumMozcBooleanPrefs; ++i) { 214 for (size_t i = 0; i < language_prefs::kNumMozcBooleanPrefs; ++i) {
215 prefs->RegisterBooleanPref( 215 prefs->RegisterBooleanPref(
216 language_prefs::kMozcBooleanPrefs[i].pref_name, 216 language_prefs::kMozcBooleanPrefs[i].pref_name,
217 language_prefs::kMozcBooleanPrefs[i].default_pref_value, 217 language_prefs::kMozcBooleanPrefs[i].default_pref_value,
218 language_prefs::kMozcBooleanPrefs[i].sync_status); 218 language_prefs::kMozcBooleanPrefs[i].sync_status);
219 } 219 }
220 for (size_t i = 0; i < language_prefs::kNumMozcMultipleChoicePrefs; ++i) { 220 for (size_t i = 0; i < language_prefs::kNumMozcMultipleChoicePrefs; ++i) {
221 prefs->RegisterStringPref( 221 prefs->RegisterStringPref(
222 language_prefs::kMozcMultipleChoicePrefs[i].pref_name, 222 language_prefs::kMozcMultipleChoicePrefs[i].pref_name,
223 language_prefs::kMozcMultipleChoicePrefs[i].default_pref_value, 223 language_prefs::kMozcMultipleChoicePrefs[i].default_pref_value,
224 language_prefs::kMozcMultipleChoicePrefs[i].sync_status); 224 language_prefs::kMozcMultipleChoicePrefs[i].sync_status);
225 } 225 }
226 for (size_t i = 0; i < language_prefs::kNumMozcIntegerPrefs; ++i) { 226 for (size_t i = 0; i < language_prefs::kNumMozcIntegerPrefs; ++i) {
227 prefs->RegisterIntegerPref( 227 prefs->RegisterIntegerPref(
228 language_prefs::kMozcIntegerPrefs[i].pref_name, 228 language_prefs::kMozcIntegerPrefs[i].pref_name,
229 language_prefs::kMozcIntegerPrefs[i].default_pref_value, 229 language_prefs::kMozcIntegerPrefs[i].default_pref_value,
230 language_prefs::kMozcIntegerPrefs[i].sync_status); 230 language_prefs::kMozcIntegerPrefs[i].sync_status);
231 } 231 }
232 prefs->RegisterIntegerPref(prefs::kLanguageRemapSearchKeyTo, 232 prefs->RegisterIntegerPref(prefs::kLanguageRemapSearchKeyTo,
233 input_method::kSearchKey, 233 input_method::kSearchKey,
234 PrefService::SYNCABLE_PREF); 234 PrefServiceSyncable::SYNCABLE_PREF);
235 prefs->RegisterIntegerPref(prefs::kLanguageRemapControlKeyTo, 235 prefs->RegisterIntegerPref(prefs::kLanguageRemapControlKeyTo,
236 input_method::kControlKey, 236 input_method::kControlKey,
237 PrefService::SYNCABLE_PREF); 237 PrefServiceSyncable::SYNCABLE_PREF);
238 prefs->RegisterIntegerPref(prefs::kLanguageRemapAltKeyTo, 238 prefs->RegisterIntegerPref(prefs::kLanguageRemapAltKeyTo,
239 input_method::kAltKey, 239 input_method::kAltKey,
240 PrefService::SYNCABLE_PREF); 240 PrefServiceSyncable::SYNCABLE_PREF);
241 prefs->RegisterIntegerPref(prefs::kLanguageRemapCapsLockKeyTo, 241 prefs->RegisterIntegerPref(prefs::kLanguageRemapCapsLockKeyTo,
242 input_method::kCapsLockKey, 242 input_method::kCapsLockKey,
243 PrefService::SYNCABLE_PREF); 243 PrefServiceSyncable::SYNCABLE_PREF);
244 // We don't sync the following keyboard prefs since they are not user- 244 // We don't sync the following keyboard prefs since they are not user-
245 // configurable. 245 // configurable.
246 prefs->RegisterBooleanPref(prefs::kLanguageXkbAutoRepeatEnabled, 246 prefs->RegisterBooleanPref(prefs::kLanguageXkbAutoRepeatEnabled,
247 true, 247 true,
248 PrefService::UNSYNCABLE_PREF); 248 PrefServiceSyncable::UNSYNCABLE_PREF);
249 prefs->RegisterIntegerPref(prefs::kLanguageXkbAutoRepeatDelay, 249 prefs->RegisterIntegerPref(prefs::kLanguageXkbAutoRepeatDelay,
250 language_prefs::kXkbAutoRepeatDelayInMs, 250 language_prefs::kXkbAutoRepeatDelayInMs,
251 PrefService::UNSYNCABLE_PREF); 251 PrefServiceSyncable::UNSYNCABLE_PREF);
252 prefs->RegisterIntegerPref(prefs::kLanguageXkbAutoRepeatInterval, 252 prefs->RegisterIntegerPref(prefs::kLanguageXkbAutoRepeatInterval,
253 language_prefs::kXkbAutoRepeatIntervalInMs, 253 language_prefs::kXkbAutoRepeatIntervalInMs,
254 PrefService::UNSYNCABLE_PREF); 254 PrefServiceSyncable::UNSYNCABLE_PREF);
255 255
256 // Screen lock default to off. 256 // Screen lock default to off.
257 prefs->RegisterBooleanPref(prefs::kEnableScreenLock, 257 prefs->RegisterBooleanPref(prefs::kEnableScreenLock,
258 false, 258 false,
259 PrefService::SYNCABLE_PREF); 259 PrefServiceSyncable::SYNCABLE_PREF);
260 260
261 // Mobile plan notifications default to on. 261 // Mobile plan notifications default to on.
262 prefs->RegisterBooleanPref(prefs::kShowPlanNotifications, 262 prefs->RegisterBooleanPref(prefs::kShowPlanNotifications,
263 true, 263 true,
264 PrefService::SYNCABLE_PREF); 264 PrefServiceSyncable::SYNCABLE_PREF);
265 265
266 // 3G first-time usage promo will be shown at least once. 266 // 3G first-time usage promo will be shown at least once.
267 prefs->RegisterBooleanPref(prefs::kShow3gPromoNotification, 267 prefs->RegisterBooleanPref(prefs::kShow3gPromoNotification,
268 true, 268 true,
269 PrefService::UNSYNCABLE_PREF); 269 PrefServiceSyncable::UNSYNCABLE_PREF);
270 270
271 // Initially all existing users would see "What's new" 271 // Initially all existing users would see "What's new"
272 // for current version after update. 272 // for current version after update.
273 prefs->RegisterStringPref(prefs::kChromeOSReleaseNotesVersion, 273 prefs->RegisterStringPref(prefs::kChromeOSReleaseNotesVersion,
274 "0.0.0.0", 274 "0.0.0.0",
275 PrefService::SYNCABLE_PREF); 275 PrefServiceSyncable::SYNCABLE_PREF);
276 276
277 // OAuth1 all access token and secret pair. 277 // OAuth1 all access token and secret pair.
278 prefs->RegisterStringPref(prefs::kOAuth1Token, 278 prefs->RegisterStringPref(prefs::kOAuth1Token,
279 "", 279 "",
280 PrefService::UNSYNCABLE_PREF); 280 PrefServiceSyncable::UNSYNCABLE_PREF);
281 prefs->RegisterStringPref(prefs::kOAuth1Secret, 281 prefs->RegisterStringPref(prefs::kOAuth1Secret,
282 "", 282 "",
283 PrefService::UNSYNCABLE_PREF); 283 PrefServiceSyncable::UNSYNCABLE_PREF);
284 284
285 // TODO(wad): Once UI is connected, a final default can be set. At that point 285 // TODO(wad): Once UI is connected, a final default can be set. At that point
286 // change this pref from UNSYNCABLE to SYNCABLE. 286 // change this pref from UNSYNCABLE to SYNCABLE.
287 prefs->RegisterBooleanPref(prefs::kEnableCrosDRM, 287 prefs->RegisterBooleanPref(prefs::kEnableCrosDRM,
288 true, 288 true,
289 PrefService::UNSYNCABLE_PREF); 289 PrefServiceSyncable::UNSYNCABLE_PREF);
290 290
291 prefs->RegisterBooleanPref(prefs::kExternalStorageDisabled, 291 prefs->RegisterBooleanPref(prefs::kExternalStorageDisabled,
292 false, 292 false,
293 PrefService::UNSYNCABLE_PREF); 293 PrefServiceSyncable::UNSYNCABLE_PREF);
294 } 294 }
295 295
296 void Preferences::InitUserPrefs(PrefService* prefs) { 296 void Preferences::InitUserPrefs(PrefService* prefs) {
297 prefs_ = prefs; 297 prefs_ = prefs;
298 298
299 BooleanPrefMember::NamedChangeCallback callback = 299 BooleanPrefMember::NamedChangeCallback callback =
300 base::Bind(&Preferences::OnPreferenceChanged, base::Unretained(this)); 300 base::Bind(&Preferences::OnPreferenceChanged, base::Unretained(this));
301 301
302 tap_to_click_enabled_.Init(prefs::kTapToClickEnabled, prefs, callback); 302 tap_to_click_enabled_.Init(prefs::kTapToClickEnabled, prefs, callback);
303 tap_dragging_enabled_.Init(prefs::kTapDraggingEnabled, prefs, callback); 303 tap_dragging_enabled_.Init(prefs::kTapDraggingEnabled, prefs, callback);
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 768
769 input_method::AutoRepeatRate rate; 769 input_method::AutoRepeatRate rate;
770 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); 770 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue();
771 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); 771 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue();
772 DCHECK(rate.initial_delay_in_ms > 0); 772 DCHECK(rate.initial_delay_in_ms > 0);
773 DCHECK(rate.repeat_interval_in_ms > 0); 773 DCHECK(rate.repeat_interval_in_ms > 0);
774 input_method::XKeyboard::SetAutoRepeatRate(rate); 774 input_method::XKeyboard::SetAutoRepeatRate(rate);
775 } 775 }
776 776
777 } // namespace chromeos 777 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698