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 "components/user_prefs/tracked/segregated_pref_store.h" | 5 #include "components/user_prefs/tracked/segregated_pref_store.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 void SegregatedPrefStore::ClearMutableValues() { | 159 void SegregatedPrefStore::ClearMutableValues() { |
160 NOTIMPLEMENTED(); | 160 NOTIMPLEMENTED(); |
161 } | 161 } |
162 | 162 |
163 SegregatedPrefStore::~SegregatedPrefStore() { | 163 SegregatedPrefStore::~SegregatedPrefStore() { |
164 default_pref_store_->RemoveObserver(&aggregating_observer_); | 164 default_pref_store_->RemoveObserver(&aggregating_observer_); |
165 selected_pref_store_->RemoveObserver(&aggregating_observer_); | 165 selected_pref_store_->RemoveObserver(&aggregating_observer_); |
166 } | 166 } |
167 | 167 |
168 PersistentPrefStore* SegregatedPrefStore::StoreForKey(const std::string& key) { | 168 PersistentPrefStore* SegregatedPrefStore::StoreForKey(const std::string& key) { |
169 return (ContainsKey(selected_preference_names_, key) | 169 return (base::ContainsKey(selected_preference_names_, key) |
170 ? selected_pref_store_ | 170 ? selected_pref_store_ |
171 : default_pref_store_).get(); | 171 : default_pref_store_) |
| 172 .get(); |
172 } | 173 } |
173 | 174 |
174 const PersistentPrefStore* SegregatedPrefStore::StoreForKey( | 175 const PersistentPrefStore* SegregatedPrefStore::StoreForKey( |
175 const std::string& key) const { | 176 const std::string& key) const { |
176 return (ContainsKey(selected_preference_names_, key) | 177 return (base::ContainsKey(selected_preference_names_, key) |
177 ? selected_pref_store_ | 178 ? selected_pref_store_ |
178 : default_pref_store_).get(); | 179 : default_pref_store_) |
| 180 .get(); |
179 } | 181 } |
OLD | NEW |