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

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

Issue 12079097: Introduce PrefRegistrySyncable, simplifying PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again; base::File changes conflicted. 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
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 // This provides a way to access the application's current preferences. 5 // This provides a way to access the application's current preferences.
6 6
7 // Chromium settings and storage represent user-selected preferences and 7 // Chromium settings and storage represent user-selected preferences and
8 // information and MUST not be extracted, overwritten or modified except 8 // information and MUST not be extracted, overwritten or modified except
9 // through Chromium defined APIs. 9 // through Chromium defined APIs.
10 10
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // passed to us at construction time. 176 // passed to us at construction time.
177 void AddInitialPreferences(); 177 void AddInitialPreferences();
178 178
179 // Updates local caches for a preference registered at |path|. The 179 // Updates local caches for a preference registered at |path|. The
180 // |default_value| must not be NULL as it determines the preference 180 // |default_value| must not be NULL as it determines the preference
181 // value's type. AddRegisteredPreference must not be called twice 181 // value's type. AddRegisteredPreference must not be called twice
182 // for the same path. 182 // for the same path.
183 void AddRegisteredPreference(const char* path, 183 void AddRegisteredPreference(const char* path,
184 base::Value* default_value); 184 base::Value* default_value);
185 185
186 void RemoveRegisteredPreference(const char* path); 186 // Updates local caches for a preference unregistered at |path|.
187 virtual void RemoveRegisteredPreference(const char* path);
187 188
188 // The PrefNotifier handles registering and notifying preference observers. 189 // The PrefNotifier handles registering and notifying preference observers.
189 // It is created and owned by this PrefService. Subclasses may access it for 190 // It is created and owned by this PrefService. Subclasses may access it for
190 // unit testing. 191 // unit testing.
191 scoped_ptr<PrefNotifierImpl> pref_notifier_; 192 scoped_ptr<PrefNotifierImpl> pref_notifier_;
192 193
193 // The PrefValueStore provides prioritized preference values. It is owned by 194 // The PrefValueStore provides prioritized preference values. It is owned by
194 // this PrefService. Subclasses may access it for unit testing. 195 // this PrefService. Subclasses may access it for unit testing.
195 scoped_ptr<PrefValueStore> pref_value_store_; 196 scoped_ptr<PrefValueStore> pref_value_store_;
196 197
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 const base::Value* GetPreferenceValue(const std::string& path) const; 249 const base::Value* GetPreferenceValue(const std::string& path) const;
249 250
250 // Local cache of registered Preference objects. The pref_registry_ 251 // Local cache of registered Preference objects. The pref_registry_
251 // is authoritative with respect to what the types and default values 252 // is authoritative with respect to what the types and default values
252 // of registered preferences are. 253 // of registered preferences are.
253 mutable PreferenceMap prefs_map_; 254 mutable PreferenceMap prefs_map_;
254 255
255 DISALLOW_COPY_AND_ASSIGN(PrefService); 256 DISALLOW_COPY_AND_ASSIGN(PrefService);
256 }; 257 };
257 258
258 // TODO(joi): Remove these forwards. They were placed here temporarily
259 // to limit the size of the initial change that split
260 // PrefServiceSimple and PrefServiceSyncable out of PrefService.
261 #include "chrome/browser/prefs/pref_service_syncable.h"
262
263 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_H_ 259 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/prefs/pref_registry_syncable.cc ('k') | chrome/browser/prefs/pref_service_mock_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698