| Index: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelAnimation.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelAnimation.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelAnimation.java
|
| index c1ef52d91809d5eb5b8ea7c57dcc7348a6b33014..a3d34323e25c7d0cda7bce61d25056069d7aafdb 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelAnimation.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelAnimation.java
|
| @@ -29,7 +29,8 @@ public abstract class ContextualSearchPanelAnimation extends ContextualSearchPan
|
| protected enum Property {
|
| PANEL_HEIGHT,
|
| PROMO_VISIBILITY,
|
| - BOTTOM_BAR_TEXT_VISIBILITY
|
| + BOTTOM_BAR_TEXT_VISIBILITY,
|
| + SEARCH_PROVIDER_ICON_ANIMATION
|
| }
|
|
|
| /**
|
| @@ -79,6 +80,11 @@ public abstract class ContextualSearchPanelAnimation extends ContextualSearchPan
|
| private final LayoutUpdateHost mUpdateHost;
|
|
|
| /**
|
| + * Whether the panel's open animation is running.
|
| + */
|
| + private boolean mIsAnimatingPanelOpen;
|
| +
|
| + /**
|
| * Whether the panel's close animation is running.
|
| */
|
| private boolean mIsAnimatingPanelClosing;
|
| @@ -124,6 +130,7 @@ public abstract class ContextualSearchPanelAnimation extends ContextualSearchPan
|
| * @param reason The reason for the change of panel state.
|
| */
|
| protected void peekPanel(StateChangeReason reason) {
|
| + mIsAnimatingPanelOpen = true;
|
| // Indicate to the Compositor that for now on the Panel should be
|
| // rendered, until it's closed.
|
| startShowing();
|
| @@ -215,6 +222,15 @@ public abstract class ContextualSearchPanelAnimation extends ContextualSearchPan
|
| }
|
|
|
| /**
|
| + * Animates the search provider icon. This should only be called once the panel open
|
| + * animation has finished.
|
| + */
|
| + private void animateSearchProviderIcon() {
|
| + // TODO(twellington): tweak the duration once we have the final sprite sheets.
|
| + animateProperty(Property.SEARCH_PROVIDER_ICON_ANIMATION, 0.f, 1.f, 400);
|
| + }
|
| +
|
| + /**
|
| * Animates the Panel to its nearest state.
|
| */
|
| protected void animateToNearestState() {
|
| @@ -367,6 +383,8 @@ public abstract class ContextualSearchPanelAnimation extends ContextualSearchPan
|
| setPromoVisibilityForOptInAnimation(value);
|
| } else if (prop == Property.BOTTOM_BAR_TEXT_VISIBILITY) {
|
| updateBottomBarTextVisibility(value);
|
| + } else if (prop == Property.SEARCH_PROVIDER_ICON_ANIMATION) {
|
| + setSearchProviderIconAnimationCompletion(value);
|
| }
|
| }
|
|
|
| @@ -414,6 +432,13 @@ public abstract class ContextualSearchPanelAnimation extends ContextualSearchPan
|
| mIsAnimatingPanelClosing = false;
|
| }
|
|
|
| + if (mIsAnimatingPanelOpen) {
|
| + mIsAnimatingPanelOpen = false;
|
| + if (shouldAnimateSearchProviderIcon()) {
|
| + animateSearchProviderIcon();
|
| + }
|
| + }
|
| +
|
| // If animating to a particular PanelState, and after completing
|
| // resizing the Panel to its desired state, then the Panel's state
|
| // should be updated. This method also is called when an animation
|
|
|