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

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

Issue 2704133006: Revert of Add PrefStore::GetValues (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
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 "components/prefs/value_map_pref_store.h" 5 #include "components/prefs/value_map_pref_store.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 12
13 ValueMapPrefStore::ValueMapPrefStore() {} 13 ValueMapPrefStore::ValueMapPrefStore() {}
14 14
15 bool ValueMapPrefStore::GetValue(const std::string& key, 15 bool ValueMapPrefStore::GetValue(const std::string& key,
16 const base::Value** value) const { 16 const base::Value** value) const {
17 return prefs_.GetValue(key, value); 17 return prefs_.GetValue(key, value);
18 } 18 }
19 19
20 std::unique_ptr<base::DictionaryValue> ValueMapPrefStore::GetValues() const {
21 return prefs_.AsDictionaryValue();
22 }
23
24 void ValueMapPrefStore::AddObserver(PrefStore::Observer* observer) { 20 void ValueMapPrefStore::AddObserver(PrefStore::Observer* observer) {
25 observers_.AddObserver(observer); 21 observers_.AddObserver(observer);
26 } 22 }
27 23
28 void ValueMapPrefStore::RemoveObserver(PrefStore::Observer* observer) { 24 void ValueMapPrefStore::RemoveObserver(PrefStore::Observer* observer) {
29 observers_.RemoveObserver(observer); 25 observers_.RemoveObserver(observer);
30 } 26 }
31 27
32 bool ValueMapPrefStore::HasObservers() const { 28 bool ValueMapPrefStore::HasObservers() const {
33 return observers_.might_have_observers(); 29 return observers_.might_have_observers();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 uint32_t flags) { 61 uint32_t flags) {
66 prefs_.SetValue(key, std::move(value)); 62 prefs_.SetValue(key, std::move(value));
67 } 63 }
68 64
69 ValueMapPrefStore::~ValueMapPrefStore() {} 65 ValueMapPrefStore::~ValueMapPrefStore() {}
70 66
71 void ValueMapPrefStore::NotifyInitializationCompleted() { 67 void ValueMapPrefStore::NotifyInitializationCompleted() {
72 for (Observer& observer : observers_) 68 for (Observer& observer : observers_)
73 observer.OnInitializationCompleted(true); 69 observer.OnInitializationCompleted(true);
74 } 70 }
OLDNEW
« no previous file with comments | « components/prefs/value_map_pref_store.h ('k') | components/user_prefs/tracked/segregated_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698