Revert "Move assistant icon animation to CompositorAnimationOberver"

This reverts commit 33fc6c64a3b5af5627b7e28874f4583793e74da8.

Reason for revert: One or the other of this CL and https://crrev.com/c/748268 (perhaps both in combination?) broke PaletteTrayTestWithVoiceInteraction.StylusBarrelButtonActivatesHighlighter on Linux ChromiumOS Tests (dbg)(1):

https://uberchromegw.corp.google.com/i/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%281%29/builds/31692

The connection to these voice interaction Cls seems pretty clear. I can't identify which one it is, though, so while I apologize for the trouble, I'm going to revert both to ensure that the bot turns green again.

Original change's description:
> Move assistant icon animation to CompositorAnimationOberver
> 
> BUG=None
> TEST=locally build and see animation running as before.
> 
> Change-Id: I1eb62490108beaaec0795adb4251054c03b364e1
> Reviewed-on: https://chromium-review.googlesource.com/748273
> Commit-Queue: Xiaohui Chen <xiaohuic@chromium.org>
> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#513211}

TBR=xiyuan@chromium.org,xiaohuic@chromium.org

Change-Id: I5ef677c189808601f8e357f56a171bf920b10fa0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://chromium-review.googlesource.com/749851
Reviewed-by: Justin Donnelly <jdonnelly@chromium.org>
Commit-Queue: Justin Donnelly <jdonnelly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513272}
void VoiceInteractionOverlay::WaitingAnimation() {
  if (IsBursting())
    return;

  animation_state_ = AnimationState::WAITING;

  gfx::Point center = host_view_->GetAppListButtonCenterPoint();
  gfx::Transform transform;

  ripple_layer_->SetOpacity(0);
  icon_layer_->SetOpacity(0);
  background_layer_->SetOpacity(0);
  SetVisible(true);

  {
    transform.Translate(kBackgroundLargeWidthDip / 2 + kBackgroundPaddingDip -
                            kIconEndSizeDip / 2,
                        -kBackgroundLargeHeightDip / 2 - kBackgroundPaddingDip -
                            kIconEndSizeDip / 2);
    SkMScalar scale_factor = kIconEndSizeDip / kIconInitSizeDip;
    transform.Scale(scale_factor, scale_factor);
    icon_layer_->SetTransform(transform);

    ui::ScopedLayerAnimationSettings settings(icon_layer_->GetAnimator());
    settings.SetTransitionDuration(
        base::TimeDelta::FromMilliseconds(kBackgroundMorphDurationMs));
    settings.SetPreemptionStrategy(
        ui::LayerAnimator::PreemptionStrategy::ENQUEUE_NEW_ANIMATION);
    settings.SetTweenType(gfx::Tween::LINEAR_OUT_SLOW_IN);

    icon_layer_->SetOpacity(1);
    icon_layer_->StartAnimation();
  }

  {
    float x_offset = center.x() - kBackgroundSizeDip / 2;
    float y_offset = center.y() - kBackgroundSizeDip / 2;

    transform.MakeIdentity();
    background_layer_->SetTransform(transform);
    background_layer_->SetToLarge(gfx::PointF(
        kBackgroundLargeWidthDip / 2 + kBackgroundPaddingDip - x_offset,
        -kBackgroundLargeHeightDip / 2 - kBackgroundPaddingDip - y_offset));

    ui::ScopedLayerAnimationSettings settings(background_layer_->GetAnimator());
    settings.SetTransitionDuration(
        base::TimeDelta::FromMilliseconds(kBackgroundMorphDurationMs));
    settings.SetPreemptionStrategy(
        ui::LayerAnimator::PreemptionStrategy::ENQUEUE_NEW_ANIMATION);
    settings.SetTweenType(gfx::Tween::LINEAR_OUT_SLOW_IN);

    background_layer_->SetOpacity(1);
  }
}

void VoiceInteractionOverlay::WaitingAnimation() {
  if (IsBursting())
    return;

  animation_state_ = AnimationState::WAITING;

  gfx::Point center = host_view_->GetAppListButtonCenterPoint();
  gfx::Transform transform;

  ripple_layer_->SetOpacity(0);
  icon_layer_->SetOpacity(0);
  background_layer_->SetOpacity(0);
  SetVisible(true);

  {
    transform.Translate(kBackgroundLargeWidthDip / 2 + kBackgroundPaddingDip -
                            kIconEndSizeDip / 2,
                        -kBackgroundLargeHeightDip / 2 - kBackgroundPaddingDip -
                            kIconEndSizeDip / 2);
    SkMScalar scale_factor = kIconEndSizeDip / kIconInitSizeDip;
    transform.Scale(scale_factor, scale_factor);
    icon_layer_->SetTransform(transform);

    ui::ScopedLayerAnimationSettings settings(icon_layer_->GetAnimator());
    settings.SetTransitionDuration(
        base::TimeDelta::FromMilliseconds(kBackgroundMorphDurationMs));
    settings.SetPreemptionStrategy(
        ui::LayerAnimator::PreemptionStrategy::ENQUEUE_NEW_ANIMATION);
    settings.SetTweenType(gfx::Tween::LINEAR_OUT_SLOW_IN);

    icon_layer_->SetOpacity(1);
    icon_layer_->StartAnimation();
  }

  {
    float x_offset = center.x() - kBackgroundSizeDip / 2;
    float y_offset = center.y() - kBackgroundSizeDip / 2;

    transform.MakeIdentity();
    background_layer_->SetTransform(transform);
    background_layer_->SetToLarge(gfx::PointF(
        kBackgroundLargeWidthDip / 2 + kBackgroundPaddingDip - x_offset,
        -kBackgroundLargeHeightDip / 2 - kBackgroundPaddingDip - y_offset));

    ui::ScopedLayerAnimationSettings settings(background_layer_->GetAnimator());
    settings.SetTransitionDuration(
        base::TimeDelta::FromMilliseconds(kBackgroundMorphDurationMs));
    settings.SetPreemptionStrategy(
        ui::LayerAnimator::PreemptionStrategy::ENQUEUE_NEW_ANIMATION);
    settings.SetTweenType(gfx::Tween::LINEAR_OUT_SLOW_IN);

    background_layer_->SetOpacity(1);
  }
}
