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

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

Issue 1096833003: Convert PrefSyncStatus into PrefRegistrationFlags (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 // Changes the default value for a preference. Takes ownership of |value|. 222 // Changes the default value for a preference. Takes ownership of |value|.
223 // 223 //
224 // Will cause a pref change notification to be fired if this causes 224 // Will cause a pref change notification to be fired if this causes
225 // the effective value to change. 225 // the effective value to change.
226 void SetDefaultPrefValue(const std::string& path, base::Value* value); 226 void SetDefaultPrefValue(const std::string& path, base::Value* value);
227 227
228 // Returns the default value of the given preference. |path| must point to a 228 // Returns the default value of the given preference. |path| must point to a
229 // registered preference. In that case, will never return NULL. 229 // registered preference. In that case, will never return NULL.
230 const base::Value* GetDefaultPrefValue(const std::string& path) const; 230 const base::Value* GetDefaultPrefValue(const std::string& path) const;
231 231
232 // Return the registration flags for the given pref. Returns a bitmask of
233 // |PrefRegistrationFlags|.
234 uint32 GetRegistrationFlags(const std::string& path) const;
235
232 // Returns true if a value has been set for the specified path. 236 // Returns true if a value has been set for the specified path.
233 // NOTE: this is NOT the same as FindPreference. In particular 237 // NOTE: this is NOT the same as FindPreference. In particular
234 // FindPreference returns whether RegisterXXX has been invoked, where as 238 // FindPreference returns whether RegisterXXX has been invoked, where as
235 // this checks if a value exists for the path. 239 // this checks if a value exists for the path.
236 bool HasPrefPath(const std::string& path) const; 240 bool HasPrefPath(const std::string& path) const;
237 241
238 // Returns a dictionary with effective preference values. 242 // Returns a dictionary with effective preference values.
239 scoped_ptr<base::DictionaryValue> GetPreferenceValues() const; 243 scoped_ptr<base::DictionaryValue> GetPreferenceValues() const;
240 244
241 // Returns a dictionary with effective preference values, omitting prefs that 245 // Returns a dictionary with effective preference values, omitting prefs that
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 364
361 // Local cache of registered Preference objects. The pref_registry_ 365 // Local cache of registered Preference objects. The pref_registry_
362 // is authoritative with respect to what the types and default values 366 // is authoritative with respect to what the types and default values
363 // of registered preferences are. 367 // of registered preferences are.
364 mutable PreferenceMap prefs_map_; 368 mutable PreferenceMap prefs_map_;
365 369
366 DISALLOW_COPY_AND_ASSIGN(PrefService); 370 DISALLOW_COPY_AND_ASSIGN(PrefService);
367 }; 371 };
368 372
369 #endif // BASE_PREFS_PREF_SERVICE_H_ 373 #endif // BASE_PREFS_PREF_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698