Commit 9671ef02 authored by Ryan Landay's avatar Ryan Landay Committed by Commit Bot

Fix crash toggling incognito in Android horizontal tab switcher while scrolling

In https://chromium-review.googlesource.com/c/1096489/, I added this line to
NonOverlappingStack#runSwitchAwayAnimation() to fix another bug (tabs getting
stuck in a partially-discarded state):

startAnimation(0, OverviewAnimationType.UNDISCARD);

It turns out that if this is called while the tabs are scrolling, StackScroller
subtracts the scroller start time from 0 and ends up looking up a negative value
in the SPLINE_POSITION array.

This CL fixes this crash by passing the correct time here.

Bug: 852995,831359
Change-Id: I0186cb9180ef4fff84bf1440acdfd87bc63c47f2
Reviewed-on: https://chromium-review.googlesource.com/1101906Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Ryan Landay <rlanday@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567464}
parent 7c51db1f
......@@ -12,6 +12,7 @@ import android.support.annotation.IntDef;
import org.chromium.chrome.browser.compositor.animation.CompositorAnimationHandler;
import org.chromium.chrome.browser.compositor.animation.CompositorAnimator;
import org.chromium.chrome.browser.compositor.layouts.LayoutManager;
import org.chromium.chrome.browser.compositor.layouts.components.LayoutTab;
import org.chromium.chrome.browser.compositor.layouts.phone.StackLayoutBase;
import org.chromium.chrome.browser.compositor.layouts.phone.stack.StackAnimation.OverviewAnimationType;
......@@ -342,7 +343,7 @@ public class NonOverlappingStack extends Stack {
// Make sure we don't leave any tabs stuck in a partially-discarded
// state.
startAnimation(0, OverviewAnimationType.UNDISCARD);
startAnimation(LayoutManager.time(), OverviewAnimationType.UNDISCARD);
mDiscardingTab = null;
mSwitchedAway = true;
......
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