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

Unified Diff: ui/app_list/pagination_model.cc

Issue 20656002: Add profile selector menu to app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove junk from list_model.h Created 7 years, 5 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: ui/app_list/pagination_model.cc
diff --git a/ui/app_list/pagination_model.cc b/ui/app_list/pagination_model.cc
index 2bf69020ab87950d110cba73853c6bbd9bbe135a..d89b4ac541225143f98b5ce44ef4634bf48724f7 100644
--- a/ui/app_list/pagination_model.cc
+++ b/ui/app_list/pagination_model.cc
@@ -31,8 +31,9 @@ void PaginationModel::SetTotalPages(int total_pages) {
total_pages_ = total_pages;
if (selected_page_ < 0)
SelectPage(0, false /* animate */);
- if (selected_page_ >= total_pages_)
- SelectPage(total_pages_ - 1, false /* animate */);
+ if (selected_page_ >= total_pages_) {
koz (OOO until 15th September) 2013/08/05 01:09:11 nit: no curlies
+ SelectPage(std::max(total_pages_ - 1, 0), false /* animate */);
+ }
FOR_EACH_OBSERVER(PaginationModelObserver, observers_, TotalPagesChanged());
}
@@ -82,7 +83,7 @@ void PaginationModel::SelectPage(int page, bool animate) {
}
}
} else {
- DCHECK(page >= 0 && page < total_pages_);
+ DCHECK(page == 0 || (page > 0 && page < total_pages_));
koz (OOO until 15th September) 2013/08/05 01:09:11 This change seems unnecessary.
calamity 2013/08/08 04:52:12 Oops. Should be total_pages_ == 0. This needed to
if (page == selected_page_)
return;

Powered by Google App Engine
This is Rietveld 408576698