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

Unified Diff: ui/app_list/views/apps_grid_view.cc

Issue 600393002: AppListModel / AppsGridView: Better error handling for corner cases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@appsgridview-static-casts
Patch Set: Comment. Created 6 years, 3 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/app_list_model_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/apps_grid_view.cc
diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc
index 5df27a63e79c8a455c62956c478f65b4ea82a8da..140ae4a2a75db94cdf2dfe839d2077e7150321aa 100644
--- a/ui/app_list/views/apps_grid_view.cc
+++ b/ui/app_list/views/apps_grid_view.cc
@@ -1737,8 +1737,14 @@ void AppsGridView::MoveItemToFolder(AppListItemView* item_view,
const std::string& source_item_id = item_view->item()->id();
AppListItemView* target_view =
GetViewDisplayedAtSlotOnCurrentPage(target.slot);
+ DCHECK(target_view);
const std::string& target_view_item_id = target_view->item()->id();
+ // Check that the item is not being dropped onto itself; this should not
+ // happen, but it can if something allows multiple views to share an
+ // item (e.g., if a folder drop does not clean up properly).
+ DCHECK_NE(source_item_id, target_view_item_id);
+
// Make change to data model.
item_list_->RemoveObserver(this);
std::string folder_item_id =
« no previous file with comments | « ui/app_list/app_list_model_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698