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

Side by Side Diff: components/user_prefs/pref_registry_syncable.h

Issue 12340111: Introduce //components/user_prefs, use to eliminate c/b/prefs dependency in Autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge of LKGR Created 7 years, 9 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 | « components/user_prefs/README ('k') | components/user_prefs/pref_registry_syncable.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_SYNCABLE_H_ 5 #ifndef COMPONENTS_USER_PREFS_PREF_REGISTRY_SYNCABLE_H_
6 #define CHROME_BROWSER_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/prefs/pref_registry.h" 11 #include "base/prefs/pref_registry.h"
12 #include "components/user_prefs/user_prefs_export.h"
12 13
13 namespace base { 14 namespace base {
14 class DictionaryValue; 15 class DictionaryValue;
15 class FilePath; 16 class FilePath;
16 class ListValue; 17 class ListValue;
17 class Value; 18 class Value;
18 } 19 }
19 20
20 // A PrefRegistry that forces users to choose whether each registered 21 // A PrefRegistry that forces users to choose whether each registered
21 // preference is syncable or not. 22 // preference is syncable or not.
22 class PrefRegistrySyncable : public PrefRegistry { 23 //
24 // Classes or components that want to register such preferences should
25 // define a static function named RegisterUserPrefs that takes a
26 // PrefRegistrySyncable*, and the top-level application using the
27 // class or embedding the component should call this function at an
28 // appropriate time before the PrefService for these preferences is
29 // constructed. See e.g. chrome/browser/prefs/browser_prefs.cc which
30 // does this for Chrome.
31 class USER_PREFS_EXPORT PrefRegistrySyncable : public PrefRegistry {
tfarina 2013/03/06 02:59:23 just noticed that UserPrefs was put in components
23 public: 32 public:
24 typedef base::Callback<void(const char* path)> SyncableRegistrationCallback; 33 typedef base::Callback<void(const char* path)> SyncableRegistrationCallback;
25 34
26 // Enum used when registering preferences to determine if it should 35 // Enum used when registering preferences to determine if it should
27 // be synced or not. 36 // be synced or not.
28 enum PrefSyncStatus { 37 enum PrefSyncStatus {
29 UNSYNCABLE_PREF, 38 UNSYNCABLE_PREF,
30 SYNCABLE_PREF 39 SYNCABLE_PREF
31 }; 40 };
32 41
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 PrefSyncStatus sync_status); 109 PrefSyncStatus sync_status);
101 110
102 SyncableRegistrationCallback callback_; 111 SyncableRegistrationCallback callback_;
103 112
104 // Contains the names of all registered preferences that are syncable. 113 // Contains the names of all registered preferences that are syncable.
105 std::set<std::string> syncable_preferences_; 114 std::set<std::string> syncable_preferences_;
106 115
107 DISALLOW_COPY_AND_ASSIGN(PrefRegistrySyncable); 116 DISALLOW_COPY_AND_ASSIGN(PrefRegistrySyncable);
108 }; 117 };
109 118
110 #endif // CHROME_BROWSER_PREFS_PREF_REGISTRY_SYNCABLE_H_ 119 #endif // COMPONENTS_USER_PREFS_PREF_REGISTRY_SYNCABLE_H_
OLDNEW
« no previous file with comments | « components/user_prefs/README ('k') | components/user_prefs/pref_registry_syncable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698