| 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/values.h" | 7 #include "base/values.h" |
| 8 #include "mojo/common/common_custom_types.mojom.h" | |
| 9 #include "mojo/public/cpp/bindings/array.h" | 8 #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 PrefObserverStore::PrefObserverStore( | 11 PrefObserverStore::PrefObserverStore( |
| 13 prefs::mojom::PreferencesManagerPtr prefs_manager_ptr) | 12 prefs::mojom::PreferencesManagerPtr prefs_manager_ptr) |
| 14 : prefs_binding_(this), | 13 : prefs_binding_(this), |
| 15 prefs_manager_ptr_(std::move(prefs_manager_ptr)), | 14 prefs_manager_ptr_(std::move(prefs_manager_ptr)), |
| 16 initialized_(false) {} | 15 initialized_(false) {} |
| 17 | 16 |
| 18 void PrefObserverStore::Init(const std::set<std::string>& keys) { | 17 void PrefObserverStore::Init(const std::set<std::string>& keys) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 continue; | 91 continue; |
| 93 // We deliberately call the parent to avoid notifying the server again. | 92 // We deliberately call the parent to avoid notifying the server again. |
| 94 ValueMapPrefStore::SetValue(it.key(), it.value().CreateDeepCopy(), 0); | 93 ValueMapPrefStore::SetValue(it.key(), it.value().CreateDeepCopy(), 0); |
| 95 } | 94 } |
| 96 | 95 |
| 97 if (!initialized_) { | 96 if (!initialized_) { |
| 98 initialized_ = true; | 97 initialized_ = true; |
| 99 NotifyInitializationCompleted(); | 98 NotifyInitializationCompleted(); |
| 100 } | 99 } |
| 101 } | 100 } |
| OLD | NEW |