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

Side by Side Diff: components/signin/core/browser/account_tracker_service.cc

Issue 2422943002: Remove usage of FOR_EACH_OBSERVER macro in components/signin (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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/signin/core/browser/account_tracker_service.h" 5 #include "components/signin/core/browser/account_tracker_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 // static 162 // static
163 AccountTrackerService::AccountIdMigrationState 163 AccountTrackerService::AccountIdMigrationState
164 AccountTrackerService::GetMigrationState(const PrefService* pref_service) { 164 AccountTrackerService::GetMigrationState(const PrefService* pref_service) {
165 return static_cast<AccountTrackerService::AccountIdMigrationState>( 165 return static_cast<AccountTrackerService::AccountIdMigrationState>(
166 pref_service->GetInteger(prefs::kAccountIdMigrationState)); 166 pref_service->GetInteger(prefs::kAccountIdMigrationState));
167 } 167 }
168 168
169 void AccountTrackerService::NotifyAccountUpdated(const AccountState& state) { 169 void AccountTrackerService::NotifyAccountUpdated(const AccountState& state) {
170 DCHECK(!state.info.gaia.empty()); 170 DCHECK(!state.info.gaia.empty());
171 FOR_EACH_OBSERVER( 171 for (auto& observer : observer_list_)
172 Observer, observer_list_, OnAccountUpdated(state.info)); 172 observer.OnAccountUpdated(state.info);
173 } 173 }
174 174
175 void AccountTrackerService::NotifyAccountUpdateFailed( 175 void AccountTrackerService::NotifyAccountUpdateFailed(
176 const std::string& account_id) { 176 const std::string& account_id) {
177 FOR_EACH_OBSERVER( 177 for (auto& observer : observer_list_)
178 Observer, observer_list_, OnAccountUpdateFailed(account_id)); 178 observer.OnAccountUpdateFailed(account_id);
179 } 179 }
180 180
181 void AccountTrackerService::NotifyAccountRemoved(const AccountState& state) { 181 void AccountTrackerService::NotifyAccountRemoved(const AccountState& state) {
182 DCHECK(!state.info.gaia.empty()); 182 DCHECK(!state.info.gaia.empty());
183 FOR_EACH_OBSERVER( 183 for (auto& observer : observer_list_)
184 Observer, observer_list_, OnAccountRemoved(state.info)); 184 observer.OnAccountRemoved(state.info);
185 } 185 }
186 186
187 void AccountTrackerService::StartTrackingAccount( 187 void AccountTrackerService::StartTrackingAccount(
188 const std::string& account_id) { 188 const std::string& account_id) {
189 if (!base::ContainsKey(accounts_, account_id)) { 189 if (!base::ContainsKey(accounts_, account_id)) {
190 DVLOG(1) << "StartTracking " << account_id; 190 DVLOG(1) << "StartTracking " << account_id;
191 AccountState state; 191 AccountState state;
192 state.info.account_id = account_id; 192 state.info.account_id = account_id;
193 state.info.is_child_account = false; 193 state.info.is_child_account = false;
194 accounts_.insert(make_pair(account_id, state)); 194 accounts_.insert(make_pair(account_id, state));
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 NotifyAccountUpdated(state); 502 NotifyAccountUpdated(state);
503 } 503 }
504 SaveToPrefs(state); 504 SaveToPrefs(state);
505 } 505 }
506 return info.account_id; 506 return info.account_id;
507 } 507 }
508 508
509 void AccountTrackerService::RemoveAccount(const std::string& account_id) { 509 void AccountTrackerService::RemoveAccount(const std::string& account_id) {
510 StopTrackingAccount(account_id); 510 StopTrackingAccount(account_id);
511 } 511 }
OLDNEW
« no previous file with comments | « components/signin/core/browser/about_signin_internals.cc ('k') | components/signin/core/browser/fake_signin_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698