Commit 5db447c5 authored by Charlene Yan's avatar Charlene Yan Committed by Commit Bot

Revert "[Tab Groups] Add animation for tab group headers."

This reverts commit d4a087be.

Reason for revert: broken between window drag

Original change's description:
> [Tab Groups] Add animation for tab group headers.
> 
> Bug: 1021689
> 
> Change-Id: Ida4f922471b9e53684acfc683623150b82e2a7cf
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1906873
> Commit-Queue: Charlene Yan <cyan@chromium.org>
> Reviewed-by: Connie Wan <connily@chromium.org>
> Reviewed-by: Taylor Bergquist <tbergquist@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#721269}

TBR=tbergquist@chromium.org,cyan@chromium.org,connily@chromium.org

Change-Id: Iaa871c53373c42e5f55092c97d90e179b6f3862f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1021689
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1952094Reviewed-by: default avatarCharlene Yan <cyan@chromium.org>
Commit-Queue: Charlene Yan <cyan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721759}
parent ba97ff44
......@@ -1273,7 +1273,6 @@ void TabStrip::OnGroupVisualsChanged(TabGroupId group) {
}
void TabStrip::OnGroupDeleted(TabGroupId group) {
bounds_animator_.StopAnimatingView(group_header(group));
layout_helper_->RemoveGroupHeader(group);
UpdateIdealBounds();
AnimateToIdealBounds();
......@@ -2453,15 +2452,6 @@ void TabStrip::AnimateToIdealBounds(ClosingTabsBehavior closing_tabs_behavior) {
: std::make_unique<TabAnimationDelegate>(this, tab));
}
std::map<TabGroupId, TabGroupHeader*> group_headers = GetGroupHeaders();
std::map<TabGroupId, gfx::Rect> group_headers_bounds =
layout_helper_->group_header_ideal_bounds();
for (const auto& header_pair : group_headers) {
bounds_animator_.AnimateViewTo(header_pair.second,
group_headers_bounds.at(header_pair.first));
}
if (bounds_animator_.GetTargetBounds(new_tab_button_) !=
new_tab_button_ideal_bounds_) {
bounds_animator_.AnimateViewTo(new_tab_button_,
......@@ -2641,6 +2631,8 @@ void TabStrip::StoppedDraggingView(TabSlotView* view, bool* is_first_view) {
// Ensure the drag status is updated even if the view is not a valid tab.
// This is primarily to make sure group headers are updated correctly.
// Otherwise, tab drag status is only updated in PrepareForAnimation().
// TODO(crbug.com/1021689): Incorporate group headers in the normal
// animation flow instead of handling it here and then ignoring it.
if (view)
view->set_dragging(false);
......
......@@ -242,6 +242,7 @@ void TabStripLayoutHelper::InsertGroupHeader(
TabGroupId group,
TabGroupHeader* header,
base::OnceClosure header_removed_callback) {
// TODO(958173): Animate open.
std::vector<int> tabs_in_group = controller_->ListTabsInGroup(group);
const int header_slot_index =
GetSlotIndexForTabModelIndex(tabs_in_group[0], group);
......@@ -249,11 +250,6 @@ void TabStripLayoutHelper::InsertGroupHeader(
slots_.begin() + header_slot_index,
TabSlot::CreateForGroupHeader(group, header, TabPinned::kUnpinned,
std::move(header_removed_callback)));
// Set the starting location of the header to something reasonable for the
// animation.
slots_[header_slot_index].view->SetBoundsRect(
GetTabs()[tabs_in_group[0]]->bounds());
}
void TabStripLayoutHelper::RemoveGroupHeader(TabGroupId group) {
......@@ -361,7 +357,7 @@ void TabStripLayoutHelper::UpdateIdealBounds(int available_width) {
}
break;
case ViewType::kGroupHeader:
group_header_ideal_bounds_[slot.view->group().value()] = bounds[i];
slot.view->SetBoundsRect(bounds[i]);
break;
}
}
......
......@@ -54,11 +54,6 @@ class TabStripLayoutHelper {
// Returns the number of pinned tabs in the tabstrip.
int GetPinnedTabCount() const;
// Returns a map of all tab groups and their bounds.
const std::map<TabGroupId, gfx::Rect>& group_header_ideal_bounds() const {
return group_header_ideal_bounds_;
}
// Inserts a new tab at |index|, without animation. |tab_removed_callback|
// will be invoked if the tab is removed at the end of a remove animation.
void InsertTabAtNoAnimation(int model_index,
......@@ -210,9 +205,6 @@ class TabStripLayoutHelper {
// run layout and animations for those Views.
std::vector<TabSlot> slots_;
// Contains the ideal bounds of tab group headers.
std::map<TabGroupId, gfx::Rect> group_header_ideal_bounds_;
// When in tab closing mode, if we want the next tab to the right to end up
// under the cursor, each tab needs to stay the same size. When defined,
// this specifies that size.
......
......@@ -1123,7 +1123,6 @@ TEST_P(TabStripTest, GroupHeaderMovesOnRegrouping) {
// Change groups in a way so that the header should swap with the tab, without
// an explicit MoveTab call.
controller_->MoveTabIntoGroup(1, group0);
CompleteAnimationAndLayout();
// Header is now right of tab 1.
EXPECT_LT(tab_strip_->tab_at(1)->x(), header1->x());
......
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