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

Unified Diff: chrome/browser/chromeos/settings/device_settings_service.cc

Issue 2416763002: Replace FOR_EACH_OBSERVER in c/b/chromeos with range-based for (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: chrome/browser/chromeos/settings/device_settings_service.cc
diff --git a/chrome/browser/chromeos/settings/device_settings_service.cc b/chrome/browser/chromeos/settings/device_settings_service.cc
index 993729b2ec54a8d76af1fd83b20baa857d9b0473..65b148ca31d92fe36967740136a4ce611fe3c720 100644
--- a/chrome/browser/chromeos/settings/device_settings_service.cc
+++ b/chrome/browser/chromeos/settings/device_settings_service.cc
@@ -81,7 +81,8 @@ DeviceSettingsService::DeviceSettingsService()
DeviceSettingsService::~DeviceSettingsService() {
DCHECK(pending_operations_.empty());
- FOR_EACH_OBSERVER(Observer, observers_, OnDeviceSettingsServiceShutdown());
+ for (auto& observer : observers_)
+ observer.OnDeviceSettingsServiceShutdown();
}
void DeviceSettingsService::SetSessionManager(
@@ -281,14 +282,16 @@ void DeviceSettingsService::HandleCompletedOperation(
}
if (new_owner_key) {
- FOR_EACH_OBSERVER(Observer, observers_, OwnershipStatusChanged());
+ for (auto& observer : observers_)
+ observer.OwnershipStatusChanged();
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_OWNERSHIP_STATUS_CHANGED,
content::Source<DeviceSettingsService>(this),
content::NotificationService::NoDetails());
}
- FOR_EACH_OBSERVER(Observer, observers_, DeviceSettingsUpdated());
+ for (auto& observer : observers_)
+ observer.DeviceSettingsUpdated();
std::vector<OwnershipStatusCallback> callbacks;
callbacks.swap(pending_ownership_status_callbacks_);
@@ -315,7 +318,8 @@ void DeviceSettingsService::HandleError(Status status,
LOG(ERROR) << "Session manager operation failed: " << status;
- FOR_EACH_OBSERVER(Observer, observers_, DeviceSettingsUpdated());
+ for (auto& observer : observers_)
+ observer.DeviceSettingsUpdated();
// The completion callback happens after the notification so clients can
// filter self-triggered updates.

Powered by Google App Engine
This is Rietveld 408576698