Index: ui/compositor/layer_animation_element.cc |
diff --git a/ui/compositor/layer_animation_element.cc b/ui/compositor/layer_animation_element.cc |
index 2b41e84a912d5b84446c486f6cb8162b9cf66fab..ef18104e27ae4bc80c34a4bb04e385bbca57629f 100644 |
--- a/ui/compositor/layer_animation_element.cc |
+++ b/ui/compositor/layer_animation_element.cc |
@@ -405,15 +405,31 @@ LayerAnimationElement::LayerAnimationElement( |
LayerAnimationElement::~LayerAnimationElement() { |
} |
-bool LayerAnimationElement::Progress(double t, |
+bool LayerAnimationElement::Progress(base::TimeDelta elapsed, |
LayerAnimationDelegate* delegate) { |
if (first_frame_) |
OnStart(delegate); |
+ double t = 1.0; |
+ if ((duration_ > base::TimeDelta()) && (elapsed < duration_)) |
+ t = elapsed.InMillisecondsF() / duration_.InMillisecondsF(); |
bool need_draw = OnProgress(Tween::CalculateValue(tween_type_, t), delegate); |
first_frame_ = t == 1.0; |
return need_draw; |
} |
+bool LayerAnimationElement::IsFinished(base::TimeDelta elapsed, |
+ base::TimeDelta* total_duration) { |
+ if (elapsed >= duration_) { |
+ *total_duration = duration_; |
+ return true; |
+ } |
+ return false; |
+} |
+ |
+bool LayerAnimationElement::ProgressToEnd(LayerAnimationDelegate* delegate) { |
+ return Progress(duration_, delegate); |
+} |
+ |
void LayerAnimationElement::GetTargetValue(TargetValue* target) const { |
OnGetTarget(target); |
} |