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

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

Issue 1662843002: Revert of Delete base/prefs and update callers to use components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « components/prefs/pref_observer.h ('k') | components/prefs/pref_registry_simple.h » ('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 COMPONENTS_PREFS_PREF_REGISTRY_H_ 5 #ifndef BASE_PREFS_PREF_REGISTRY_H_
6 #define COMPONENTS_PREFS_PREF_REGISTRY_H_ 6 #define BASE_PREFS_PREF_REGISTRY_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "components/prefs/base_prefs_export.h" 13 #include "components/prefs/base_prefs_export.h"
14 #include "components/prefs/pref_value_map.h" 14 #include "components/prefs/pref_value_map.h"
15 15
16 namespace base { 16 namespace base {
17 class Value; 17 class Value;
18 } 18 }
19 19
20 class DefaultPrefStore; 20 class DefaultPrefStore;
21 class PrefStore; 21 class PrefStore;
22 22
23 // Preferences need to be registered with a type and default value 23 // Preferences need to be registered with a type and default value
24 // before they are used. 24 // before they are used.
25 // 25 //
26 // The way you use a PrefRegistry is that you register all required 26 // The way you use a PrefRegistry is that you register all required
27 // preferences on it (via one of its subclasses), then pass it as a 27 // preferences on it (via one of its subclasses), then pass it as a
28 // construction parameter to PrefService. 28 // construction parameter to PrefService.
29 // 29 //
30 // Currently, registrations after constructing the PrefService will 30 // Currently, registrations after constructing the PrefService will
31 // also work, but this is being deprecated. 31 // also work, but this is being deprecated.
32 class COMPONENTS_PREFS_EXPORT PrefRegistry 32 class BASE_PREFS_EXPORT PrefRegistry : public base::RefCounted<PrefRegistry> {
33 : public base::RefCounted<PrefRegistry> {
34 public: 33 public:
35 // Registration flags that can be specified which impact how the pref will 34 // Registration flags that can be specified which impact how the pref will
36 // behave or be stored. This will be passed in a bitmask when the pref is 35 // behave or be stored. This will be passed in a bitmask when the pref is
37 // registered. Subclasses of PrefRegistry can specify their own flags. Care 36 // registered. Subclasses of PrefRegistry can specify their own flags. Care
38 // must be taken to ensure none of these overlap with the flags below. 37 // must be taken to ensure none of these overlap with the flags below.
39 enum PrefRegistrationFlags : uint32_t { 38 enum PrefRegistrationFlags : uint32_t {
40 // No flags are specified. 39 // No flags are specified.
41 NO_REGISTRATION_FLAGS = 0, 40 NO_REGISTRATION_FLAGS = 0,
42 41
43 // The first 8 bits are reserved for subclasses of PrefRegistry to use. 42 // The first 8 bits are reserved for subclasses of PrefRegistry to use.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 79
81 scoped_refptr<DefaultPrefStore> defaults_; 80 scoped_refptr<DefaultPrefStore> defaults_;
82 81
83 // A map of pref name to a bitmask of PrefRegistrationFlags. 82 // A map of pref name to a bitmask of PrefRegistrationFlags.
84 PrefRegistrationFlagsMap registration_flags_; 83 PrefRegistrationFlagsMap registration_flags_;
85 84
86 private: 85 private:
87 DISALLOW_COPY_AND_ASSIGN(PrefRegistry); 86 DISALLOW_COPY_AND_ASSIGN(PrefRegistry);
88 }; 87 };
89 88
90 #endif // COMPONENTS_PREFS_PREF_REGISTRY_H_ 89 #endif // BASE_PREFS_PREF_REGISTRY_H_
OLDNEW
« no previous file with comments | « components/prefs/pref_observer.h ('k') | components/prefs/pref_registry_simple.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698