| Index: chrome/browser/prefs/value_map_pref_store.cc
|
| diff --git a/chrome/browser/prefs/value_map_pref_store.cc b/chrome/browser/prefs/value_map_pref_store.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..274ca7a10058cdaa3bab3ab1049fbc22258a167d
|
| --- /dev/null
|
| +++ b/chrome/browser/prefs/value_map_pref_store.cc
|
| @@ -0,0 +1,37 @@
|
| +// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/prefs/value_map_pref_store.h"
|
| +
|
| +#include <algorithm>
|
| +
|
| +#include "base/stl_util-inl.h"
|
| +#include "base/values.h"
|
| +
|
| +PrefStore::ReadResult ValueMapPrefStore::GetValue(const std::string& key,
|
| + Value** value) const {
|
| + return prefs_.GetValue(key, value) ? READ_OK : READ_NO_VALUE;
|
| +}
|
| +
|
| +void ValueMapPrefStore::AddObserver(PrefStore::ObserverInterface* observer) {
|
| + observers_.AddObserver(observer);
|
| +}
|
| +
|
| +void ValueMapPrefStore::RemoveObserver(PrefStore::ObserverInterface* observer) {
|
| + observers_.RemoveObserver(observer);
|
| +}
|
| +
|
| +void ValueMapPrefStore::SetValue(const std::string& key, Value* value) {
|
| + if (prefs_.SetValue(key, value))
|
| + FOR_EACH_OBSERVER(ObserverInterface, observers_, OnPrefValueChanged(key));
|
| +}
|
| +
|
| +void ValueMapPrefStore::RemoveValue(const std::string& key) {
|
| + if (prefs_.RemoveValue(key))
|
| + FOR_EACH_OBSERVER(ObserverInterface, observers_, OnPrefValueChanged(key));
|
| +}
|
| +
|
| +void ValueMapPrefStore::NotifyInitializationCompleted() {
|
| + FOR_EACH_OBSERVER(ObserverInterface, observers_, OnInitializationCompleted());
|
| +}
|
|
|