Commit 9139d8e2 authored by Stephane Zermatten's avatar Stephane Zermatten Committed by Commit Bot

Animate close all tab when started while showing a tab.

It is now possible to execute "close_all_tabs" while showing a tab, that
is, while in a layout different from the overview, on a phone, such as
with a tab open. This works, but doesn't look good as there's no
animation registered for this case: the tab just close.

Background: go/chrome-direct-actions

This change proposes switching to the overview layout just before
closing all tab and then switching to the normal close all tab animation
and behavior.

Bug: b/140370009
Change-Id: I92e6c683f3f8212c2e4a77695e7101c5edad407b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1781425
Commit-Queue: Stephane Zermatten <szermatt@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693122}
parent 6740c48c
......@@ -59,6 +59,16 @@ public class LayoutManagerChromePhone extends LayoutManagerChrome {
mSimpleAnimationLayout.setTabModelSelector(selector, content);
}
@Override
public boolean closeAllTabsRequest(boolean incognito) {
if (getActiveLayout() == mStaticLayout && !incognito) {
startShowing(DeviceClassManager.enableAccessibilityLayout() ? mOverviewListLayout
: mOverviewLayout,
/* animate= */ false);
}
return super.closeAllTabsRequest(incognito);
}
@Override
protected LayoutManagerTabModelObserver createTabModelObserver() {
return new LayoutManagerTabModelObserver() {
......
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