#include "base/basictypes.h"
#include "base/observer_list.h"
#include "base/prefs/base_prefs_export.h"
-#include "base/prefs/pref_store.h"
#include "base/prefs/pref_value_map.h"
+#include "base/prefs/writeable_pref_store.h"
// A basic PrefStore implementation that uses a simple name-value map for
// storing the preference values.
-class BASE_PREFS_EXPORT ValueMapPrefStore : public PrefStore {
+class BASE_PREFS_EXPORT ValueMapPrefStore : public WriteablePrefStore {
public:
ValueMapPrefStore();
// PrefStore overrides:
- virtual bool GetValue(const std::string& key,
- const base::Value** value) const OVERRIDE;
- virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE;
- virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE;
- virtual bool HasObservers() const OVERRIDE;
+ bool GetValue(const std::string& key,
+ const base::Value** value) const override;
+ void AddObserver(PrefStore::Observer* observer) override;
+ void RemoveObserver(PrefStore::Observer* observer) override;
+ bool HasObservers() const override;
+
+ // WriteablePrefStore overrides:
+ void SetValue(const std::string& key, base::Value* value) override;
+ void RemoveValue(const std::string& key) override;
+ bool GetMutableValue(const std::string& key, base::Value** value) override;
+ void ReportValueChanged(const std::string& key) override;
+ void SetValueSilently(const std::string& key, base::Value* value) override;
protected:
- virtual ~ValueMapPrefStore();
-
- // Store a |value| for |key| in the store. Also generates an notification if
- // the value changed. Assumes ownership of |value|, which must be non-NULL.
- void SetValue(const std::string& key, base::Value* value);
-
- // Remove the value for |key| from the store. Sends a notification if there
- // was a value to be removed.
- void RemoveValue(const std::string& key);
+ ~ValueMapPrefStore() override;
// Notify observers about the initialization completed event.
void NotifyInitializationCompleted();