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

Side by Side Diff: chrome/browser/prefs/value_map_pref_store.cc

Issue 5646003: Sanitize PrefStore interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix PrefService mock construction in PrefServiceTest to include command line store. Created 10 years 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/value_map_pref_store.h ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/prefs/value_map_pref_store.h"
6
7 #include <algorithm>
8
9 #include "base/stl_util-inl.h"
10 #include "base/values.h"
11
12 PrefStore::ReadResult ValueMapPrefStore::GetValue(const std::string& key,
13 Value** value) const {
14 return prefs_.GetValue(key, value) ? READ_OK : READ_NO_VALUE;
15 }
16
17 void ValueMapPrefStore::AddObserver(PrefStore::Observer* observer) {
18 observers_.AddObserver(observer);
19 }
20
21 void ValueMapPrefStore::RemoveObserver(PrefStore::Observer* observer) {
22 observers_.RemoveObserver(observer);
23 }
24
25 void ValueMapPrefStore::SetValue(const std::string& key, Value* value) {
26 if (prefs_.SetValue(key, value))
27 FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(key));
28 }
29
30 void ValueMapPrefStore::RemoveValue(const std::string& key) {
31 if (prefs_.RemoveValue(key))
32 FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(key));
33 }
34
35 void ValueMapPrefStore::NotifyInitializationCompleted() {
36 FOR_EACH_OBSERVER(Observer, observers_, OnInitializationCompleted());
37 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/value_map_pref_store.h ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698