OLD | NEW |
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 // This provides a way to access the application's current preferences. | 5 // This provides a way to access the application's current preferences. |
6 | 6 |
7 // Chromium settings and storage represent user-selected preferences and | 7 // Chromium settings and storage represent user-selected preferences and |
8 // information and MUST not be extracted, overwritten or modified except | 8 // information and MUST not be extracted, overwritten or modified except |
9 // through Chromium defined APIs. | 9 // through Chromium defined APIs. |
10 | 10 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 double GetDouble(const char* path) const; | 260 double GetDouble(const char* path) const; |
261 std::string GetString(const char* path) const; | 261 std::string GetString(const char* path) const; |
262 FilePath GetFilePath(const char* path) const; | 262 FilePath GetFilePath(const char* path) const; |
263 | 263 |
264 // Returns the branch if it exists, or the registered default value otherwise. | 264 // Returns the branch if it exists, or the registered default value otherwise. |
265 // Note that |path| must point to a registered preference. In that case, these | 265 // Note that |path| must point to a registered preference. In that case, these |
266 // functions will never return NULL. | 266 // functions will never return NULL. |
267 const base::DictionaryValue* GetDictionary(const char* path) const; | 267 const base::DictionaryValue* GetDictionary(const char* path) const; |
268 const base::ListValue* GetList(const char* path) const; | 268 const base::ListValue* GetList(const char* path) const; |
269 | 269 |
270 // Returns the value of the given preference, from the user pref store. If | |
271 // the preference is not set in the user pref store, returns NULL. | |
272 const base::Value* GetUserPrefValue(const char* path) const; | |
273 | |
274 // Removes a user pref and restores the pref to its default value. | 270 // Removes a user pref and restores the pref to its default value. |
275 void ClearPref(const char* path); | 271 void ClearPref(const char* path); |
276 | 272 |
277 // If the path is valid (i.e., registered), update the pref value in the user | 273 // If the path is valid (i.e., registered), update the pref value in the user |
278 // prefs. | 274 // prefs. |
279 // To set the value of dictionary or list values in the pref tree use | 275 // To set the value of dictionary or list values in the pref tree use |
280 // Set(), but to modify the value of a dictionary or list use either | 276 // Set(), but to modify the value of a dictionary or list use either |
281 // ListPrefUpdate or DictionaryPrefUpdate from scoped_user_pref_update.h. | 277 // ListPrefUpdate or DictionaryPrefUpdate from scoped_user_pref_update.h. |
282 void Set(const char* path, const base::Value& value); | 278 void Set(const char* path, const base::Value& value); |
283 void SetBoolean(const char* path, bool value); | 279 void SetBoolean(const char* path, bool value); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 | 409 |
414 // Whether CreateIncognitoPrefService() or | 410 // Whether CreateIncognitoPrefService() or |
415 // CreatePrefServiceWithPerTabPrefStore() have been called to create a | 411 // CreatePrefServiceWithPerTabPrefStore() have been called to create a |
416 // "forked" PrefService. | 412 // "forked" PrefService. |
417 bool pref_service_forked_; | 413 bool pref_service_forked_; |
418 | 414 |
419 DISALLOW_COPY_AND_ASSIGN(PrefService); | 415 DISALLOW_COPY_AND_ASSIGN(PrefService); |
420 }; | 416 }; |
421 | 417 |
422 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_H_ | 418 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_H_ |
OLD | NEW |