Commit c6b5fd71 authored by Jun Mukai's avatar Jun Mukai Committed by Commit Bot

fix TabDragging snap on tablet mode with Mash

The reported bug (tab-dragging to snap to left/right on tablet
mode with Mash) happens due to the timing of ClearTabDraggingInfo(),
it clears ash::kTabDroppedWindowStateTypeKey but this property
is used on IsSnapped() function.

To have this property, this CL moves invocation of
ClearTabDraggingInfo() slightly later in EndDragImpl, so that
CompleteDrag() can use the values.

BUG=880635
TEST=existing test passes, assuming this break nothing

Change-Id: I8ba34c793dade6462fb1ee9470851cf8f066c4ad
Reviewed-on: https://chromium-review.googlesource.com/c/1256006
Commit-Queue: Jun Mukai <mukai@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596040}
parent 797623d3
......@@ -1537,8 +1537,6 @@ void TabDragController::EndDragImpl(EndDragType type) {
GetAttachedBrowserWidget()->EndMoveLoop();
}
ClearTabDraggingInfo();
if (type != TAB_DESTROYED) {
// We only finish up the drag if we were actually dragging. If start_drag_
// is false, the user just clicked and released and didn't move the mouse
......@@ -1561,6 +1559,10 @@ void TabDragController::EndDragImpl(EndDragType type) {
RevertDrag();
} // else case the only tab we were dragging was deleted. Nothing to do.
// Clear tab dragging info after the complete/revert as CompleteDrag() may
// need to use some of the properties.
ClearTabDraggingInfo();
// Clear out drag data so we don't attempt to do anything with it.
drag_data_.clear();
......
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