OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/preferences/public/cpp/pref_observer_store.h" | 5 #include "services/preferences/public/cpp/pref_observer_store.h" |
6 | 6 |
| 7 #include "base/memory/ptr_util.h" |
7 #include "base/values.h" | 8 #include "base/values.h" |
8 #include "mojo/public/cpp/bindings/array.h" | 9 #include "mojo/public/cpp/bindings/array.h" |
9 #include "services/service_manager/public/cpp/connector.h" | 10 #include "services/service_manager/public/cpp/connector.h" |
10 | 11 |
11 namespace preferences { | 12 namespace preferences { |
12 | 13 |
13 PrefObserverStore::PrefObserverStore( | 14 PrefObserverStore::PrefObserverStore( |
14 prefs::mojom::PreferencesManagerPtr prefs_manager_ptr) | 15 prefs::mojom::PreferencesManagerPtr prefs_manager_ptr) |
15 : prefs_binding_(this), | 16 : prefs_binding_(this), |
16 prefs_manager_ptr_(std::move(prefs_manager_ptr)), | 17 prefs_manager_ptr_(std::move(prefs_manager_ptr)), |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 95 |
95 for (base::DictionaryValue::Iterator it(*preferences); !it.IsAtEnd(); | 96 for (base::DictionaryValue::Iterator it(*preferences); !it.IsAtEnd(); |
96 it.Advance()) { | 97 it.Advance()) { |
97 if (keys_.find(it.key()) == keys_.end()) | 98 if (keys_.find(it.key()) == keys_.end()) |
98 continue; | 99 continue; |
99 ValueMapPrefStore::SetValue(it.key(), it.value().CreateDeepCopy(), 0); | 100 ValueMapPrefStore::SetValue(it.key(), it.value().CreateDeepCopy(), 0); |
100 } | 101 } |
101 } | 102 } |
102 | 103 |
103 } // namespace preferences | 104 } // namespace preferences |
OLD | NEW |