@Override
  public void setPanelState(PanelState toState, StateChangeReason reason) {
    // Store the previous state of the panel for when super changes it. 'super' should be the
    // first thing with significant logic that runs in this method which is why
    // onPanelStateChanged is not called here.
    PanelState fromState = getPanelState();
    super.setPanelState(toState, reason);

    mPanelMetrics.onPanelStateChanged(fromState, toState, reason);

    if (toState == PanelState.PEEKED
        && (fromState == PanelState.CLOSED || fromState == PanelState.UNDEFINED)) {
      // If the Peek Promo is visible, it should animate when the SearchBar peeks.
      if (getPeekPromoControl().isVisible()) {
        getPeekPromoControl().animateAppearance();
      }
    }

    if (fromState == PanelState.PEEKED
        && (toState == PanelState.EXPANDED || toState == PanelState.MAXIMIZED)) {
      // After opening the Panel to either expanded or maximized state,
      // the promo should disappear.
      getPeekPromoControl().hide();
    }
  }
  @Override
  public void peekPanel(StateChangeReason reason) {
    // NOTE(pedrosimonetti): exposing superclass method to the interface.
    super.peekPanel(reason);

    if (getPanelState() == PanelState.CLOSED || getPanelState() == PanelState.PEEKED) {
      mHasSearchContentViewBeenTouched = false;
    }
  }
 @Override
 public <T extends Enum<?>> void addToAnimation(
     ChromeAnimation.Animatable<T> object,
     T prop,
     float start,
     float end,
     long duration,
     long startTime) {
   super.addToAnimation(object, prop, start, end, duration, startTime);
 }
  @Override
  public void closePanel(StateChangeReason reason, boolean animate) {
    super.closePanel(reason, animate);

    // If the close action is animated, the Layout will be hidden when
    // the animation is finished, so we should only hide the Layout
    // here when not animating.
    if (!animate && mSearchPanelHost != null) {
      mSearchPanelHost.hideLayout(true);
    }

    mHasSearchContentViewBeenTouched = false;
  }
  @Override
  protected void onAnimationFinished() {
    super.onAnimationFinished();

    if (shouldHideContextualSearchLayout()) {
      if (mSearchPanelHost != null) {
        mSearchPanelHost.hideLayout(false);
      }
    }

    if (mShouldPromoteToTabAfterMaximizing && getPanelState() == PanelState.MAXIMIZED) {
      mShouldPromoteToTabAfterMaximizing = false;
      mManagementDelegate.promoteToTab();
    }
  }
  @Override
  protected void updatePanelForMaximization(float percentage) {
    super.updatePanelForMaximization(percentage);

    getPeekPromoControl().onUpdateFromExpandToMaximize(percentage);
  }
  @Override
  protected void updatePanelForExpansion(float percentage) {
    super.updatePanelForExpansion(percentage);

    getPeekPromoControl().onUpdateFromPeekToExpand(percentage);
  }
  @Override
  protected void updatePanelForCloseOrPeek(float percentage) {
    super.updatePanelForCloseOrPeek(percentage);

    getPeekPromoControl().onUpdateFromCloseToPeek(percentage);
  }
 @Override
 public void updateBasePageSelectionYPx(float y) {
   // NOTE(pedrosimonetti): exposing superclass method to the interface.
   super.updateBasePageSelectionYPx(y);
 }
 @Override
 public void onPromoButtonClick(boolean accepted) {
   super.onPromoButtonClick(accepted);
 }
 @Override
 public void onPromoPreferenceClick() {
   super.onPromoPreferenceClick();
 }