Fix slot index being ambiguous depending on the group of the tab.
If a tab wants to move to model index to the left of the leftmost tab in a group, where it should end up in TabStripLayoutHelper::slots_ is ambiguous. If it is in the same group as the grouped tab, it should go to the right of the header so the group remains contiguous. But if not, it should go to the left. To disambiguate this case, GetSlotIndexForTabModelIndex now takes the group of the tab at |model_index| as a parameter. It cannot look up the Tab* in TabStrip::tabs_ in the general case, since it might be called in the middle of processing a MoveTab or RemoveTab, where the model indices have already been updated in that data structure. Bug: 989964 Change-Id: I2f35218d01c8398e6e024096bd35244ca67ca330 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764181 Commit-Queue: Bret Sepulveda <bsep@chromium.org> Reviewed-by:Taylor Bergquist <tbergquist@chromium.org> Cr-Commit-Position: refs/heads/master@{#690053}
Showing
Please register or sign in to comment