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

Side by Side Diff: chrome/browser/prefs/pref_registry.h

Issue 12079097: Introduce PrefRegistrySyncable, simplifying PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add to PrefRegistrySyncable and PrefServiceSyncable to let sync know of pre-registered prefs. Created 7 years, 10 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
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 #ifndef CHROME_BROWSER_PREFS_PREF_REGISTRY_H_ 5 #ifndef CHROME_BROWSER_PREFS_PREF_REGISTRY_H_
6 #define CHROME_BROWSER_PREFS_PREF_REGISTRY_H_ 6 #define CHROME_BROWSER_PREFS_PREF_REGISTRY_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/prefs/pref_value_map.h" 10 #include "base/prefs/pref_value_map.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // will be invoked each time registration and/or unregistration has 45 // will be invoked each time registration and/or unregistration has
46 // been performed on this object. 46 // been performed on this object.
47 // 47 //
48 // Calling either of these methods after a callback has already been 48 // Calling either of these methods after a callback has already been
49 // set will make the object forget the previous callback and use the 49 // set will make the object forget the previous callback and use the
50 // new one instead. 50 // new one instead.
51 void SetRegistrationCallback(const RegistrationCallback& callback); 51 void SetRegistrationCallback(const RegistrationCallback& callback);
52 void SetUnregistrationCallback(const UnregistrationCallback& callback); 52 void SetUnregistrationCallback(const UnregistrationCallback& callback);
53 53
54 // Unregisters a preference. This is going away soon. 54 // Unregisters a preference. This is going away soon.
55 virtual void DeprecatedUnregisterPreference(const char* path); 55 void DeprecatedUnregisterPreference(const char* path);
56 56
57 protected: 57 protected:
58 friend class base::RefCounted<PrefRegistry>; 58 friend class base::RefCounted<PrefRegistry>;
59 virtual ~PrefRegistry(); 59 virtual ~PrefRegistry();
60 60
61 // TODO(joi): Temporary until we have PrefRegistrySyncable.
62 friend class PrefServiceSyncable;
63
64 // Used by subclasses to register a default value for a preference. 61 // Used by subclasses to register a default value for a preference.
65 void RegisterPreference(const char* path, base::Value* default_value); 62 void RegisterPreference(const char* path, base::Value* default_value);
66 63
64 scoped_refptr<DefaultPrefStore> defaults_;
65
67 private: 66 private:
68 RegistrationCallback registration_callback_; 67 RegistrationCallback registration_callback_;
69 UnregistrationCallback unregistration_callback_; 68 UnregistrationCallback unregistration_callback_;
70 scoped_refptr<DefaultPrefStore> defaults_;
71 69
72 DISALLOW_COPY_AND_ASSIGN(PrefRegistry); 70 DISALLOW_COPY_AND_ASSIGN(PrefRegistry);
73 }; 71 };
74 72
75 #endif // CHROME_BROWSER_PREFS_PREF_REGISTRY_H_ 73 #endif // CHROME_BROWSER_PREFS_PREF_REGISTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698