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

Unified Diff: components/proximity_auth/screenlock_bridge.cc

Issue 2423353002: 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 side-by-side diff with in-line comments
Download patch
Index: components/proximity_auth/screenlock_bridge.cc
diff --git a/components/proximity_auth/screenlock_bridge.cc b/components/proximity_auth/screenlock_bridge.cc
index 3a9411483f1c9fe4e8cd9648fb0a75ec4a3c0cc2..d3996b17b05b600282c4d390c98dabf7ea3cd4ba 100644
--- a/components/proximity_auth/screenlock_bridge.cc
+++ b/components/proximity_auth/screenlock_bridge.cc
@@ -134,10 +134,13 @@ void ScreenlockBridge::SetLockHandler(LockHandler* lock_handler) {
focused_account_id_ = EmptyAccountId();
lock_handler_ = lock_handler;
- if (lock_handler_)
- FOR_EACH_OBSERVER(Observer, observers_, OnScreenDidLock(screen_type));
- else
- FOR_EACH_OBSERVER(Observer, observers_, OnScreenDidUnlock(screen_type));
+ if (lock_handler_) {
+ for (auto& observer : observers_)
+ observer.OnScreenDidLock(screen_type);
+ } else {
+ for (auto& observer : observers_)
+ observer.OnScreenDidUnlock(screen_type);
+ }
}
void ScreenlockBridge::SetFocusedUser(const AccountId& account_id) {
@@ -145,7 +148,8 @@ void ScreenlockBridge::SetFocusedUser(const AccountId& account_id) {
return;
PA_LOG(INFO) << "Focused user changed to " << account_id.Serialize();
focused_account_id_ = account_id;
- FOR_EACH_OBSERVER(Observer, observers_, OnFocusedUserChanged(account_id));
+ for (auto& observer : observers_)
+ observer.OnFocusedUserChanged(account_id);
}
bool ScreenlockBridge::IsLocked() const {
« no previous file with comments | « components/proximity_auth/remote_device_life_cycle_impl.cc ('k') | components/user_manager/user_manager_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698