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

Side by Side Diff: chrome/browser/prefs/pref_model_associator.h

Issue 12330008: Get rid of the ability to unregister preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head for commit. 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 | « chrome/browser/prefs/browser_prefs.cc ('k') | chrome/browser/prefs/pref_model_associator.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_MODEL_ASSOCIATOR_H_ 5 #ifndef CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_
6 #define CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ 6 #define CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // Register a preference with the specified name for syncing. We do not care 59 // Register a preference with the specified name for syncing. We do not care
60 // about the type at registration time, but when changes arrive from the 60 // about the type at registration time, but when changes arrive from the
61 // syncer, we check if they can be applied and if not drop them. 61 // syncer, we check if they can be applied and if not drop them.
62 // Note: This should only be called at profile startup time (before sync 62 // Note: This should only be called at profile startup time (before sync
63 // begins). 63 // begins).
64 virtual void RegisterPref(const char* name); 64 virtual void RegisterPref(const char* name);
65 65
66 // Returns true if the specified preference is registered for syncing. 66 // Returns true if the specified preference is registered for syncing.
67 virtual bool IsPrefRegistered(const char* name); 67 virtual bool IsPrefRegistered(const char* name);
68 68
69 // Unregisters a previously registered preference. This must be called
70 // prior to making the first sync.
71 virtual void UnregisterPref(const char* name);
72
73 // Process a local preference change. This can trigger new SyncChanges being 69 // Process a local preference change. This can trigger new SyncChanges being
74 // sent to the syncer. 70 // sent to the syncer.
75 virtual void ProcessPrefChange(const std::string& name); 71 virtual void ProcessPrefChange(const std::string& name);
76 72
77 void SetPrefService(PrefServiceSyncable* pref_service); 73 void SetPrefService(PrefServiceSyncable* pref_service);
78 74
79 // Merges the local_value into the supplied server_value and returns 75 // Merges the local_value into the supplied server_value and returns
80 // the result (caller takes ownership). If there is a conflict, the server 76 // the result (caller takes ownership). If there is a conflict, the server
81 // value always takes precedence. Note that only certain preferences will 77 // value always takes precedence. Note that only certain preferences will
82 // actually be merged, all others will return a copy of the server value. See 78 // actually be merged, all others will return a copy of the server value. See
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // Sync's syncer::SyncChange handler. We push all our changes through this. 146 // Sync's syncer::SyncChange handler. We push all our changes through this.
151 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; 147 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_;
152 148
153 // Sync's error handler. We use this to create sync errors. 149 // Sync's error handler. We use this to create sync errors.
154 scoped_ptr<syncer::SyncErrorFactory> sync_error_factory_; 150 scoped_ptr<syncer::SyncErrorFactory> sync_error_factory_;
155 151
156 DISALLOW_COPY_AND_ASSIGN(PrefModelAssociator); 152 DISALLOW_COPY_AND_ASSIGN(PrefModelAssociator);
157 }; 153 };
158 154
159 #endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ 155 #endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/prefs/browser_prefs.cc ('k') | chrome/browser/prefs/pref_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698