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

Unified Diff: chrome/browser/extensions/api/commands/command_service.cc

Issue 2422963002: Remove FOR_EACH_OBSERVER macro usage in chrome/browser/extensions (Closed)
Patch Set: extensions 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/extensions/api/commands/command_service.cc
diff --git a/chrome/browser/extensions/api/commands/command_service.cc b/chrome/browser/extensions/api/commands/command_service.cc
index 960bf41cd647ed3c57aef4addb5f29f35f2b5c9c..1e1c25ad08e56abc7ffdba02d1424f17a92b3f7a 100644
--- a/chrome/browser/extensions/api/commands/command_service.cc
+++ b/chrome/browser/extensions/api/commands/command_service.cc
@@ -294,11 +294,10 @@ bool CommandService::AddKeybindingPref(
std::move(suggested_key_prefs));
// Fetch the newly-updated command, and notify the observers.
- FOR_EACH_OBSERVER(
- Observer,
- observers_,
- OnExtensionCommandAdded(extension_id,
- FindCommandByName(extension_id, command_name)));
+ for (auto& observer : observers_) {
+ observer.OnExtensionCommandAdded(
+ extension_id, FindCommandByName(extension_id, command_name));
+ }
// TODO(devlin): Deprecate this notification in favor of the observers.
std::pair<const std::string, const std::string> details =
@@ -849,10 +848,8 @@ void CommandService::RemoveKeybindingPrefs(const std::string& extension_id,
}
for (const Command& removed_command : removed_commands) {
- FOR_EACH_OBSERVER(
- Observer,
- observers_,
- OnExtensionCommandRemoved(extension_id, removed_command));
+ for (auto& observer : observers_)
+ observer.OnExtensionCommandRemoved(extension_id, removed_command);
}
}

Powered by Google App Engine
This is Rietveld 408576698