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

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: 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
« ui/app_list/app_list_model.cc ('K') | « 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 8d7db8e3059e040100923b4074cba36feee749ed..71911dbc2ca2905216fe8c023bc88cc9967064ce 100644
--- a/ui/app_list/views/apps_grid_view.cc
+++ b/ui/app_list/views/apps_grid_view.cc
@@ -1733,7 +1733,13 @@ void AppsGridView::MoveItemToFolder(AppListItemView* item_view,
const Index& target) {
const std::string& source_item_id = item_view->item()->id();
AppListItemView* target_view = GetViewAtSlotOnCurrentPage(target.slot);
- const std::string& target_view_item_id = target_view->item()->id();
+ 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.
calamity 2014/09/26 03:55:18 (e.g a folder drop does not clean up properly)
Matt Giuca 2014/09/29 03:05:03 Done.
+ DCHECK_NE(source_item_id, target_view_item_id);
// Make change to data model.
item_list_->RemoveObserver(this);
« ui/app_list/app_list_model.cc ('K') | « 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