Commit f9bfb7cb authored by Charlene Yan's avatar Charlene Yan Committed by Commit Bot

[Tab Group Collapse] Keyboard does not move tabs into a collapsed group.

Using F6 to cycle to a tab, then using CTRL+LEFT/RIGHT will not move a
tab into a collapsed group.

Bug: 1018230
Change-Id: I497075710186a8ab0d67971aa9fc203147057dc4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2219402Reviewed-by: default avatarConnie Wan <connily@chromium.org>
Commit-Queue: Charlene Yan <cyan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773941}
parent 3ea2a18b
......@@ -2892,18 +2892,20 @@ void TabStrip::ShiftTabRelative(Tab* tab, int offset) {
return;
}
// If the tab is at a group boundary, instead of actually moving the tab just
// change its group membership.
// If the tab is at a group boundary and the group is expanded, instead of
// actually moving the tab just change its group membership.
base::Optional<tab_groups::TabGroupId> target_group =
tab_at(target_index)->group();
if (tab->group() != target_group) {
if (tab->group().has_value())
if (tab->group().has_value()) {
controller_->RemoveTabFromGroup(start_index);
else if (target_group.has_value())
return;
} else if (target_group.has_value() &&
!controller_->IsGroupCollapsed(target_group.value())) {
controller_->AddTabToGroup(start_index, target_group.value());
return;
}
}
controller_->MoveTab(start_index, target_index);
}
......
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