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