| Index: ui/gfx/compositor/layer_animator.cc
|
| diff --git a/ui/gfx/compositor/layer_animator.cc b/ui/gfx/compositor/layer_animator.cc
|
| index e737377c86c600ca0674470eba190fc75b18ee7f..7bb84c965dd5e1b155d39c3bc27de91398e44b8d 100644
|
| --- a/ui/gfx/compositor/layer_animator.cc
|
| +++ b/ui/gfx/compositor/layer_animator.cc
|
| @@ -9,6 +9,7 @@
|
| #include "base/memory/scoped_ptr.h"
|
| #include "ui/base/animation/animation_container.h"
|
| #include "ui/gfx/compositor/compositor.h"
|
| +#include "ui/gfx/compositor/dummy_layer_animation_delegate.h"
|
| #include "ui/gfx/compositor/layer.h"
|
| #include "ui/gfx/compositor/layer_animation_delegate.h"
|
| #include "ui/gfx/compositor/layer_animation_sequence.h"
|
| @@ -60,6 +61,12 @@ void LayerAnimator::SetTransform(const Transform& transform) {
|
| transition_duration_)));
|
| }
|
|
|
| +Transform LayerAnimator::GetTargetTransform() const {
|
| + DummyLayerAnimationDelegate dummy(*delegate_);
|
| + SetTarget(&dummy);
|
| + return dummy.GetTransformForAnimation();
|
| +}
|
| +
|
| void LayerAnimator::SetBounds(const gfx::Rect& bounds) {
|
| if (transition_duration_ == base::TimeDelta())
|
| delegate_->SetBoundsFromAnimation(bounds);
|
| @@ -69,6 +76,12 @@ void LayerAnimator::SetBounds(const gfx::Rect& bounds) {
|
| transition_duration_)));
|
| }
|
|
|
| +gfx::Rect LayerAnimator::GetTargetBounds() const {
|
| + DummyLayerAnimationDelegate dummy(*delegate_);
|
| + SetTarget(&dummy);
|
| + return dummy.GetBoundsForAnimation();
|
| +}
|
| +
|
| void LayerAnimator::SetOpacity(float opacity) {
|
| if (transition_duration_ == base::TimeDelta())
|
| delegate_->SetOpacityFromAnimation(opacity);
|
| @@ -78,6 +91,12 @@ void LayerAnimator::SetOpacity(float opacity) {
|
| transition_duration_)));
|
| }
|
|
|
| +float LayerAnimator::GetTargetOpacity() const {
|
| + DummyLayerAnimationDelegate dummy(*delegate_);
|
| + SetTarget(&dummy);
|
| + return dummy.GetOpacityForAnimation();
|
| +}
|
| +
|
| void LayerAnimator::SetDelegate(LayerAnimationDelegate* delegate) {
|
| DCHECK(delegate);
|
| delegate_ = delegate;
|
| @@ -440,4 +459,16 @@ bool LayerAnimator::StartSequenceImmediately(LayerAnimationSequence* sequence) {
|
| return true;
|
| }
|
|
|
| +void LayerAnimator::SetTarget(LayerAnimationDelegate* delegate) const {
|
| + for (RunningAnimations::const_iterator iter = running_animations_.begin();
|
| + iter != running_animations_.end(); ++iter) {
|
| + (*iter).sequence->SetTarget(delegate);
|
| + }
|
| +
|
| + for (AnimationQueue::const_iterator iter = animation_queue_.begin();
|
| + iter != animation_queue_.end(); ++iter) {
|
| + (*iter)->SetTarget(delegate);
|
| + }
|
| +}
|
| +
|
| } // namespace ui
|
|
|