| 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 |
| 270 // Removes a user pref and restores the pref to its default value. | 274 // Removes a user pref and restores the pref to its default value. |
| 271 void ClearPref(const char* path); | 275 void ClearPref(const char* path); |
| 272 | 276 |
| 273 // If the path is valid (i.e., registered), update the pref value in the user | 277 // If the path is valid (i.e., registered), update the pref value in the user |
| 274 // prefs. | 278 // prefs. |
| 275 // To set the value of dictionary or list values in the pref tree use | 279 // To set the value of dictionary or list values in the pref tree use |
| 276 // Set(), but to modify the value of a dictionary or list use either | 280 // Set(), but to modify the value of a dictionary or list use either |
| 277 // ListPrefUpdate or DictionaryPrefUpdate from scoped_user_pref_update.h. | 281 // ListPrefUpdate or DictionaryPrefUpdate from scoped_user_pref_update.h. |
| 278 void Set(const char* path, const base::Value& value); | 282 void Set(const char* path, const base::Value& value); |
| 279 void SetBoolean(const char* path, bool value); | 283 void SetBoolean(const char* path, bool value); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 | 413 |
| 410 // Whether CreateIncognitoPrefService() or | 414 // Whether CreateIncognitoPrefService() or |
| 411 // CreatePrefServiceWithPerTabPrefStore() have been called to create a | 415 // CreatePrefServiceWithPerTabPrefStore() have been called to create a |
| 412 // "forked" PrefService. | 416 // "forked" PrefService. |
| 413 bool pref_service_forked_; | 417 bool pref_service_forked_; |
| 414 | 418 |
| 415 DISALLOW_COPY_AND_ASSIGN(PrefService); | 419 DISALLOW_COPY_AND_ASSIGN(PrefService); |
| 416 }; | 420 }; |
| 417 | 421 |
| 418 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_H_ | 422 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_H_ |
| OLD | NEW |