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

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

Issue 2692203007: Add PrefStore::GetValues (Closed)
Patch Set: Add GetValues to FilesystemJsonPrefStore 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
20 void ValueMapPrefStore::AddObserver(PrefStore::Observer* observer) { 24 void ValueMapPrefStore::AddObserver(PrefStore::Observer* observer) {
21 observers_.AddObserver(observer); 25 observers_.AddObserver(observer);
22 } 26 }
23 27
24 void ValueMapPrefStore::RemoveObserver(PrefStore::Observer* observer) { 28 void ValueMapPrefStore::RemoveObserver(PrefStore::Observer* observer) {
25 observers_.RemoveObserver(observer); 29 observers_.RemoveObserver(observer);
26 } 30 }
27 31
28 bool ValueMapPrefStore::HasObservers() const { 32 bool ValueMapPrefStore::HasObservers() const {
29 return observers_.might_have_observers(); 33 return observers_.might_have_observers();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 uint32_t flags) { 65 uint32_t flags) {
62 prefs_.SetValue(key, std::move(value)); 66 prefs_.SetValue(key, std::move(value));
63 } 67 }
64 68
65 ValueMapPrefStore::~ValueMapPrefStore() {} 69 ValueMapPrefStore::~ValueMapPrefStore() {}
66 70
67 void ValueMapPrefStore::NotifyInitializationCompleted() { 71 void ValueMapPrefStore::NotifyInitializationCompleted() {
68 for (Observer& observer : observers_) 72 for (Observer& observer : observers_)
69 observer.OnInitializationCompleted(true); 73 observer.OnInitializationCompleted(true);
70 } 74 }
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