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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 int64 GetInt64(const char* path) const; | 213 int64 GetInt64(const char* path) const; |
214 | 214 |
215 // As above, but for unsigned values. | 215 // As above, but for unsigned values. |
216 void SetUint64(const char* path, uint64 value); | 216 void SetUint64(const char* path, uint64 value); |
217 uint64 GetUint64(const char* path) const; | 217 uint64 GetUint64(const char* path) const; |
218 | 218 |
219 // Returns the value of the given preference, from the user pref store. If | 219 // Returns the value of the given preference, from the user pref store. If |
220 // the preference is not set in the user pref store, returns NULL. | 220 // the preference is not set in the user pref store, returns NULL. |
221 const base::Value* GetUserPrefValue(const char* path) const; | 221 const base::Value* GetUserPrefValue(const char* path) const; |
222 | 222 |
| 223 // Changes the default value for a preference. Takes ownership of |value|. |
| 224 // |
| 225 // Will cause a pref change notification to be fired if this causes |
| 226 // the effective value to change. |
| 227 void SetDefaultPrefValue(const char* path, base::Value* value); |
| 228 |
223 // Returns the default value of the given preference. |path| must point to a | 229 // Returns the default value of the given preference. |path| must point to a |
224 // registered preference. In that case, will never return NULL. | 230 // registered preference. In that case, will never return NULL. |
225 const base::Value* GetDefaultPrefValue(const char* path) const; | 231 const base::Value* GetDefaultPrefValue(const char* path) const; |
226 | 232 |
227 // Returns true if a value has been set for the specified path. | 233 // Returns true if a value has been set for the specified path. |
228 // NOTE: this is NOT the same as FindPreference. In particular | 234 // NOTE: this is NOT the same as FindPreference. In particular |
229 // FindPreference returns whether RegisterXXX has been invoked, where as | 235 // FindPreference returns whether RegisterXXX has been invoked, where as |
230 // this checks if a value exists for the path. | 236 // this checks if a value exists for the path. |
231 bool HasPrefPath(const char* path) const; | 237 bool HasPrefPath(const char* path) const; |
232 | 238 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 DISALLOW_COPY_AND_ASSIGN(PrefService); | 355 DISALLOW_COPY_AND_ASSIGN(PrefService); |
350 }; | 356 }; |
351 | 357 |
352 // Retrieves a PrefService for the given context. | 358 // Retrieves a PrefService for the given context. |
353 // | 359 // |
354 // TODO(joi): This doesn't really belong here, since it references a | 360 // TODO(joi): This doesn't really belong here, since it references a |
355 // content type; probably best to get rid of it completely. | 361 // content type; probably best to get rid of it completely. |
356 PrefService* PrefServiceFromBrowserContext(content::BrowserContext* context); | 362 PrefService* PrefServiceFromBrowserContext(content::BrowserContext* context); |
357 | 363 |
358 #endif // BASE_PREFS_PREF_SERVICE_H_ | 364 #endif // BASE_PREFS_PREF_SERVICE_H_ |
OLD | NEW |