Index: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java |
index d08874dbf6936e08edc6cdfe4a8ecb26cbb26151..91b53307072d4e5ceb052679374269b6d75cde1e 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java |
@@ -760,6 +760,56 @@ abstract class ContextualSearchPanelBase extends ContextualSearchPanelStateHandl |
} |
// -------------------------------------------------------------------------------------------- |
+ // Search provider icon states |
+ // -------------------------------------------------------------------------------------------- |
+ |
+ private static final int SEARCH_PROVIDER_ICON_LAST_SPRITE_FRAME = 22; |
+ |
+ private boolean mShouldAnimateSearchProviderIcon; |
+ private int mSearchProviderIconSpriteFrame; |
+ |
+ /** |
+ * @return Whether the search provider icon should be animated. |
+ */ |
+ public boolean shouldAnimateSearchProviderIcon() { |
+ return mShouldAnimateSearchProviderIcon; |
+ } |
+ |
+ /** |
+ * @param shouldAnimateSearchProviderIcon Whether the search provider icon should be animated. |
+ */ |
+ public void setShouldAnimateSearchProviderIcon(boolean shouldAnimateSearchProviderIcon) { |
+ if (shouldAnimateSearchProviderIcon) { |
+ mSearchProviderIconSpriteFrame = 0; |
+ } else { |
+ mSearchProviderIconSpriteFrame = SEARCH_PROVIDER_ICON_LAST_SPRITE_FRAME; |
+ } |
+ mShouldAnimateSearchProviderIcon = shouldAnimateSearchProviderIcon; |
+ } |
+ |
+ public float getSearchProviderIconSpriteSize() { |
+ return mContext.getResources().getDimension(R.dimen.contextual_search_sprite_size); |
+ } |
+ |
+ /** |
+ * @return The sprite frame to display in the search provider icon sprite sheet. Sprites are |
+ * numbered starting at 0. |
+ */ |
+ public int getSearchProviderIconSpriteFrame() { |
+ return mSearchProviderIconSpriteFrame; |
+ } |
+ |
+ /** |
+ * Sets the sprite frame to display based on the completion percentage. |
+ * |
+ * @param percentage The completion percentage. |
+ */ |
+ public void setSearchProviderIconAnimationCompletion(float percentage) { |
+ mSearchProviderIconSpriteFrame = |
+ (int) (percentage * SEARCH_PROVIDER_ICON_LAST_SPRITE_FRAME); |
+ } |
+ |
+ // -------------------------------------------------------------------------------------------- |
// Promo states |
// -------------------------------------------------------------------------------------------- |