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

Side by Side Diff: base/prefs/value_map_pref_store.cc

Issue 11365112: Change PrefStore::ReadResult to a boolean. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 1 month 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 #include "base/prefs/value_map_pref_store.h" 5 #include "base/prefs/value_map_pref_store.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 11
12 ValueMapPrefStore::ValueMapPrefStore() {} 12 ValueMapPrefStore::ValueMapPrefStore() {}
13 13
14 PrefStore::ReadResult ValueMapPrefStore::GetValue(const std::string& key, 14 bool ValueMapPrefStore::GetValue(const std::string& key,
15 const Value** value) const { 15 const Value** value) const {
16 return prefs_.GetValue(key, value) ? READ_OK : READ_NO_VALUE; 16 return prefs_.GetValue(key, value);
17 } 17 }
18 18
19 void ValueMapPrefStore::AddObserver(PrefStore::Observer* observer) { 19 void ValueMapPrefStore::AddObserver(PrefStore::Observer* observer) {
20 observers_.AddObserver(observer); 20 observers_.AddObserver(observer);
21 } 21 }
22 22
23 void ValueMapPrefStore::RemoveObserver(PrefStore::Observer* observer) { 23 void ValueMapPrefStore::RemoveObserver(PrefStore::Observer* observer) {
24 observers_.RemoveObserver(observer); 24 observers_.RemoveObserver(observer);
25 } 25 }
26 26
(...skipping 25 matching lines...) Expand all
52 } 52 }
53 53
54 void ValueMapPrefStore::RemoveValue(const std::string& key) { 54 void ValueMapPrefStore::RemoveValue(const std::string& key) {
55 if (prefs_.RemoveValue(key)) 55 if (prefs_.RemoveValue(key))
56 FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(key)); 56 FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(key));
57 } 57 }
58 58
59 void ValueMapPrefStore::NotifyInitializationCompleted() { 59 void ValueMapPrefStore::NotifyInitializationCompleted() {
60 FOR_EACH_OBSERVER(Observer, observers_, OnInitializationCompleted(true)); 60 FOR_EACH_OBSERVER(Observer, observers_, OnInitializationCompleted(true));
61 } 61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698