Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1061)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelAnimation.java

Issue 1133403004: Revert of [Contextual Search] Remove opt-in code. (patchset #6 id:100001 of https://codereview.chro… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2403
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 27fb02d8864b9f823a7964aba13be9018a8ae2b3..9172d758c9faa873e7f6497ef46d7d823e7bcec4 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
@@ -28,7 +28,8 @@ abstract class ContextualSearchPanelAnimation extends ContextualSearchPanelBase
*/
protected enum Property {
PANEL_HEIGHT,
- PROMO_VISIBILITY
+ PROMO_VISIBILITY,
+ FIRST_RUN_PANEL_HEIGHT,
}
/**
@@ -109,7 +110,7 @@ abstract class ContextualSearchPanelAnimation extends ContextualSearchPanelBase
* @param reason The reason for the change of panel state.
*/
protected void expandPanel(StateChangeReason reason) {
- animatePanelToState(PanelState.EXPANDED, reason);
+ animatePanelToState(getIntermediaryState(), reason);
}
/**
@@ -193,6 +194,19 @@ abstract class ContextualSearchPanelAnimation extends ContextualSearchPanelBase
}
/**
+ * Animates the Contextual Search panel after first-run success.
+ */
+ protected void animateAfterFirstRunSuccess() {
+ final PanelState desiredState = PanelState.EXPANDED;
+ mAnimatingState = desiredState;
+ mAnimatingStateReason = StateChangeReason.OPTIN;
+
+ final float desiredHeight = getPanelHeightFromState(desiredState);
+ animateProperty(Property.FIRST_RUN_PANEL_HEIGHT, getHeight(), desiredHeight,
+ BASE_ANIMATION_DURATION_MS);
+ }
+
+ /**
* Animates the Panel to its nearest state.
*/
protected void animateToNearestState() {
@@ -225,7 +239,7 @@ abstract class ContextualSearchPanelAnimation extends ContextualSearchPanelBase
// the EXPANDED state is the only one that will show the Promo.
if (projectedState == PanelState.MAXIMIZED
&& getPanelState() == PanelState.PEEKED
- && isPromoAvailable()) {
+ && isPanelPromoAvailable()) {
projectedState = PanelState.EXPANDED;
}
@@ -341,6 +355,8 @@ abstract class ContextualSearchPanelAnimation extends ContextualSearchPanelBase
setPanelHeight(value);
} else if (prop == Property.PROMO_VISIBILITY) {
setPromoVisibilityForOptInAnimation(value);
+ } else if (prop == Property.FIRST_RUN_PANEL_HEIGHT) {
+ setPanelHeightForPromoOptInAnimation(value);
}
}

Powered by Google App Engine
This is Rietveld 408576698