OLD | NEW |
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_USER_PREFS_PREF_REGISTRY_SYNCABLE_H_ | 5 #ifndef COMPONENTS_USER_PREFS_PREF_REGISTRY_SYNCABLE_H_ |
6 #define COMPONENTS_USER_PREFS_PREF_REGISTRY_SYNCABLE_H_ | 6 #define COMPONENTS_USER_PREFS_PREF_REGISTRY_SYNCABLE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/prefs/pref_registry.h" | 12 #include "base/prefs/pref_registry.h" |
13 #include "components/user_prefs/user_prefs_export.h" | 13 #include "components/user_prefs/pref_registry_export.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class DictionaryValue; | 16 class DictionaryValue; |
17 class FilePath; | 17 class FilePath; |
18 class ListValue; | 18 class ListValue; |
19 class Value; | 19 class Value; |
20 } | 20 } |
21 | 21 |
22 namespace user_prefs { | 22 namespace user_prefs { |
23 | 23 |
24 // A PrefRegistry that forces users to choose whether each registered | 24 // A PrefRegistry that forces users to choose whether each registered |
25 // preference is syncable or not. | 25 // preference is syncable or not. |
26 // | 26 // |
27 // Classes or components that want to register such preferences should | 27 // Classes or components that want to register such preferences should |
28 // define a static function named RegisterUserPrefs that takes a | 28 // define a static function named RegisterUserPrefs that takes a |
29 // PrefRegistrySyncable*, and the top-level application using the | 29 // PrefRegistrySyncable*, and the top-level application using the |
30 // class or embedding the component should call this function at an | 30 // class or embedding the component should call this function at an |
31 // appropriate time before the PrefService for these preferences is | 31 // appropriate time before the PrefService for these preferences is |
32 // constructed. See e.g. chrome/browser/prefs/browser_prefs.cc which | 32 // constructed. See e.g. chrome/browser/prefs/browser_prefs.cc which |
33 // does this for Chrome. | 33 // does this for Chrome. |
34 class USER_PREFS_EXPORT PrefRegistrySyncable : public PrefRegistry { | 34 class PREF_REGISTRY_EXPORT PrefRegistrySyncable : public PrefRegistry { |
35 public: | 35 public: |
36 // Enum used when registering preferences to determine if it should | 36 // Enum used when registering preferences to determine if it should |
37 // be synced or not. Syncable priority preferences are preferences that are | 37 // be synced or not. Syncable priority preferences are preferences that are |
38 // never encrypted and are synced before other datatypes. Because they're | 38 // never encrypted and are synced before other datatypes. Because they're |
39 // never encrypted, on first sync, they can be synced down before the user | 39 // never encrypted, on first sync, they can be synced down before the user |
40 // is prompted for a passphrase. | 40 // is prompted for a passphrase. |
41 enum PrefSyncStatus { | 41 enum PrefSyncStatus { |
42 UNSYNCABLE_PREF, | 42 UNSYNCABLE_PREF, |
43 SYNCABLE_PREF, | 43 SYNCABLE_PREF, |
44 SYNCABLE_PRIORITY_PREF, | 44 SYNCABLE_PRIORITY_PREF, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 // Contains the names of all registered preferences that are syncable. | 124 // Contains the names of all registered preferences that are syncable. |
125 PrefToStatus syncable_preferences_; | 125 PrefToStatus syncable_preferences_; |
126 | 126 |
127 DISALLOW_COPY_AND_ASSIGN(PrefRegistrySyncable); | 127 DISALLOW_COPY_AND_ASSIGN(PrefRegistrySyncable); |
128 }; | 128 }; |
129 | 129 |
130 } // namespace user_prefs | 130 } // namespace user_prefs |
131 | 131 |
132 #endif // COMPONENTS_USER_PREFS_PREF_REGISTRY_SYNCABLE_H_ | 132 #endif // COMPONENTS_USER_PREFS_PREF_REGISTRY_SYNCABLE_H_ |
OLD | NEW |