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 e7bc0248909ab15ac931d0a3570c438a1b471d1a..d3c64df590a214aca041556bf403949948384822 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 |
} |
/** |
@@ -227,6 +228,16 @@ 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() { |
+ setIsSearchProviderIconSpriteVisible(true); |
+ animateProperty(Property.SEARCH_PROVIDER_ICON_ANIMATION, 0.f, 1.f, |
+ MAXIMUM_ANIMATION_DURATION_MS); |
+ } |
+ |
+ /** |
* Animates the Panel to its nearest state. |
*/ |
protected void animateToNearestState() { |
@@ -379,6 +390,8 @@ public abstract class ContextualSearchPanelAnimation extends ContextualSearchPan |
setPromoVisibilityForOptInAnimation(value); |
} else if (prop == Property.BOTTOM_BAR_TEXT_VISIBILITY) { |
updateSearchBarTextOpacity(value); |
+ } else if (prop == Property.SEARCH_PROVIDER_ICON_ANIMATION) { |
+ setSearchProviderIconAnimationCompletion(value); |
} |
} |
@@ -426,6 +439,14 @@ public abstract class ContextualSearchPanelAnimation extends ContextualSearchPan |
mIsAnimatingPanelClosing = false; |
} |
+ PanelState state = getPanelState(); |
+ if (mAnimatingState == PanelState.PEEKED |
+ && (state == PanelState.CLOSED || state == PanelState.UNDEFINED)) { |
+ if (shouldAnimateSearchProviderIconSprite()) { |
+ 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 |