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

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

Issue 14622003: components: Move PrefRegistrySyncable into user_prefs namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 7 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
« no previous file with comments | « chrome/browser/chromeos/preferences.h ('k') | chrome/browser/chromeos/preferences_unittest.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) 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 "ash/magnifier/magnifier_constants.h" 7 #include "ash/magnifier/magnifier_constants.h"
8 #include "base/chromeos/chromeos_version.h" 8 #include "base/chromeos/chromeos_version.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // static 60 // static
61 void Preferences::RegisterPrefs(PrefRegistrySimple* registry) { 61 void Preferences::RegisterPrefs(PrefRegistrySimple* registry) {
62 registry->RegisterBooleanPref(prefs::kHighContrastEnabled, false); 62 registry->RegisterBooleanPref(prefs::kHighContrastEnabled, false);
63 registry->RegisterBooleanPref(prefs::kOwnerPrimaryMouseButtonRight, false); 63 registry->RegisterBooleanPref(prefs::kOwnerPrimaryMouseButtonRight, false);
64 registry->RegisterBooleanPref(prefs::kOwnerTapToClickEnabled, true); 64 registry->RegisterBooleanPref(prefs::kOwnerTapToClickEnabled, true);
65 registry->RegisterBooleanPref(prefs::kSpokenFeedbackEnabled, false); 65 registry->RegisterBooleanPref(prefs::kSpokenFeedbackEnabled, false);
66 registry->RegisterBooleanPref(prefs::kVirtualKeyboardEnabled, false); 66 registry->RegisterBooleanPref(prefs::kVirtualKeyboardEnabled, false);
67 } 67 }
68 68
69 // static 69 // static
70 void Preferences::RegisterUserPrefs(PrefRegistrySyncable* registry) { 70 void Preferences::RegisterUserPrefs(
71 user_prefs::PrefRegistrySyncable* registry) {
71 std::string hardware_keyboard_id; 72 std::string hardware_keyboard_id;
72 // TODO(yusukes): Remove the runtime hack. 73 // TODO(yusukes): Remove the runtime hack.
73 if (base::chromeos::IsRunningOnChromeOS()) { 74 if (base::chromeos::IsRunningOnChromeOS()) {
74 input_method::InputMethodManager* manager = 75 input_method::InputMethodManager* manager =
75 input_method::GetInputMethodManager(); 76 input_method::GetInputMethodManager();
76 if (manager) { 77 if (manager) {
77 hardware_keyboard_id = 78 hardware_keyboard_id =
78 manager->GetInputMethodUtil()->GetHardwareInputMethodId(); 79 manager->GetInputMethodUtil()->GetHardwareInputMethodId();
79 } 80 }
80 } else { 81 } else {
81 hardware_keyboard_id = "xkb:us::eng"; // only for testing. 82 hardware_keyboard_id = "xkb:us::eng"; // only for testing.
82 } 83 }
83 84
84 registry->RegisterBooleanPref(prefs::kTapToClickEnabled, 85 registry->RegisterBooleanPref(
85 true, 86 prefs::kTapToClickEnabled,
86 PrefRegistrySyncable::SYNCABLE_PREF); 87 true,
87 registry->RegisterBooleanPref(prefs::kTapDraggingEnabled, 88 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
88 false, 89 registry->RegisterBooleanPref(
89 PrefRegistrySyncable::SYNCABLE_PREF); 90 prefs::kTapDraggingEnabled,
90 registry->RegisterBooleanPref(prefs::kEnableTouchpadThreeFingerClick, 91 false,
91 false, 92 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
92 PrefRegistrySyncable::UNSYNCABLE_PREF); 93 registry->RegisterBooleanPref(
93 registry->RegisterBooleanPref(prefs::kEnableTouchpadThreeFingerSwipe, 94 prefs::kEnableTouchpadThreeFingerClick,
94 false, 95 false,
95 PrefRegistrySyncable::UNSYNCABLE_PREF); 96 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
97 registry->RegisterBooleanPref(
98 prefs::kEnableTouchpadThreeFingerSwipe,
99 false,
100 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
96 registry->RegisterBooleanPref( 101 registry->RegisterBooleanPref(
97 prefs::kNaturalScroll, 102 prefs::kNaturalScroll,
98 CommandLine::ForCurrentProcess()->HasSwitch( 103 CommandLine::ForCurrentProcess()->HasSwitch(
99 ::switches::kNaturalScrollDefault), 104 ::switches::kNaturalScrollDefault),
100 PrefRegistrySyncable::SYNCABLE_PREF); 105 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
101 registry->RegisterBooleanPref(prefs::kPrimaryMouseButtonRight, 106 registry->RegisterBooleanPref(
102 false, 107 prefs::kPrimaryMouseButtonRight,
103 PrefRegistrySyncable::SYNCABLE_PREF); 108 false,
104 registry->RegisterBooleanPref(prefs::kLabsMediaplayerEnabled, 109 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
105 false, 110 registry->RegisterBooleanPref(
106 PrefRegistrySyncable::UNSYNCABLE_PREF); 111 prefs::kLabsMediaplayerEnabled,
107 registry->RegisterBooleanPref(prefs::kLabsAdvancedFilesystemEnabled, 112 false,
108 false, 113 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
109 PrefRegistrySyncable::UNSYNCABLE_PREF); 114 registry->RegisterBooleanPref(
110 registry->RegisterBooleanPref(prefs::kScreenMagnifierEnabled, 115 prefs::kLabsAdvancedFilesystemEnabled,
111 false, 116 false,
112 PrefRegistrySyncable::SYNCABLE_PREF); 117 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
113 registry->RegisterIntegerPref(prefs::kScreenMagnifierType, 118 registry->RegisterBooleanPref(
114 ash::kDefaultMagnifierType, 119 prefs::kScreenMagnifierEnabled,
115 PrefRegistrySyncable::SYNCABLE_PREF); 120 false,
116 registry->RegisterDoublePref(prefs::kScreenMagnifierScale, 121 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
117 std::numeric_limits<double>::min(), 122 registry->RegisterIntegerPref(
118 PrefRegistrySyncable::UNSYNCABLE_PREF); 123 prefs::kScreenMagnifierType,
119 registry->RegisterBooleanPref(prefs::kShouldAlwaysShowAccessibilityMenu, 124 ash::kDefaultMagnifierType,
120 false, 125 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
121 PrefRegistrySyncable::UNSYNCABLE_PREF); 126 registry->RegisterDoublePref(
122 registry->RegisterIntegerPref(prefs::kMouseSensitivity, 127 prefs::kScreenMagnifierScale,
123 3, 128 std::numeric_limits<double>::min(),
124 PrefRegistrySyncable::SYNCABLE_PREF); 129 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
125 registry->RegisterIntegerPref(prefs::kTouchpadSensitivity, 130 registry->RegisterBooleanPref(
126 3, 131 prefs::kShouldAlwaysShowAccessibilityMenu,
127 PrefRegistrySyncable::SYNCABLE_PREF); 132 false,
128 registry->RegisterBooleanPref(prefs::kUse24HourClock, 133 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
129 base::GetHourClockType() == base::k24HourClock, 134 registry->RegisterIntegerPref(
130 PrefRegistrySyncable::SYNCABLE_PREF); 135 prefs::kMouseSensitivity,
131 registry->RegisterBooleanPref(prefs::kDisableDrive, 136 3,
132 false, 137 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
133 PrefRegistrySyncable::SYNCABLE_PREF); 138 registry->RegisterIntegerPref(
134 registry->RegisterBooleanPref(prefs::kDisableDriveOverCellular, 139 prefs::kTouchpadSensitivity,
135 true, 140 3,
136 PrefRegistrySyncable::SYNCABLE_PREF); 141 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
137 registry->RegisterBooleanPref(prefs::kDisableDriveHostedFiles, 142 registry->RegisterBooleanPref(
138 false, 143 prefs::kUse24HourClock,
139 PrefRegistrySyncable::SYNCABLE_PREF); 144 base::GetHourClockType() == base::k24HourClock,
145 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
146 registry->RegisterBooleanPref(
147 prefs::kDisableDrive,
148 false,
149 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
150 registry->RegisterBooleanPref(
151 prefs::kDisableDriveOverCellular,
152 true,
153 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
154 registry->RegisterBooleanPref(
155 prefs::kDisableDriveHostedFiles,
156 false,
157 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
140 // We don't sync prefs::kLanguageCurrentInputMethod and PreviousInputMethod 158 // We don't sync prefs::kLanguageCurrentInputMethod and PreviousInputMethod
141 // because they're just used to track the logout state of the device. 159 // because they're just used to track the logout state of the device.
142 registry->RegisterStringPref(prefs::kLanguageCurrentInputMethod, 160 registry->RegisterStringPref(
143 "", 161 prefs::kLanguageCurrentInputMethod,
144 PrefRegistrySyncable::UNSYNCABLE_PREF); 162 "",
145 registry->RegisterStringPref(prefs::kLanguagePreviousInputMethod, 163 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
146 "", 164 registry->RegisterStringPref(
147 PrefRegistrySyncable::UNSYNCABLE_PREF); 165 prefs::kLanguagePreviousInputMethod,
166 "",
167 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
148 // We don't sync the list of input methods and preferred languages since a 168 // We don't sync the list of input methods and preferred languages since a
149 // user might use two or more devices with different hardware keyboards. 169 // user might use two or more devices with different hardware keyboards.
150 // crosbug.com/15181 170 // crosbug.com/15181
151 registry->RegisterStringPref(prefs::kLanguagePreferredLanguages, 171 registry->RegisterStringPref(
152 kFallbackInputMethodLocale, 172 prefs::kLanguagePreferredLanguages,
153 PrefRegistrySyncable::UNSYNCABLE_PREF); 173 kFallbackInputMethodLocale,
154 registry->RegisterStringPref(prefs::kLanguagePreloadEngines, 174 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
155 hardware_keyboard_id, 175 registry->RegisterStringPref(
156 PrefRegistrySyncable::UNSYNCABLE_PREF); 176 prefs::kLanguagePreloadEngines,
157 registry->RegisterStringPref(prefs::kLanguageFilteredExtensionImes, 177 hardware_keyboard_id,
158 "", 178 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
159 PrefRegistrySyncable::UNSYNCABLE_PREF); 179 registry->RegisterStringPref(
180 prefs::kLanguageFilteredExtensionImes,
181 "",
182 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
160 for (size_t i = 0; i < language_prefs::kNumChewingBooleanPrefs; ++i) { 183 for (size_t i = 0; i < language_prefs::kNumChewingBooleanPrefs; ++i) {
161 registry->RegisterBooleanPref( 184 registry->RegisterBooleanPref(
162 language_prefs::kChewingBooleanPrefs[i].pref_name, 185 language_prefs::kChewingBooleanPrefs[i].pref_name,
163 language_prefs::kChewingBooleanPrefs[i].default_pref_value, 186 language_prefs::kChewingBooleanPrefs[i].default_pref_value,
164 language_prefs::kChewingBooleanPrefs[i].sync_status); 187 language_prefs::kChewingBooleanPrefs[i].sync_status);
165 } 188 }
166 for (size_t i = 0; i < language_prefs::kNumChewingMultipleChoicePrefs; ++i) { 189 for (size_t i = 0; i < language_prefs::kNumChewingMultipleChoicePrefs; ++i) {
167 registry->RegisterStringPref( 190 registry->RegisterStringPref(
168 language_prefs::kChewingMultipleChoicePrefs[i].pref_name, 191 language_prefs::kChewingMultipleChoicePrefs[i].pref_name,
169 language_prefs::kChewingMultipleChoicePrefs[i].default_pref_value, 192 language_prefs::kChewingMultipleChoicePrefs[i].default_pref_value,
170 language_prefs::kChewingMultipleChoicePrefs[i].sync_status); 193 language_prefs::kChewingMultipleChoicePrefs[i].sync_status);
171 } 194 }
172 registry->RegisterIntegerPref( 195 registry->RegisterIntegerPref(
173 language_prefs::kChewingHsuSelKeyType.pref_name, 196 language_prefs::kChewingHsuSelKeyType.pref_name,
174 language_prefs::kChewingHsuSelKeyType.default_pref_value, 197 language_prefs::kChewingHsuSelKeyType.default_pref_value,
175 language_prefs::kChewingHsuSelKeyType.sync_status); 198 language_prefs::kChewingHsuSelKeyType.sync_status);
176 199
177 for (size_t i = 0; i < language_prefs::kNumChewingIntegerPrefs; ++i) { 200 for (size_t i = 0; i < language_prefs::kNumChewingIntegerPrefs; ++i) {
178 registry->RegisterIntegerPref( 201 registry->RegisterIntegerPref(
179 language_prefs::kChewingIntegerPrefs[i].pref_name, 202 language_prefs::kChewingIntegerPrefs[i].pref_name,
180 language_prefs::kChewingIntegerPrefs[i].default_pref_value, 203 language_prefs::kChewingIntegerPrefs[i].default_pref_value,
181 language_prefs::kChewingIntegerPrefs[i].sync_status); 204 language_prefs::kChewingIntegerPrefs[i].sync_status);
182 } 205 }
183 registry->RegisterStringPref( 206 registry->RegisterStringPref(
184 prefs::kLanguageHangulKeyboard, 207 prefs::kLanguageHangulKeyboard,
185 language_prefs::kHangulKeyboardNameIDPairs[0].keyboard_id, 208 language_prefs::kHangulKeyboardNameIDPairs[0].keyboard_id,
186 PrefRegistrySyncable::SYNCABLE_PREF); 209 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
187 registry->RegisterStringPref( 210 registry->RegisterStringPref(
188 prefs::kLanguageHangulHanjaBindingKeys, 211 prefs::kLanguageHangulHanjaBindingKeys,
189 language_prefs::kHangulHanjaBindingKeys, 212 language_prefs::kHangulHanjaBindingKeys,
190 // Don't sync the pref as it's not user-configurable 213 // Don't sync the pref as it's not user-configurable
191 PrefRegistrySyncable::UNSYNCABLE_PREF); 214 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
192 for (size_t i = 0; i < language_prefs::kNumPinyinBooleanPrefs; ++i) { 215 for (size_t i = 0; i < language_prefs::kNumPinyinBooleanPrefs; ++i) {
193 registry->RegisterBooleanPref( 216 registry->RegisterBooleanPref(
194 language_prefs::kPinyinBooleanPrefs[i].pref_name, 217 language_prefs::kPinyinBooleanPrefs[i].pref_name,
195 language_prefs::kPinyinBooleanPrefs[i].default_pref_value, 218 language_prefs::kPinyinBooleanPrefs[i].default_pref_value,
196 language_prefs::kPinyinBooleanPrefs[i].sync_status); 219 language_prefs::kPinyinBooleanPrefs[i].sync_status);
197 } 220 }
198 for (size_t i = 0; i < language_prefs::kNumPinyinIntegerPrefs; ++i) { 221 for (size_t i = 0; i < language_prefs::kNumPinyinIntegerPrefs; ++i) {
199 registry->RegisterIntegerPref( 222 registry->RegisterIntegerPref(
200 language_prefs::kPinyinIntegerPrefs[i].pref_name, 223 language_prefs::kPinyinIntegerPrefs[i].pref_name,
201 language_prefs::kPinyinIntegerPrefs[i].default_pref_value, 224 language_prefs::kPinyinIntegerPrefs[i].default_pref_value,
202 language_prefs::kPinyinIntegerPrefs[i].sync_status); 225 language_prefs::kPinyinIntegerPrefs[i].sync_status);
203 } 226 }
204 registry->RegisterIntegerPref( 227 registry->RegisterIntegerPref(
205 language_prefs::kPinyinDoublePinyinSchema.pref_name, 228 language_prefs::kPinyinDoublePinyinSchema.pref_name,
206 language_prefs::kPinyinDoublePinyinSchema.default_pref_value, 229 language_prefs::kPinyinDoublePinyinSchema.default_pref_value,
207 PrefRegistrySyncable::UNSYNCABLE_PREF); 230 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
208 231
209 for (size_t i = 0; i < language_prefs::kNumMozcBooleanPrefs; ++i) { 232 for (size_t i = 0; i < language_prefs::kNumMozcBooleanPrefs; ++i) {
210 registry->RegisterBooleanPref( 233 registry->RegisterBooleanPref(
211 language_prefs::kMozcBooleanPrefs[i].pref_name, 234 language_prefs::kMozcBooleanPrefs[i].pref_name,
212 language_prefs::kMozcBooleanPrefs[i].default_pref_value, 235 language_prefs::kMozcBooleanPrefs[i].default_pref_value,
213 language_prefs::kMozcBooleanPrefs[i].sync_status); 236 language_prefs::kMozcBooleanPrefs[i].sync_status);
214 } 237 }
215 for (size_t i = 0; i < language_prefs::kNumMozcMultipleChoicePrefs; ++i) { 238 for (size_t i = 0; i < language_prefs::kNumMozcMultipleChoicePrefs; ++i) {
216 registry->RegisterStringPref( 239 registry->RegisterStringPref(
217 language_prefs::kMozcMultipleChoicePrefs[i].pref_name, 240 language_prefs::kMozcMultipleChoicePrefs[i].pref_name,
218 language_prefs::kMozcMultipleChoicePrefs[i].default_pref_value, 241 language_prefs::kMozcMultipleChoicePrefs[i].default_pref_value,
219 language_prefs::kMozcMultipleChoicePrefs[i].sync_status); 242 language_prefs::kMozcMultipleChoicePrefs[i].sync_status);
220 } 243 }
221 for (size_t i = 0; i < language_prefs::kNumMozcIntegerPrefs; ++i) { 244 for (size_t i = 0; i < language_prefs::kNumMozcIntegerPrefs; ++i) {
222 registry->RegisterIntegerPref( 245 registry->RegisterIntegerPref(
223 language_prefs::kMozcIntegerPrefs[i].pref_name, 246 language_prefs::kMozcIntegerPrefs[i].pref_name,
224 language_prefs::kMozcIntegerPrefs[i].default_pref_value, 247 language_prefs::kMozcIntegerPrefs[i].default_pref_value,
225 language_prefs::kMozcIntegerPrefs[i].sync_status); 248 language_prefs::kMozcIntegerPrefs[i].sync_status);
226 } 249 }
227 registry->RegisterIntegerPref(prefs::kLanguageRemapSearchKeyTo, 250 registry->RegisterIntegerPref(
228 input_method::kSearchKey, 251 prefs::kLanguageRemapSearchKeyTo,
229 PrefRegistrySyncable::SYNCABLE_PREF); 252 input_method::kSearchKey,
230 registry->RegisterIntegerPref(prefs::kLanguageRemapControlKeyTo, 253 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
231 input_method::kControlKey, 254 registry->RegisterIntegerPref(
232 PrefRegistrySyncable::SYNCABLE_PREF); 255 prefs::kLanguageRemapControlKeyTo,
233 registry->RegisterIntegerPref(prefs::kLanguageRemapAltKeyTo, 256 input_method::kControlKey,
234 input_method::kAltKey, 257 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
235 PrefRegistrySyncable::SYNCABLE_PREF); 258 registry->RegisterIntegerPref(
236 registry->RegisterIntegerPref(prefs::kLanguageRemapCapsLockKeyTo, 259 prefs::kLanguageRemapAltKeyTo,
237 input_method::kCapsLockKey, 260 input_method::kAltKey,
238 PrefRegistrySyncable::SYNCABLE_PREF); 261 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
239 registry->RegisterIntegerPref(prefs::kLanguageRemapDiamondKeyTo, 262 registry->RegisterIntegerPref(
240 input_method::kControlKey, 263 prefs::kLanguageRemapCapsLockKeyTo,
241 PrefRegistrySyncable::SYNCABLE_PREF); 264 input_method::kCapsLockKey,
265 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
266 registry->RegisterIntegerPref(
267 prefs::kLanguageRemapDiamondKeyTo,
268 input_method::kControlKey,
269 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
242 // We don't sync the following keyboard prefs since they are not user- 270 // We don't sync the following keyboard prefs since they are not user-
243 // configurable. 271 // configurable.
244 registry->RegisterBooleanPref(prefs::kLanguageXkbAutoRepeatEnabled, 272 registry->RegisterBooleanPref(
245 true, 273 prefs::kLanguageXkbAutoRepeatEnabled,
246 PrefRegistrySyncable::UNSYNCABLE_PREF); 274 true,
247 registry->RegisterIntegerPref(prefs::kLanguageXkbAutoRepeatDelay, 275 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
248 language_prefs::kXkbAutoRepeatDelayInMs, 276 registry->RegisterIntegerPref(
249 PrefRegistrySyncable::UNSYNCABLE_PREF); 277 prefs::kLanguageXkbAutoRepeatDelay,
250 registry->RegisterIntegerPref(prefs::kLanguageXkbAutoRepeatInterval, 278 language_prefs::kXkbAutoRepeatDelayInMs,
251 language_prefs::kXkbAutoRepeatIntervalInMs, 279 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
252 PrefRegistrySyncable::UNSYNCABLE_PREF); 280 registry->RegisterIntegerPref(
281 prefs::kLanguageXkbAutoRepeatInterval,
282 language_prefs::kXkbAutoRepeatIntervalInMs,
283 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
253 284
254 // Screen lock default to off. 285 // Screen lock default to off.
255 registry->RegisterBooleanPref(prefs::kEnableScreenLock, 286 registry->RegisterBooleanPref(
256 false, 287 prefs::kEnableScreenLock,
257 PrefRegistrySyncable::SYNCABLE_PREF); 288 false,
289 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
258 290
259 // Mobile plan notifications default to on. 291 // Mobile plan notifications default to on.
260 registry->RegisterBooleanPref(prefs::kShowPlanNotifications, 292 registry->RegisterBooleanPref(
261 true, 293 prefs::kShowPlanNotifications,
262 PrefRegistrySyncable::SYNCABLE_PREF); 294 true,
295 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
263 296
264 // 3G first-time usage promo will be shown at least once. 297 // 3G first-time usage promo will be shown at least once.
265 registry->RegisterBooleanPref(prefs::kShow3gPromoNotification, 298 registry->RegisterBooleanPref(
266 true, 299 prefs::kShow3gPromoNotification,
267 PrefRegistrySyncable::UNSYNCABLE_PREF); 300 true,
301 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
268 302
269 // Initially all existing users would see "What's new" 303 // Initially all existing users would see "What's new" for current version
270 // for current version after update. 304 // after update.
271 registry->RegisterStringPref(prefs::kChromeOSReleaseNotesVersion, 305 registry->RegisterStringPref(prefs::kChromeOSReleaseNotesVersion,
272 "0.0.0.0", 306 "0.0.0.0",
273 PrefRegistrySyncable::SYNCABLE_PREF); 307 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
274 308
275 registry->RegisterBooleanPref(prefs::kExternalStorageDisabled, 309 registry->RegisterBooleanPref(
276 false, 310 prefs::kExternalStorageDisabled,
277 PrefRegistrySyncable::UNSYNCABLE_PREF); 311 false,
312 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
278 313
279 registry->RegisterIntegerPref(prefs::kPowerAcScreenDimDelayMs, 314 registry->RegisterIntegerPref(
280 420000, 315 prefs::kPowerAcScreenDimDelayMs,
281 PrefRegistrySyncable::UNSYNCABLE_PREF); 316 420000,
282 registry->RegisterIntegerPref(prefs::kPowerAcScreenOffDelayMs, 317 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
283 480000, 318 registry->RegisterIntegerPref(
284 PrefRegistrySyncable::UNSYNCABLE_PREF); 319 prefs::kPowerAcScreenOffDelayMs,
285 registry->RegisterIntegerPref(prefs::kPowerAcScreenLockDelayMs, 320 480000,
286 0, 321 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
287 PrefRegistrySyncable::UNSYNCABLE_PREF); 322 registry->RegisterIntegerPref(
288 registry->RegisterIntegerPref(prefs::kPowerAcIdleWarningDelayMs, 323 prefs::kPowerAcScreenLockDelayMs,
289 0, 324 0,
290 PrefRegistrySyncable::UNSYNCABLE_PREF); 325 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
291 registry->RegisterIntegerPref(prefs::kPowerAcIdleDelayMs, 326 registry->RegisterIntegerPref(
292 1800000, 327 prefs::kPowerAcIdleWarningDelayMs,
293 PrefRegistrySyncable::UNSYNCABLE_PREF); 328 0,
294 registry->RegisterIntegerPref(prefs::kPowerBatteryScreenDimDelayMs, 329 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
295 300000, 330 registry->RegisterIntegerPref(
296 PrefRegistrySyncable::UNSYNCABLE_PREF); 331 prefs::kPowerAcIdleDelayMs,
297 registry->RegisterIntegerPref(prefs::kPowerBatteryScreenOffDelayMs, 332 1800000,
298 360000, 333 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
299 PrefRegistrySyncable::UNSYNCABLE_PREF); 334 registry->RegisterIntegerPref(
300 registry->RegisterIntegerPref(prefs::kPowerBatteryScreenLockDelayMs, 335 prefs::kPowerBatteryScreenDimDelayMs,
301 0, 336 300000,
302 PrefRegistrySyncable::UNSYNCABLE_PREF); 337 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
303 registry->RegisterIntegerPref(prefs::kPowerBatteryIdleWarningDelayMs, 338 registry->RegisterIntegerPref(
304 0, 339 prefs::kPowerBatteryScreenOffDelayMs,
305 PrefRegistrySyncable::UNSYNCABLE_PREF); 340 360000,
306 registry->RegisterIntegerPref(prefs::kPowerBatteryIdleDelayMs, 341 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
307 600000, 342 registry->RegisterIntegerPref(
308 PrefRegistrySyncable::UNSYNCABLE_PREF); 343 prefs::kPowerBatteryScreenLockDelayMs,
309 registry->RegisterIntegerPref(prefs::kPowerIdleAction, 344 0,
310 PowerPolicyController::ACTION_SUSPEND, 345 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
311 PrefRegistrySyncable::UNSYNCABLE_PREF); 346 registry->RegisterIntegerPref(
312 registry->RegisterIntegerPref(prefs::kPowerLidClosedAction, 347 prefs::kPowerBatteryIdleWarningDelayMs,
313 PowerPolicyController::ACTION_SUSPEND, 348 0,
314 PrefRegistrySyncable::UNSYNCABLE_PREF); 349 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
315 registry->RegisterBooleanPref(prefs::kPowerUseAudioActivity, 350 registry->RegisterIntegerPref(
316 true, 351 prefs::kPowerBatteryIdleDelayMs,
317 PrefRegistrySyncable::UNSYNCABLE_PREF); 352 600000,
318 registry->RegisterBooleanPref(prefs::kPowerUseVideoActivity, 353 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
319 true, 354 registry->RegisterIntegerPref(
320 PrefRegistrySyncable::UNSYNCABLE_PREF); 355 prefs::kPowerIdleAction,
321 registry->RegisterBooleanPref(prefs::kPowerAllowScreenWakeLocks, 356 PowerPolicyController::ACTION_SUSPEND,
322 true, 357 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
323 PrefRegistrySyncable::UNSYNCABLE_PREF); 358 registry->RegisterIntegerPref(
324 registry->RegisterDoublePref(prefs::kPowerPresentationIdleDelayFactor, 359 prefs::kPowerLidClosedAction,
325 2.0, 360 PowerPolicyController::ACTION_SUSPEND,
326 PrefRegistrySyncable::UNSYNCABLE_PREF); 361 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
362 registry->RegisterBooleanPref(
363 prefs::kPowerUseAudioActivity,
364 true,
365 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
366 registry->RegisterBooleanPref(
367 prefs::kPowerUseVideoActivity,
368 true,
369 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
370 registry->RegisterBooleanPref(
371 prefs::kPowerAllowScreenWakeLocks,
372 true,
373 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
374 registry->RegisterDoublePref(
375 prefs::kPowerPresentationIdleDelayFactor,
376 2.0,
377 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
327 // TODO(derat): Change the default to 2.0 once a policy is added such 378 // TODO(derat): Change the default to 2.0 once a policy is added such
328 // that this can be set to 1.0 for public accounts. 379 // that this can be set to 1.0 for public accounts.
329 registry->RegisterDoublePref(prefs::kPowerUserActivityScreenDimDelayFactor, 380 registry->RegisterDoublePref(
330 1.0, 381 prefs::kPowerUserActivityScreenDimDelayFactor,
331 PrefRegistrySyncable::UNSYNCABLE_PREF); 382 1.0,
383 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
332 384
333 registry->RegisterStringPref(prefs::kTermsOfServiceURL, 385 registry->RegisterStringPref(
334 "", 386 prefs::kTermsOfServiceURL,
335 PrefRegistrySyncable::UNSYNCABLE_PREF); 387 "",
388 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
336 } 389 }
337 390
338 void Preferences::InitUserPrefs(PrefServiceSyncable* prefs) { 391 void Preferences::InitUserPrefs(PrefServiceSyncable* prefs) {
339 prefs_ = prefs; 392 prefs_ = prefs;
340 393
341 BooleanPrefMember::NamedChangeCallback callback = 394 BooleanPrefMember::NamedChangeCallback callback =
342 base::Bind(&Preferences::OnPreferenceChanged, base::Unretained(this)); 395 base::Bind(&Preferences::OnPreferenceChanged, base::Unretained(this));
343 396
344 tap_to_click_enabled_.Init(prefs::kTapToClickEnabled, prefs, callback); 397 tap_to_click_enabled_.Init(prefs::kTapToClickEnabled, prefs, callback);
345 tap_dragging_enabled_.Init(prefs::kTapDraggingEnabled, prefs, callback); 398 tap_dragging_enabled_.Init(prefs::kTapDraggingEnabled, prefs, callback);
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 982
930 input_method::AutoRepeatRate rate; 983 input_method::AutoRepeatRate rate;
931 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); 984 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue();
932 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); 985 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue();
933 DCHECK(rate.initial_delay_in_ms > 0); 986 DCHECK(rate.initial_delay_in_ms > 0);
934 DCHECK(rate.repeat_interval_in_ms > 0); 987 DCHECK(rate.repeat_interval_in_ms > 0);
935 input_method::XKeyboard::SetAutoRepeatRate(rate); 988 input_method::XKeyboard::SetAutoRepeatRate(rate);
936 } 989 }
937 990
938 } // namespace chromeos 991 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/preferences.h ('k') | chrome/browser/chromeos/preferences_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698