OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/supervised_user/supervised_user_pref_store.h" | 5 #include "chrome/browser/supervised_user/supervised_user_pref_store.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 content::Source<Profile>( | 80 content::Source<Profile>( |
81 supervised_user_settings_service->GetProfile())); | 81 supervised_user_settings_service->GetProfile())); |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 bool SupervisedUserPrefStore::GetValue(const std::string& key, | 85 bool SupervisedUserPrefStore::GetValue(const std::string& key, |
86 const base::Value** value) const { | 86 const base::Value** value) const { |
87 return prefs_->GetValue(key, value); | 87 return prefs_->GetValue(key, value); |
88 } | 88 } |
89 | 89 |
| 90 std::unique_ptr<base::DictionaryValue> SupervisedUserPrefStore::GetValues() |
| 91 const { |
| 92 return prefs_->AsDictionaryValue(); |
| 93 } |
| 94 |
90 void SupervisedUserPrefStore::AddObserver(PrefStore::Observer* observer) { | 95 void SupervisedUserPrefStore::AddObserver(PrefStore::Observer* observer) { |
91 observers_.AddObserver(observer); | 96 observers_.AddObserver(observer); |
92 } | 97 } |
93 | 98 |
94 void SupervisedUserPrefStore::RemoveObserver(PrefStore::Observer* observer) { | 99 void SupervisedUserPrefStore::RemoveObserver(PrefStore::Observer* observer) { |
95 observers_.RemoveObserver(observer); | 100 observers_.RemoveObserver(observer); |
96 } | 101 } |
97 | 102 |
98 bool SupervisedUserPrefStore::HasObservers() const { | 103 bool SupervisedUserPrefStore::HasObservers() const { |
99 return observers_.might_have_observers(); | 104 return observers_.might_have_observers(); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 } | 189 } |
185 | 190 |
186 // Callback to unsubscribe from the supervised user settings service. | 191 // Callback to unsubscribe from the supervised user settings service. |
187 void SupervisedUserPrefStore::Observe( | 192 void SupervisedUserPrefStore::Observe( |
188 int type, | 193 int type, |
189 const content::NotificationSource& src, | 194 const content::NotificationSource& src, |
190 const content::NotificationDetails& details) { | 195 const content::NotificationDetails& details) { |
191 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); | 196 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); |
192 user_settings_subscription_.reset(); | 197 user_settings_subscription_.reset(); |
193 } | 198 } |
OLD | NEW |