Commit 44f923b2 authored by Ryan Landay's avatar Ryan Landay Committed by Commit Bot

Fix regression in StackLayout when closing all incognito tabs from notification

There's a sequence of steps (see crbug.com/820902) that can cause the Android
tab switcher to enter a state where it's showing a margin for the incognito tab
stack, even though the stack is empty and we normally wouldn't allow switching
to it.

This CL fixes a regression when performing this sequence of operations that
allows switching back and forth to the empty tab stack. The regression was
introduced in https://chromium-review.googlesource.com/c/chromium/src/+/933061.
This CL does not fix the margin issue, which would be more involved to debug.

Bug: 820902
Change-Id: I7255f430637d7f13d2dd63ce42f2e147f6a51e9c
Reviewed-on: https://chromium-review.googlesource.com/959569
Commit-Queue: Ryan Landay <rlanday@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543466}
parent c7083daf
......@@ -228,6 +228,7 @@ public abstract class StackLayoutBase extends Layout implements Animatable<Stack
} else {
final int newStackIndex = getTabStackIndex() + stackIndexDeltaAt;
if (newStackIndex < 0 || newStackIndex >= mStacks.size()) return;
if (!mStacks.get(newStackIndex).isDisplayable()) return;
flingStacks(newStackIndex);
}
requestStackUpdate();
......
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