| 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 6388e05c4673c2ee8d58245e657fc35f55f2a36d..af37ebdb9908f92b14131114451806f8f1f7d0e0 100644
|
| --- a/ui/app_list/views/apps_grid_view.cc
|
| +++ b/ui/app_list/views/apps_grid_view.cc
|
| @@ -1400,6 +1400,7 @@ bool AppsGridView::CalculateFolderDropTarget(const gfx::Point& point,
|
| !IsFolderItem(drag_view_->item()) &&
|
| CanDropIntoTarget(nearest_tile_index)) {
|
| *drop_target = nearest_tile_index;
|
| + DCHECK(IsValidIndex(*drop_target));
|
| return true;
|
| }
|
|
|
| @@ -1436,6 +1437,7 @@ void AppsGridView::CalculateReorderDropTarget(const gfx::Point& point,
|
| *drop_target =
|
| std::min(Index(pagination_model_.selected_page(), row * cols_ + col),
|
| GetLastViewIndex());
|
| + DCHECK(IsValidIndex(*drop_target));
|
| }
|
|
|
| void AppsGridView::OnReorderTimer() {
|
| @@ -1550,6 +1552,8 @@ void AppsGridView::EndDragFromReparentItemInRootLevel(
|
| } else if (drop_attempt_ == DROP_FOR_FOLDER &&
|
| IsValidIndex(folder_drop_target_)) {
|
| ReparentItemToAnotherFolder(drag_view_, folder_drop_target_);
|
| + } else {
|
| + NOTREACHED();
|
| }
|
| SetViewHidden(drag_view_, false /* show */, true /* no animate */);
|
| }
|
| @@ -2095,9 +2099,10 @@ AppsGridView::Index AppsGridView::GetNearestTileIndexForPoint(
|
| gfx::Rect bounds = GetContentsBounds();
|
| gfx::Size total_tile_size = GetTotalTileSize();
|
| int col = ClampToRange(
|
| - (point.x() - bounds.x()) / total_tile_size.width(), 0, cols_);
|
| - int row = ClampToRange(
|
| - (point.y() - bounds.y()) / total_tile_size.height(), 0, rows_per_page_);
|
| + (point.x() - bounds.x()) / total_tile_size.width(), 0, cols_ - 1);
|
| + int row = ClampToRange((point.y() - bounds.y()) / total_tile_size.height(),
|
| + 0,
|
| + rows_per_page_ - 1);
|
| return Index(pagination_model_.selected_page(), row * cols_ + col);
|
| }
|
|
|
|
|