Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(837)

Side by Side Diff: components/syncable_prefs/pref_service_syncable.cc

Issue 2430823002: Reduce usage of FOR_EACH_OBSERVER macro in components/ (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/syncable_prefs/pref_model_associator.cc ('k') | components/undo/undo_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « components/syncable_prefs/pref_model_associator.cc ('k') | components/undo/undo_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698