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

Unified Diff: ui/app_list/app_list_folder_item.cc

Issue 681373004: App list folder icons: Fixed off-by-one error. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ares-allapps-button
Patch Set: Fixed bad DCHECK (off-by-one; and made into a CHECK). Created 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/app_list_folder_item.cc
diff --git a/ui/app_list/app_list_folder_item.cc b/ui/app_list/app_list_folder_item.cc
index a844be6ac518bd740cccfafd4b569df2173a46cb..e5b75a540518d13e705caf7d73abbd638e1c2a54 100644
--- a/ui/app_list/app_list_folder_item.cc
+++ b/ui/app_list/app_list_folder_item.cc
@@ -39,7 +39,7 @@ void AppListFolderItem::UpdateIcon() {
}
const gfx::ImageSkia& AppListFolderItem::GetTopIcon(size_t item_index) {
- DCHECK(item_index <= top_items_.size());
+ CHECK_LT(item_index, top_items_.size());
return top_items_[item_index]->icon();
}
@@ -113,20 +113,20 @@ void AppListFolderItem::ItemIconChanged() {
void AppListFolderItem::OnListItemAdded(size_t index,
AppListItem* item) {
- if (index <= kNumFolderTopItems)
+ if (index < kNumFolderTopItems)
UpdateTopItems();
}
void AppListFolderItem::OnListItemRemoved(size_t index,
AppListItem* item) {
- if (index <= kNumFolderTopItems)
+ if (index < kNumFolderTopItems)
UpdateTopItems();
}
void AppListFolderItem::OnListItemMoved(size_t from_index,
size_t to_index,
AppListItem* item) {
- if (from_index <= kNumFolderTopItems || to_index <= kNumFolderTopItems)
+ if (from_index < kNumFolderTopItems || to_index < kNumFolderTopItems)
UpdateTopItems();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698