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

Unified Diff: chrome/browser/extensions/install_tracker.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
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/install_tracker.cc
diff --git a/chrome/browser/extensions/install_tracker.cc b/chrome/browser/extensions/install_tracker.cc
index 16d091411502d01c7032821cfd9027870806e6fb..bda36cf8d85e14e2d77b43c3d1f2ca47bf6b00ce 100644
--- a/chrome/browser/extensions/install_tracker.cc
+++ b/chrome/browser/extensions/install_tracker.cc
@@ -83,13 +83,13 @@ void InstallTracker::OnBeginExtensionInstall(
active_installs_.insert(std::make_pair(params.extension_id, install_data));
}
- FOR_EACH_OBSERVER(InstallObserver, observers_,
- OnBeginExtensionInstall(params));
+ for (auto& observer : observers_)
+ observer.OnBeginExtensionInstall(params);
}
void InstallTracker::OnBeginExtensionDownload(const std::string& extension_id) {
- FOR_EACH_OBSERVER(
- InstallObserver, observers_, OnBeginExtensionDownload(extension_id));
+ for (auto& observer : observers_)
+ observer.OnBeginExtensionDownload(extension_id);
}
void InstallTracker::OnDownloadProgress(const std::string& extension_id,
@@ -102,30 +102,31 @@ void InstallTracker::OnDownloadProgress(const std::string& extension_id,
NOTREACHED();
}
- FOR_EACH_OBSERVER(InstallObserver, observers_,
- OnDownloadProgress(extension_id, percent_downloaded));
+ for (auto& observer : observers_)
+ observer.OnDownloadProgress(extension_id, percent_downloaded);
}
void InstallTracker::OnBeginCrxInstall(const std::string& extension_id) {
- FOR_EACH_OBSERVER(
- InstallObserver, observers_, OnBeginCrxInstall(extension_id));
+ for (auto& observer : observers_)
+ observer.OnBeginCrxInstall(extension_id);
}
void InstallTracker::OnFinishCrxInstall(const std::string& extension_id,
bool success) {
- FOR_EACH_OBSERVER(
- InstallObserver, observers_, OnFinishCrxInstall(extension_id, success));
+ for (auto& observer : observers_)
+ observer.OnFinishCrxInstall(extension_id, success);
}
void InstallTracker::OnInstallFailure(
const std::string& extension_id) {
RemoveActiveInstall(extension_id);
- FOR_EACH_OBSERVER(InstallObserver, observers_,
- OnInstallFailure(extension_id));
+ for (auto& observer : observers_)
+ observer.OnInstallFailure(extension_id);
}
void InstallTracker::Shutdown() {
- FOR_EACH_OBSERVER(InstallObserver, observers_, OnShutdown());
+ for (auto& observer : observers_)
+ observer.OnShutdown();
}
void InstallTracker::Observe(int type,
@@ -135,12 +136,13 @@ void InstallTracker::Observe(int type,
case extensions::NOTIFICATION_EXTENSION_UPDATE_DISABLED: {
const Extension* extension =
content::Details<const Extension>(details).ptr();
- FOR_EACH_OBSERVER(
- InstallObserver, observers_, OnDisabledExtensionUpdated(extension));
+ for (auto& observer : observers_)
+ observer.OnDisabledExtensionUpdated(extension);
break;
}
case chrome::NOTIFICATION_APP_LAUNCHER_REORDERED: {
- FOR_EACH_OBSERVER(InstallObserver, observers_, OnAppsReordered());
+ for (auto& observer : observers_)
+ observer.OnAppsReordered();
break;
}
default:
@@ -156,7 +158,8 @@ void InstallTracker::OnExtensionInstalled(
}
void InstallTracker::OnAppsReordered() {
- FOR_EACH_OBSERVER(InstallObserver, observers_, OnAppsReordered());
+ for (auto& observer : observers_)
+ observer.OnAppsReordered();
}
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698