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

Side by Side Diff: base/prefs/pref_service.h

Issue 12315116: Add ability to change default pref values, and use in BrowserInstantController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Add a bit of documentation. Created 7 years, 9 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 | « base/prefs/pref_registry.cc ('k') | base/prefs/pref_service.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 // 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
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|.
Mattias Nissler (ping if slow) 2013/02/28 15:46:26 nit: add a line saying that this will fire pref ch
224 void SetDefaultPrefValue(const char* path, base::Value* value);
225
223 // Returns the default value of the given preference. |path| must point to a 226 // Returns the default value of the given preference. |path| must point to a
224 // registered preference. In that case, will never return NULL. 227 // registered preference. In that case, will never return NULL.
225 const base::Value* GetDefaultPrefValue(const char* path) const; 228 const base::Value* GetDefaultPrefValue(const char* path) const;
226 229
227 // Returns true if a value has been set for the specified path. 230 // Returns true if a value has been set for the specified path.
228 // NOTE: this is NOT the same as FindPreference. In particular 231 // NOTE: this is NOT the same as FindPreference. In particular
229 // FindPreference returns whether RegisterXXX has been invoked, where as 232 // FindPreference returns whether RegisterXXX has been invoked, where as
230 // this checks if a value exists for the path. 233 // this checks if a value exists for the path.
231 bool HasPrefPath(const char* path) const; 234 bool HasPrefPath(const char* path) const;
232 235
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 DISALLOW_COPY_AND_ASSIGN(PrefService); 352 DISALLOW_COPY_AND_ASSIGN(PrefService);
350 }; 353 };
351 354
352 // Retrieves a PrefService for the given context. 355 // Retrieves a PrefService for the given context.
353 // 356 //
354 // TODO(joi): This doesn't really belong here, since it references a 357 // TODO(joi): This doesn't really belong here, since it references a
355 // content type; probably best to get rid of it completely. 358 // content type; probably best to get rid of it completely.
356 PrefService* PrefServiceFromBrowserContext(content::BrowserContext* context); 359 PrefService* PrefServiceFromBrowserContext(content::BrowserContext* context);
357 360
358 #endif // BASE_PREFS_PREF_SERVICE_H_ 361 #endif // BASE_PREFS_PREF_SERVICE_H_
OLDNEW
« no previous file with comments | « base/prefs/pref_registry.cc ('k') | base/prefs/pref_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698