Commit a47b88e1 authored by Patrik Höglund's avatar Patrik Höglund Committed by Commit Bot

Revert "Fix page slip issue after dragging"

This reverts commit 05e6d611.

Reason for revert: Breaks AppsGridViewDragTest.MouseDragMaxItemsInFolder/6 and a bunch of other tests. 

==23676==ERROR: AddressSanitizer: container-overflow on address 0x608000011e50 at pc 0x5580f7784dcd bp 0x7ffd9affb130 sp 0x7ffd9affb128
READ of size 8 at 0x608000011e50 thread T0
    #0 0x5580f7784dcc in ViewAtBase ui/views/view_model.h:71:28

See https://sheriff-o-matic.appspot.com/chromium/examine/chromium.memory.Linux%20Chromium%20OS%20ASan%20LSan%20Tests%20(1).app_list_unittests.

Original change's description:
> Fix page slip issue after dragging
> 
> Changes:
> Update the selected page to be the target page of dragged item at the
> end of dragging.
> 
> Bug: 893832
> Change-Id: I91dcf8e03f62eab1597e3899bdbcafdad1fec2df
> Reviewed-on: https://chromium-review.googlesource.com/c/1324851
> Commit-Queue: Weidong Guo <weidongg@chromium.org>
> Reviewed-by: Alex Newcomer <newcomer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#606585}

TBR=newcomer@chromium.org,weidongg@chromium.org

Change-Id: I4177d2e3ac6226b415b627148db211614d0b7ec4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 893832
Reviewed-on: https://chromium-review.googlesource.com/c/1329170Reviewed-by: default avatarPatrik Höglund <phoglund@chromium.org>
Commit-Queue: Patrik Höglund <phoglund@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606820}
parent 2f2d97b7
......@@ -738,13 +738,6 @@ void AppsGridView::EndDrag(bool cancel) {
drag_source_bounds);
}
if (!cancel) {
// Select the page where dragged item is dropped.
pagination_model_.SelectPage(
GetIndexFromModelIndex(GetModelIndexOfItem(drag_item)).page,
false /* animate */);
}
StopPageFlipTimer();
}
......@@ -2208,6 +2201,9 @@ void AppsGridView::MoveItemInModel(AppListItemView* item_view,
view_model_.Move(current_model_index, target_model_index);
item_list_->AddObserver(this);
if (pagination_model_.selected_page() != target.page)
pagination_model_.SelectPage(target.page, false);
RecordAppMovingTypeMetrics(folder_delegate_ ? kReorderInFolder
: kReorderInTopLevel);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment