Commit f3b96a7b authored by tedchoc's avatar tedchoc Committed by Commit bot

Disable swipe down to enter the tab switcher in Chrome Home.

BUG=

Review-Url: https://codereview.chromium.org/2755823004
Cr-Commit-Position: refs/heads/master@{#457836}
parent 9003b88c
......@@ -179,7 +179,7 @@ public class LayoutManagerChrome
mOverviewModeObservers = new ObserverList<OverviewModeObserver>();
// Build Event Filter Handlers
mToolbarSwipeHandler = new ToolbarSwipeHandler(this);
mToolbarSwipeHandler = createToolbarSwipeHandler(this);
// Build Event Filters
mBlackHoleEventFilter = new BlackHoleEventFilter(context, this);
......@@ -685,11 +685,13 @@ public class LayoutManagerChrome
return false;
}
boolean isAccessibility =
DeviceClassManager.isAccessibilityModeEnabled(mHost.getContext());
return direction == ScrollDirection.LEFT || direction == ScrollDirection.RIGHT
|| (direction == ScrollDirection.DOWN && mOverviewLayout != null
&& !isAccessibility);
if (direction == ScrollDirection.DOWN) {
boolean isAccessibility =
DeviceClassManager.isAccessibilityModeEnabled(mHost.getContext());
return mOverviewLayout != null && !isAccessibility;
}
return direction == ScrollDirection.LEFT || direction == ScrollDirection.RIGHT;
}
}
......
......@@ -8,6 +8,7 @@ import android.content.Context;
import android.view.ViewGroup;
import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager;
import org.chromium.chrome.browser.compositor.layouts.eventfilter.EdgeSwipeEventFilter.ScrollDirection;
import org.chromium.chrome.browser.compositor.layouts.phone.SimpleAnimationLayout;
import org.chromium.chrome.browser.compositor.overlays.SceneOverlay;
import org.chromium.chrome.browser.contextualsearch.ContextualSearchManagementDelegate;
......@@ -17,6 +18,7 @@ import org.chromium.chrome.browser.tabmodel.TabCreatorManager;
import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.tabmodel.TabModelUtils;
import org.chromium.chrome.browser.util.FeatureUtilities;
import org.chromium.ui.resources.dynamics.DynamicResourceLoader;
/**
......@@ -47,6 +49,11 @@ public class LayoutManagerChromePhone extends LayoutManagerChrome {
mToolbarSwipeLayout.setMovesToolbar(true);
}
@Override
protected ToolbarSwipeHandler createToolbarSwipeHandler(LayoutProvider provider) {
return new PhoneToolbarSwipeHandler(provider);
}
@Override
public void init(TabModelSelector selector, TabCreatorManager creator,
TabContentManager content, ViewGroup androidContentContainer,
......@@ -150,4 +157,19 @@ public class LayoutManagerChromePhone extends LayoutManagerChrome {
mTitleCache.remove(id);
super.releaseTabLayout(id);
}
private class PhoneToolbarSwipeHandler extends ToolbarSwipeHandler {
public PhoneToolbarSwipeHandler(LayoutProvider provider) {
super(provider);
}
@Override
public boolean isSwipeEnabled(ScrollDirection direction) {
if (direction == ScrollDirection.DOWN && FeatureUtilities.isChromeHomeEnabled()) {
return false;
}
return super.isSwipeEnabled(direction);
}
}
}
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