Commit e63f179c authored by Min Chen's avatar Min Chen Committed by Commit Bot

Update shelf visibility in ~TabletModeWindowDragDelegate.

Added UpdateShelfVisibility in ~TabletModeWindowDragDelegate to keep
shelf in correct state after drag a window from top.
Most of the cases shelf can achieve a correct state after drag except for
dragging a browser window from top. The problem is that we delete drag
details in EndingForDraggingWindow for app windows but we can't do the
same for browser window.
Then ShelfLayoutManager::IsDraggingWindowFromTopOrCaptionArea
will drop into wrong condition in this case, which will cause the shelf
into a wrong state at the end of drag.

Tried to UpdateShelfVisibility again in ~TabletModeWindowDragDelegate
when drag details has already been deleted for all the window drags.

Bug: 882962
Change-Id: I6915bcfd7ee1890d40ca5d422c913552a487daf1
Reviewed-on: https://chromium-review.googlesource.com/1219934Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Min Chen <minch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590529}
parent 081f28c2
...@@ -72,7 +72,9 @@ TabletModeWindowDragDelegate::TabletModeWindowDragDelegate() ...@@ -72,7 +72,9 @@ TabletModeWindowDragDelegate::TabletModeWindowDragDelegate()
split_view_drag_indicators_(std::make_unique<SplitViewDragIndicators>()), split_view_drag_indicators_(std::make_unique<SplitViewDragIndicators>()),
weak_ptr_factory_(this) {} weak_ptr_factory_(this) {}
TabletModeWindowDragDelegate::~TabletModeWindowDragDelegate() = default; TabletModeWindowDragDelegate::~TabletModeWindowDragDelegate() {
Shell::Get()->UpdateShelfVisibility();
}
void TabletModeWindowDragDelegate::StartWindowDrag( void TabletModeWindowDragDelegate::StartWindowDrag(
aura::Window* dragged_window, aura::Window* dragged_window,
...@@ -82,7 +84,7 @@ void TabletModeWindowDragDelegate::StartWindowDrag( ...@@ -82,7 +84,7 @@ void TabletModeWindowDragDelegate::StartWindowDrag(
PrepareForDraggedWindow(location_in_screen); PrepareForDraggedWindow(location_in_screen);
// Update the shelf's visibility. // Update the shelf's visibility to keep shelf visible during drag.
RootWindowController::ForWindow(dragged_window_) RootWindowController::ForWindow(dragged_window_)
->GetShelfLayoutManager() ->GetShelfLayoutManager()
->UpdateVisibilityState(); ->UpdateVisibilityState();
......
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