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