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

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

Issue 12211105: Move remaining non-test, non-Chrome-specific Prefs code to base/prefs/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments, merge to LKGR. 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
« no previous file with comments | « base/prefs/pref_notifier_impl.cc ('k') | base/prefs/pref_registry.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 #ifndef CHROME_BROWSER_PREFS_PREF_REGISTRY_H_ 5 #ifndef BASE_PREFS_PREF_REGISTRY_H_
6 #define CHROME_BROWSER_PREFS_PREF_REGISTRY_H_ 6 #define BASE_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/base_prefs_export.h"
10 #include "base/prefs/pref_value_map.h" 11 #include "base/prefs/pref_value_map.h"
11 12
12 namespace base { 13 namespace base {
13 class Value; 14 class Value;
14 } 15 }
15 16
16 class DefaultPrefStore; 17 class DefaultPrefStore;
17 class PrefStore; 18 class PrefStore;
18 19
19 // Preferences need to be registered with a type and default value 20 // Preferences need to be registered with a type and default value
20 // before they are used. 21 // before they are used.
21 // 22 //
22 // The way you use a PrefRegistry is that you register all required 23 // The way you use a PrefRegistry is that you register all required
23 // preferences on it (via one of its subclasses), then pass it as a 24 // preferences on it (via one of its subclasses), then pass it as a
24 // construction parameter to PrefService. 25 // construction parameter to PrefService.
25 // 26 //
26 // Currently, registrations after constructing the PrefService will 27 // Currently, registrations after constructing the PrefService will
27 // also work, but this is being deprecated. 28 // also work, but this is being deprecated.
28 class PrefRegistry : public base::RefCounted<PrefRegistry> { 29 class BASE_PREFS_EXPORT PrefRegistry : public base::RefCounted<PrefRegistry> {
29 public: 30 public:
30 typedef PrefValueMap::const_iterator const_iterator; 31 typedef PrefValueMap::const_iterator const_iterator;
31 typedef base::Callback<void(const char*, base::Value*)> RegistrationCallback; 32 typedef base::Callback<void(const char*, base::Value*)> RegistrationCallback;
32 typedef base::Callback<void(const char*)> UnregistrationCallback; 33 typedef base::Callback<void(const char*)> UnregistrationCallback;
33 34
34 PrefRegistry(); 35 PrefRegistry();
35 36
36 // Gets the registered defaults. 37 // Gets the registered defaults.
37 scoped_refptr<PrefStore> defaults(); 38 scoped_refptr<PrefStore> defaults();
38 39
(...skipping 24 matching lines...) Expand all
63 64
64 scoped_refptr<DefaultPrefStore> defaults_; 65 scoped_refptr<DefaultPrefStore> defaults_;
65 66
66 private: 67 private:
67 RegistrationCallback registration_callback_; 68 RegistrationCallback registration_callback_;
68 UnregistrationCallback unregistration_callback_; 69 UnregistrationCallback unregistration_callback_;
69 70
70 DISALLOW_COPY_AND_ASSIGN(PrefRegistry); 71 DISALLOW_COPY_AND_ASSIGN(PrefRegistry);
71 }; 72 };
72 73
73 #endif // CHROME_BROWSER_PREFS_PREF_REGISTRY_H_ 74 #endif // BASE_PREFS_PREF_REGISTRY_H_
OLDNEW
« no previous file with comments | « base/prefs/pref_notifier_impl.cc ('k') | base/prefs/pref_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698