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

Unified Diff: chrome/browser/prefs/pref_registrar_simple.h

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prefs/pref_notifier_impl_unittest.cc ('k') | chrome/browser/prefs/pref_registrar_simple.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/pref_registrar_simple.h
diff --git a/chrome/browser/prefs/pref_service_simple.h b/chrome/browser/prefs/pref_registrar_simple.h
similarity index 54%
rename from chrome/browser/prefs/pref_service_simple.h
rename to chrome/browser/prefs/pref_registrar_simple.h
index c37d7d048d520a3932c3f390911807b1f7829b3c..8bd51e0726b51ef87409672190fed86abcb3b61f 100644
--- a/chrome/browser/prefs/pref_service_simple.h
+++ b/chrome/browser/prefs/pref_registrar_simple.h
@@ -2,25 +2,24 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_PREFS_PREF_SERVICE_SIMPLE_H_
-#define CHROME_BROWSER_PREFS_PREF_SERVICE_SIMPLE_H_
+#ifndef CHROME_BROWSER_PREFS_PREF_REGISTRAR_SIMPLE_H_
+#define CHROME_BROWSER_PREFS_PREF_REGISTRAR_SIMPLE_H_
-#include "chrome/browser/prefs/pref_service.h"
+#include <string>
-// A simple PrefService implementation.
-class PrefServiceSimple : public PrefService {
+#include "base/values.h"
+
+class FilePath;
+class PrefService;
+
+// A class for performing registration of simple types to a standard
+// PrefService.
+class PrefRegistrarSimple {
public:
- // You may wish to use PrefServiceBuilder or one of its subclasses
- // for simplified construction.
- PrefServiceSimple(
- PrefNotifierImpl* pref_notifier,
- PrefValueStore* pref_value_store,
- PersistentPrefStore* user_prefs,
- DefaultPrefStore* default_store,
- base::Callback<void(PersistentPrefStore::PrefReadError)>
- read_error_callback,
- bool async);
- virtual ~PrefServiceSimple();
+ // Creates a registrar to register preferences with the specified
+ // PrefService. The caller is responsible for ensuring that the
+ // lifetime of |pref_service| exceeds the lifetime of this object.
+ PrefRegistrarSimple(PrefService* pref_service);
void RegisterBooleanPref(const char* path, bool default_value);
void RegisterIntegerPref(const char* path, int default_value);
@@ -35,8 +34,12 @@ class PrefServiceSimple : public PrefService {
void RegisterInt64Pref(const char* path,
int64 default_value);
+ void UnregisterPreference(const char* path);
+
private:
- DISALLOW_COPY_AND_ASSIGN(PrefServiceSimple);
+ PrefService* pref_service_;
Mattias Nissler (ping if slow) 2013/01/03 13:11:16 Ah, so I had a different thing in mind: Make PrefR
+
+ DISALLOW_COPY_AND_ASSIGN(PrefRegistrarSimple);
};
-#endif // CHROME_BROWSER_PREFS_PREF_SERVICE_SIMPLE_H_
+#endif // CHROME_BROWSER_PREFS_PREF_REGISTRAR_SIMPLE_H_
« no previous file with comments | « chrome/browser/prefs/pref_notifier_impl_unittest.cc ('k') | chrome/browser/prefs/pref_registrar_simple.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698