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

Unified Diff: ui/app_list/app_list_item.cc

Issue 2422873002: Remove usage of FOR_EACH_OBSERVER macro in ui/app_list (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
« no previous file with comments | « no previous file | ui/app_list/app_list_item_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/app_list_item.cc
diff --git a/ui/app_list/app_list_item.cc b/ui/app_list/app_list_item.cc
index d0daa271c7a708dc758e9bf837f8ff34e1054dc6..fbaed42d9105c8876992fefe764af2ed8467f430 100644
--- a/ui/app_list/app_list_item.cc
+++ b/ui/app_list/app_list_item.cc
@@ -17,12 +17,14 @@ AppListItem::AppListItem(const std::string& id)
}
AppListItem::~AppListItem() {
- FOR_EACH_OBSERVER(AppListItemObserver, observers_, ItemBeingDestroyed());
+ for (auto& observer : observers_)
+ observer.ItemBeingDestroyed();
}
void AppListItem::SetIcon(const gfx::ImageSkia& icon) {
icon_ = icon;
- FOR_EACH_OBSERVER(AppListItemObserver, observers_, ItemIconChanged());
+ for (auto& observer : observers_)
+ observer.ItemIconChanged();
}
void AppListItem::SetIsInstalling(bool is_installing) {
@@ -30,9 +32,8 @@ void AppListItem::SetIsInstalling(bool is_installing) {
return;
is_installing_ = is_installing;
- FOR_EACH_OBSERVER(AppListItemObserver,
- observers_,
- ItemIsInstallingChanged());
+ for (auto& observer : observers_)
+ observer.ItemIsInstallingChanged();
}
void AppListItem::SetPercentDownloaded(int percent_downloaded) {
@@ -40,9 +41,8 @@ void AppListItem::SetPercentDownloaded(int percent_downloaded) {
return;
percent_downloaded_ = percent_downloaded;
- FOR_EACH_OBSERVER(AppListItemObserver,
- observers_,
- ItemPercentDownloadedChanged());
+ for (auto& observer : observers_)
+ observer.ItemPercentDownloadedChanged();
}
void AppListItem::AddObserver(AppListItemObserver* observer) {
@@ -96,7 +96,8 @@ void AppListItem::SetName(const std::string& name) {
return;
name_ = name;
short_name_.clear();
- FOR_EACH_OBSERVER(AppListItemObserver, observers_, ItemNameChanged());
+ for (auto& observer : observers_)
+ observer.ItemNameChanged();
}
void AppListItem::SetNameAndShortName(const std::string& name,
@@ -105,7 +106,8 @@ void AppListItem::SetNameAndShortName(const std::string& name,
return;
name_ = name;
short_name_ = short_name;
- FOR_EACH_OBSERVER(AppListItemObserver, observers_, ItemNameChanged());
+ for (auto& observer : observers_)
+ observer.ItemNameChanged();
}
} // namespace app_list
« no previous file with comments | « no previous file | ui/app_list/app_list_item_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698