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

Unified Diff: ui/app_list/pagination_model.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 | « ui/app_list/folder_image.cc ('k') | ui/app_list/search/history_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/pagination_model.cc
diff --git a/ui/app_list/pagination_model.cc b/ui/app_list/pagination_model.cc
index 0e568d81535021426122c7f075359c8f6848b6eb..c34ee7679a4675a5a74b23242a270a2b5bf76b46 100644
--- a/ui/app_list/pagination_model.cc
+++ b/ui/app_list/pagination_model.cc
@@ -33,7 +33,8 @@ void PaginationModel::SetTotalPages(int total_pages) {
SelectPage(0, false /* animate */);
if (selected_page_ >= total_pages_)
SelectPage(std::max(total_pages_ - 1, 0), false /* animate */);
- FOR_EACH_OBSERVER(PaginationModelObserver, observers_, TotalPagesChanged());
+ for (auto& observer : observers_)
+ observer.TotalPagesChanged();
}
void PaginationModel::SelectPage(int page, bool animate) {
@@ -197,17 +198,18 @@ int PaginationModel::SelectedTargetPage() const {
void PaginationModel::NotifySelectedPageChanged(int old_selected,
int new_selected) {
- FOR_EACH_OBSERVER(PaginationModelObserver,
- observers_,
- SelectedPageChanged(old_selected, new_selected));
+ for (auto& observer : observers_)
+ observer.SelectedPageChanged(old_selected, new_selected);
}
void PaginationModel::NotifyTransitionStarted() {
- FOR_EACH_OBSERVER(PaginationModelObserver, observers_, TransitionStarted());
+ for (auto& observer : observers_)
+ observer.TransitionStarted();
}
void PaginationModel::NotifyTransitionChanged() {
- FOR_EACH_OBSERVER(PaginationModelObserver, observers_, TransitionChanged());
+ for (auto& observer : observers_)
+ observer.TransitionChanged();
}
int PaginationModel::CalculateTargetPage(int delta) const {
« no previous file with comments | « ui/app_list/folder_image.cc ('k') | ui/app_list/search/history_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698