Chromium Code Reviews| Index: ui/views/animation/ink_drop_animation.h |
| diff --git a/ui/views/animation/ink_drop_animation.h b/ui/views/animation/ink_drop_animation.h |
| index dd63bb36a9fb7ea06c4cbc3ccf34a2ead15367aa..9e9ff44553e0d682df495acd23593e6b581001bf 100644 |
| --- a/ui/views/animation/ink_drop_animation.h |
| +++ b/ui/views/animation/ink_drop_animation.h |
| @@ -7,6 +7,7 @@ |
| #include "base/macros.h" |
| #include "base/memory/scoped_ptr.h" |
| +#include "base/observer_list.h" |
| #include "base/time/time.h" |
| #include "ui/compositor/layer_animator.h" |
| #include "ui/gfx/geometry/size.h" |
| @@ -16,12 +17,15 @@ |
| #include "ui/views/views_export.h" |
| namespace ui { |
| +class CallbackLayerAnimationObserver; |
| class Layer; |
| +class LayerAnimationObserver; |
| class LayerDelegate; |
| } // namespace ui |
| namespace views { |
| class CircleLayerDelegate; |
| +class InkDropAnimationObserver; |
| class RectangleLayerDelegate; |
| namespace test { |
| @@ -48,6 +52,10 @@ class VIEWS_EXPORT InkDropAnimation { |
| InkDropState ink_drop_state() const { return ink_drop_state_; } |
| + void AddObserver(InkDropAnimationObserver* observer); |
| + |
| + void RemoveObserver(InkDropAnimationObserver* observer); |
|
sadrul
2015/10/08 01:06:01
- the newline
bruthig
2015/10/08 21:42:55
Done.
|
| + |
| // Animates from the current |ink_drop_state_| to a new |ink_drop_state|. It |
| // is possible to animate from any |ink_drop_state_| to any new |
| // |ink_drop_state|. Note that some state transitions will also perform an |
| @@ -77,16 +85,24 @@ class VIEWS_EXPORT InkDropAnimation { |
| // ink drop. |
| typedef gfx::Transform InkDropTransforms[PAINTED_SHAPE_COUNT]; |
| + // Animates the ripple to |ink_drop_state| and attaches |observer| to all |
| + // LayerAnimationSequence's used. |
| + void AnimateToStateInternal(InkDropState ink_drop_state, |
| + ui::LayerAnimationObserver* observer); |
| + |
| // Animates all of the painted shape layers to the specified |transforms| and |
| - // |opacity|. |
| + // |opacity|. The animation will use the given |duration| and |
| + // |preemption_strategy|, and |observer| will be added to all |
| + // LayerAnimationSequences. |
| void AnimateToTransforms( |
| const InkDropTransforms transforms, |
| float opacity, |
| base::TimeDelta duration, |
| - ui::LayerAnimator::PreemptionStrategy preemption_strategy); |
| + ui::LayerAnimator::PreemptionStrategy preemption_strategy, |
| + ui::LayerAnimationObserver* observer); |
| - // Resets the Transforms on all the owned Layers to a minimum size. |
| - void ResetTransformsToMinSize(); |
| + // Updates the Transforms and opacity to the HIDDEN state. |
| + void SetStateToHidden(); |
| // Sets the |transforms| on all of the shape layers. Note that this does not |
| // perform any animation. |
| @@ -113,6 +129,20 @@ class VIEWS_EXPORT InkDropAnimation { |
| // Adds and configures a new |painted_shape| layer to |painted_layers_|. |
| void AddPaintLayer(PaintedShape painted_shape); |
| + void AbortAllAnimations(); |
| + |
| + // The Callback invoked when all of the animation sequences for the specific |
| + // |ink_drop_state| animation have started. |
|
varkha
2015/10/06 20:58:38
Can you document |observer|?
bruthig
2015/10/08 21:42:55
Done.
|
| + void AnimationStartedCallback( |
| + InkDropState ink_drop_state, |
| + const ui::CallbackLayerAnimationObserver& observer); |
| + |
| + // The Callback invoked when all of the animation sequences for the specific |
| + // |ink_drop_state| animation have finished. |
| + bool AnimationEndedCallback( |
| + InkDropState ink_drop_state, |
| + const ui::CallbackLayerAnimationObserver& observer); |
| + |
| // Maximum size that an ink drop will be drawn to for any InkDropState whose |
| // final frame should be large. |
| gfx::Size large_size_; |
| @@ -146,6 +176,9 @@ class VIEWS_EXPORT InkDropAnimation { |
| // The current ink drop state. |
| InkDropState ink_drop_state_; |
| + // List of observers to notify when animations have finished. |
| + base::ObserverList<InkDropAnimationObserver> observers_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(InkDropAnimation); |
| }; |