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

Do not actually scale up new selector item in overview.

Because of this cl
https://chromium-review.googlesource.com/c/chromium/src/+/1173158
The new selector item will be scaled up when we start drag a window from top.
But actually we just want to get the bounds of the scaled up new selector item,
we don't actually want to scaled it up in this case.

Bug: 872528
Change-Id: I4d132680ed35440eb5873620412fba1931db1857
Reviewed-on: https://chromium-review.googlesource.com/1182799Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Min Chen <minch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585568}
parent b306277d
......@@ -736,8 +736,11 @@ void WindowSelectorItem::UpdateBackdropBounds() {
}
gfx::Rect WindowSelectorItem::GetBoundsOfSelectedItem() {
gfx::Rect original_bounds = target_bounds();
ScaleUpSelectedItem(OVERVIEW_ANIMATION_NONE);
return transform_window_.GetTransformedBounds();
gfx::Rect selected_bounds = transform_window_.GetTransformedBounds();
SetBounds(original_bounds, OVERVIEW_ANIMATION_NONE);
return selected_bounds;
}
void WindowSelectorItem::ScaleUpSelectedItem(
......
......@@ -157,8 +157,11 @@ class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
void DisableBackdrop();
void UpdateBackdropBounds();
// TODO(minch): Do not actually scale up the item to get the bounds.
// http://crbug.com/876567.
// Returns the bounds of the selected item, which will be scaled up a little
// bit and header view will be hidden after being selected.
// bit and header view will be hidden after being selected. Note, the item
// will be restored back after scaled up.
gfx::Rect GetBoundsOfSelectedItem();
// Increases the bounds of the dragged item.
......
......@@ -2497,17 +2497,21 @@ TEST_F(SplitViewTabDraggingTest, WindowBoundsUpdatedBeforeAddingToOverview) {
ASSERT_TRUE(current_grid);
EXPECT_EQ(1u, current_grid->window_list().size());
WindowSelectorItem* new_selector_item = current_grid->GetNewSelectorItem();
ASSERT_TRUE(new_selector_item);
const gfx::Rect new_selector_bounds = new_selector_item->target_bounds();
DragWindowTo(resizer.get(), new_selector_bounds.CenterPoint());
WindowSelectorItem* selector_item = current_grid->GetNewSelectorItem();
ASSERT_TRUE(selector_item);
const gfx::Rect item_bounds_during_drag = selector_item->target_bounds();
DragWindowTo(resizer.get(), item_bounds_during_drag.CenterPoint());
CompleteDrag(std::move(resizer));
// |window1| should have been merged into overview.
EXPECT_EQ(current_grid->window_list().size(), 1u);
EXPECT_TRUE(window_selector->IsWindowInOverview(window1.get()));
// |wiindow1|'s bounds should have been updated to its tablet mode bounds.
// |window1|'s bounds should have been updated to its tablet mode bounds.
EXPECT_EQ(tablet_mode_bounds, window1->bounds());
selector_item = current_grid->window_list().front().get();
// The new window selector item's bounds should be the same during drag and
// after drag.
EXPECT_EQ(item_bounds_during_drag, selector_item->target_bounds());
}
// Tests that a dragged window should have the active window shadow during
......
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