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