| Index: ui/gfx/compositor/layer.cc
 | 
| diff --git a/ui/gfx/compositor/layer.cc b/ui/gfx/compositor/layer.cc
 | 
| index a075137abeb62211f70f3731a316d8815bd33adb..e9a9ed578dfdfde1fab4b94b0af6d50f9d396cec 100644
 | 
| --- a/ui/gfx/compositor/layer.cc
 | 
| +++ b/ui/gfx/compositor/layer.cc
 | 
| @@ -18,7 +18,7 @@
 | 
|  #include "ui/gfx/compositor/compositor_cc.h"
 | 
|  #endif
 | 
|  #include "ui/gfx/canvas_skia.h"
 | 
| -#include "ui/gfx/compositor/layer_animation_manager.h"
 | 
| +#include "ui/gfx/compositor/layer_animator.h"
 | 
|  #include "ui/gfx/interpolated_transform.h"
 | 
|  #include "ui/gfx/point3.h"
 | 
|  
 | 
| @@ -135,49 +135,46 @@ bool Layer::Contains(const Layer* other) const {
 | 
|    return false;
 | 
|  }
 | 
|  
 | 
| -void Layer::SetAnimation(Animation* animation) {
 | 
| -  if (animation) {
 | 
| -    if (!animator_.get())
 | 
| -      animator_.reset(new LayerAnimationManager(this));
 | 
| -    animation->Start();
 | 
| -    animator_->SetAnimation(animation);
 | 
| -  } else {
 | 
| -    animator_.reset();
 | 
| -  }
 | 
| +void Layer::SetAnimator(LayerAnimator* animator) {
 | 
| +  if (animator)
 | 
| +    animator->SetDelegate(this);
 | 
| +  animator_.reset(animator);
 | 
| +}
 | 
| +
 | 
| +LayerAnimator* Layer::GetAnimator() {
 | 
| +  if (!animator_.get())
 | 
| +    SetAnimator(LayerAnimator::CreateDefaultAnimator());
 | 
| +  return animator_.get();
 | 
|  }
 | 
|  
 | 
|  void Layer::SetTransform(const ui::Transform& transform) {
 | 
| -  StopAnimatingIfNecessary(LayerAnimationManager::TRANSFORM);
 | 
| -  if (animator_.get() && animator_->IsRunning()) {
 | 
| -    animator_->AnimateTransform(transform);
 | 
| -    return;
 | 
| -  }
 | 
| -  SetTransformImmediately(transform);
 | 
| +  GetAnimator()->SetTransform(transform);
 | 
| +}
 | 
| +
 | 
| +Transform Layer::GetTargetTransform() const {
 | 
| +  if (animator_.get() && animator_->is_animating())
 | 
| +    return animator_->GetTargetTransform();
 | 
| +  return transform_;
 | 
|  }
 | 
|  
 | 
|  void Layer::SetBounds(const gfx::Rect& bounds) {
 | 
| -  StopAnimatingIfNecessary(LayerAnimationManager::LOCATION);
 | 
| -  if (animator_.get() && animator_->IsRunning() &&
 | 
| -      bounds.size() == bounds_.size()) {
 | 
| -    animator_->AnimateToPoint(bounds.origin());
 | 
| -    return;
 | 
| -  }
 | 
| -  SetBoundsImmediately(bounds);
 | 
| +  GetAnimator()->SetBounds(bounds);
 | 
|  }
 | 
|  
 | 
|  gfx::Rect Layer::GetTargetBounds() const {
 | 
| -  if (animator_.get() && animator_->IsRunning())
 | 
| -    return gfx::Rect(animator_->GetTargetPoint(), bounds_.size());
 | 
| +  if (animator_.get() && animator_->is_animating())
 | 
| +    return animator_->GetTargetBounds();
 | 
|    return bounds_;
 | 
|  }
 | 
|  
 | 
|  void Layer::SetOpacity(float opacity) {
 | 
| -  StopAnimatingIfNecessary(LayerAnimationManager::OPACITY);
 | 
| -  if (animator_.get() && animator_->IsRunning()) {
 | 
| -    animator_->AnimateOpacity(opacity);
 | 
| -    return;
 | 
| -  }
 | 
| -  SetOpacityImmediately(opacity);
 | 
| +  GetAnimator()->SetOpacity(opacity);
 | 
| +}
 | 
| +
 | 
| +float Layer::GetTargetOpacity() const {
 | 
| +  if (animator_.get() && animator_->is_animating())
 | 
| +    return animator_->GetTargetOpacity();
 | 
| +  return opacity_;
 | 
|  }
 | 
|  
 | 
|  void Layer::SetVisible(bool visible) {
 | 
| @@ -596,29 +593,6 @@ bool Layer::GetTransformRelativeTo(const Layer* ancestor,
 | 
|    return p == ancestor;
 | 
|  }
 | 
|  
 | 
| -void Layer::StopAnimatingIfNecessary(
 | 
| -    LayerAnimationManager::AnimationProperty property) {
 | 
| -  if (!animator_.get() || !animator_->IsRunning() ||
 | 
| -      !animator_->got_initial_tick()) {
 | 
| -    return;
 | 
| -  }
 | 
| -
 | 
| -  if (property != LayerAnimationManager::LOCATION &&
 | 
| -      animator_->IsAnimating(LayerAnimationManager::LOCATION)) {
 | 
| -    SetBoundsImmediately(
 | 
| -        gfx::Rect(animator_->GetTargetPoint(), bounds_.size()));
 | 
| -  }
 | 
| -  if (property != LayerAnimationManager::OPACITY &&
 | 
| -      animator_->IsAnimating(LayerAnimationManager::OPACITY)) {
 | 
| -    SetOpacityImmediately(animator_->GetTargetOpacity());
 | 
| -  }
 | 
| -  if (property != LayerAnimationManager::TRANSFORM &&
 | 
| -      animator_->IsAnimating(LayerAnimationManager::TRANSFORM)) {
 | 
| -    SetTransformImmediately(animator_->GetTargetTransform());
 | 
| -  }
 | 
| -  animator_.reset();
 | 
| -}
 | 
| -
 | 
|  void Layer::SetBoundsImmediately(const gfx::Rect& bounds) {
 | 
|    bounds_ = bounds;
 | 
|  
 | 
| @@ -648,18 +622,39 @@ void Layer::SetOpacityImmediately(float opacity) {
 | 
|  #endif
 | 
|  }
 | 
|  
 | 
| -void Layer::SetBoundsFromAnimator(const gfx::Rect& bounds) {
 | 
| +void Layer::SetBoundsFromAnimation(const gfx::Rect& bounds) {
 | 
|    SetBoundsImmediately(bounds);
 | 
|  }
 | 
|  
 | 
| -void Layer::SetTransformFromAnimator(const Transform& transform) {
 | 
| +void Layer::SetTransformFromAnimation(const Transform& transform) {
 | 
|    SetTransformImmediately(transform);
 | 
|  }
 | 
|  
 | 
| -void Layer::SetOpacityFromAnimator(float opacity) {
 | 
| +void Layer::SetOpacityFromAnimation(float opacity) {
 | 
|    SetOpacityImmediately(opacity);
 | 
|  }
 | 
|  
 | 
| +void Layer::ScheduleDrawForAnimation() {
 | 
| +  ScheduleDraw();
 | 
| +}
 | 
| +
 | 
| +const gfx::Rect& Layer::GetBoundsForAnimation() const {
 | 
| +  return bounds();
 | 
| +}
 | 
| +
 | 
| +const Transform& Layer::GetTransformForAnimation() const {
 | 
| +  return transform();
 | 
| +}
 | 
| +
 | 
| +float Layer::GetOpacityForAnimation() const {
 | 
| +  return opacity();
 | 
| +}
 | 
| +
 | 
| +void Layer::OnLayerAnimationEnded(LayerAnimationSequence* sequence) {
 | 
| +  if (delegate_)
 | 
| +    delegate_->OnLayerAnimationEnded(sequence);
 | 
| +}
 | 
| +
 | 
|  #if defined(USE_WEBKIT_COMPOSITOR)
 | 
|  void Layer::CreateWebLayer() {
 | 
|    web_layer_ = WebKit::WebContentLayer::create(this, this);
 | 
| 
 |