| Index: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
|
| index 49cb6d2279f9b15612cb36e1f5b40fb624d42f23..161d8c11d7a6442f8872bf506080010fbd3c6838 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
|
| @@ -74,11 +74,6 @@ public class ContextualSearchPanel extends OverlayPanel {
|
| */
|
| private ContextualSearchSceneLayer mSceneLayer;
|
|
|
| - /**
|
| - * The velocity of the swipe gesture being handled.
|
| - */
|
| - private float mCurrentSwipeVelocity;
|
| -
|
| // ============================================================================================
|
| // Constructor
|
| // ============================================================================================
|
| @@ -224,19 +219,10 @@ public class ContextualSearchPanel extends OverlayPanel {
|
|
|
| @Override
|
| protected boolean isSupportedState(PanelState state) {
|
| - if (mCurrentSwipeVelocity > 0 && state == PanelState.EXPANDED) return false;
|
| -
|
| return canDisplayContentInPanel() || state != PanelState.MAXIMIZED;
|
| }
|
|
|
| @Override
|
| - protected float getThresholdToNextState() {
|
| - if (mCurrentSwipeVelocity > 0) return 0.30f;
|
| -
|
| - return super.getThresholdToNextState();
|
| - }
|
| -
|
| - @Override
|
| protected float getExpandedHeight() {
|
| if (canDisplayContentInPanel()) {
|
| return super.getExpandedHeight();
|
| @@ -247,7 +233,6 @@ public class ContextualSearchPanel extends OverlayPanel {
|
|
|
| @Override
|
| protected PanelState getProjectedState(float velocity) {
|
| - mCurrentSwipeVelocity = velocity;
|
| PanelState projectedState = super.getProjectedState(velocity);
|
|
|
| // Prevent the fling gesture from moving the Panel from PEEKED to MAXIMIZED. This is to
|
| @@ -259,6 +244,12 @@ public class ContextualSearchPanel extends OverlayPanel {
|
| projectedState = PanelState.EXPANDED;
|
| }
|
|
|
| + // If we're swiping the panel down from MAXIMIZED skip the EXPANDED state and go all the
|
| + // way to PEEKED.
|
| + if (getPanelState() == PanelState.MAXIMIZED && projectedState == PanelState.EXPANDED) {
|
| + projectedState = PanelState.PEEKED;
|
| + }
|
| +
|
| return projectedState;
|
| }
|
|
|
|
|