| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/syncable_prefs/pref_service_syncable.h" | 5 #include "components/syncable_prefs/pref_service_syncable.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 uint32_t flags) { | 173 uint32_t flags) { |
| 174 DCHECK(FindPreference(path)); | 174 DCHECK(FindPreference(path)); |
| 175 if (flags & user_prefs::PrefRegistrySyncable::SYNCABLE_PREF) { | 175 if (flags & user_prefs::PrefRegistrySyncable::SYNCABLE_PREF) { |
| 176 pref_sync_associator_.RegisterPref(path.c_str()); | 176 pref_sync_associator_.RegisterPref(path.c_str()); |
| 177 } else if (flags & user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF) { | 177 } else if (flags & user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF) { |
| 178 priority_pref_sync_associator_.RegisterPref(path.c_str()); | 178 priority_pref_sync_associator_.RegisterPref(path.c_str()); |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 | 181 |
| 182 void PrefServiceSyncable::OnIsSyncingChanged() { | 182 void PrefServiceSyncable::OnIsSyncingChanged() { |
| 183 FOR_EACH_OBSERVER(PrefServiceSyncableObserver, observer_list_, | 183 for (auto& observer : observer_list_) |
| 184 OnIsSyncingChanged()); | 184 observer.OnIsSyncingChanged(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void PrefServiceSyncable::ProcessPrefChange(const std::string& name) { | 187 void PrefServiceSyncable::ProcessPrefChange(const std::string& name) { |
| 188 pref_sync_associator_.ProcessPrefChange(name); | 188 pref_sync_associator_.ProcessPrefChange(name); |
| 189 priority_pref_sync_associator_.ProcessPrefChange(name); | 189 priority_pref_sync_associator_.ProcessPrefChange(name); |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace syncable_prefs | 192 } // namespace syncable_prefs |
| OLD | NEW |