| 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 9c50f3a47d98d9d734fe9f07b4e6b17cf1e30d14..38a50df03395a0c0117e442a3fd0bc4fade08da0 100644 | 
| --- a/ui/views/animation/ink_drop_animation.h | 
| +++ b/ui/views/animation/ink_drop_animation.h | 
| @@ -8,90 +8,130 @@ | 
| #include "base/macros.h" | 
| #include "base/memory/scoped_ptr.h" | 
| #include "base/time/time.h" | 
| -#include "ui/gfx/geometry/rect.h" | 
| +#include "ui/compositor/layer_animator.h" | 
| +#include "ui/gfx/geometry/size.h" | 
| +#include "ui/gfx/geometry/size_f.h" | 
| +#include "ui/gfx/transform.h" | 
| #include "ui/views/animation/ink_drop_state.h" | 
| #include "ui/views/views_export.h" | 
|  | 
| namespace ui { | 
| class Layer; | 
| +class LayerDelegate; | 
| }  // namespace ui | 
|  | 
| namespace views { | 
| -class AppearAnimationObserver; | 
| -class InkDropDelegate; | 
| +class CircleLayerDelegate; | 
| +class RectangleLayerDelegate; | 
|  | 
| // An ink drop animation that animates between the different InkDropStates. | 
| +// TODO(bruthig): Document me better. | 
| class VIEWS_EXPORT InkDropAnimation { | 
| public: | 
| -  InkDropAnimation(); | 
| +  InkDropAnimation(const gfx::Size& large_size, | 
| +                   int large_corner_radius, | 
| +                   const gfx::Size& small_size, | 
| +                   int small_corner_radius); | 
| ~InkDropAnimation(); | 
|  | 
| // The root that can be added in to a Layer tree. | 
| ui::Layer* root_layer() { return root_layer_.get(); } | 
|  | 
| -  // Animates from the current |state_| to |state|. | 
| -  void AnimateToState(InkDropState state); | 
| - | 
| -  // Sets the size of the ink drop. | 
| -  void SetInkDropSize(const gfx::Size& size); | 
| +  InkDropState ink_drop_state() const { return ink_drop_state_; } | 
|  | 
| -  // Returns the ink drop bounds. | 
| -  gfx::Rect GetInkDropBounds() const; | 
| +  // Animates from the current |ink_drop_state_| to |state|. | 
| +  void AnimateToState(InkDropState state); | 
|  | 
| -  // Sets the bounds for the ink drop. |bounds| are in the coordinate space of | 
| -  // the parent ui::Layer that the ink drop layer is added to. | 
| -  void SetInkDropBounds(const gfx::Rect& bounds); | 
| +  // Sets the origin of the ink drop Layer relative to it's parent Layer. | 
| +  void SetOrigin(const gfx::Point& origin); | 
|  | 
| private: | 
| -  // Starts the animation of a touch event. | 
| -  void AnimateTapDown(); | 
| - | 
| -  // Schedules the hide animation of |ink_drop_layer_| for once its current | 
| -  // animation has completed. If |ink_drop_layer_| is not animating, the hide | 
| -  // animation begins immediately. | 
| -  void AnimateHide(); | 
| - | 
| -  // Starts the animation of a long press, and cancels hiding |ink_drop_layer_| | 
| -  // until the long press has completed. | 
| -  void AnimateLongPress(); | 
| - | 
| -  // Starts the showing animation on |layer|, with a |duration| in milliseconds. | 
| -  void AnimateShow(ui::Layer* layer, | 
| -                   AppearAnimationObserver* observer, | 
| -                   base::TimeDelta duration); | 
| - | 
| -  // Sets the bounds for |layer|. | 
| -  void SetLayerBounds(ui::Layer* layer); | 
| - | 
| -  // Initializes |layer|'s properties. | 
| -  void SetupAnimationLayer(ui::Layer* layer, InkDropDelegate* delegate); | 
| - | 
| -  // The root layer that parents the animating layers. | 
| +  // Enumeration of the different shapes that compose the ink drop. | 
| +  enum PaintedShape { | 
| +    TOP_LEFT_CIRCLE, | 
| +    TOP_RIGHT_CIRCLE, | 
| +    BOTTOM_RIGHT_CIRCLE, | 
| +    BOTTOM_LEFT_CIRCLE, | 
| +    HORIZONTAL_RECT, | 
| +    VERTICAL_RECT, | 
| +    // The total number of shapes, not an actual shape. | 
| +    PAINTED_SHAPE_COUNT | 
| +  }; | 
| + | 
| +  // Type that contains a gfx::Tansform for each of the layers required by the | 
| +  // ink drop. | 
| +  typedef gfx::Transform InkDropTransforms[PAINTED_SHAPE_COUNT]; | 
| + | 
| +  // TODO(bruthig): Document me. | 
| +  void AnimateToTransforms( | 
| +      InkDropTransforms transforms, | 
| +      float opacity, | 
| +      base::TimeDelta duration, | 
| +      ui::LayerAnimator::PreemptionStrategy preemption_strategy); | 
| + | 
| +  // TODO(bruthig): Document me. | 
| +  void AnimateToTransform( | 
| +      ui::Layer* layer, | 
| +      const gfx::Transform& target_transform, | 
| +      base::TimeDelta duration, | 
| +      ui::LayerAnimator::PreemptionStrategy preemption_strategy); | 
| + | 
| +  // TODO(bruthig): Document me. | 
| +  void ResetTransformsToMinSize(); | 
| + | 
| +  // TODO(bruthig): Document me. | 
| +  void SetTransforms(InkDropTransforms transforms); | 
| + | 
| +  // TODO(bruthig): Document me. | 
| +  void SetOpacity(float opacity); | 
| + | 
| +  // TODO(bruthig): Document me. | 
| +  void CalculateCircleTransforms(const gfx::SizeF size, | 
| +                                 InkDropTransforms transforms) const; | 
| + | 
| +  // TODO(bruthig): Document me. | 
| +  void CalculateRectTransforms(const gfx::SizeF size, | 
| +                               float corner_radius, | 
| +                               InkDropTransforms transforms) const; | 
| + | 
| +  // TODO(bruthig): Document me. | 
| +  void GetCurrentTansforms(InkDropTransforms transforms) const; | 
| + | 
| +  // TODO(bruthig): Document me. | 
| +  void AddPaintLayer(PaintedShape painted_shape); | 
| + | 
| +  // Size used for large size animations. | 
| +  gfx::Size large_size_; | 
| + | 
| +  // Corner radius used for large size animations. | 
| +  int large_corner_radius_; | 
| + | 
| +  // Size used for small size animations. | 
| +  gfx::Size small_size_; | 
| + | 
| +  // Corner radius used for small size animations. | 
| +  int small_corner_radius_; | 
| + | 
| +  // ui::LayerDelegate to paint circles for all the circle layers. | 
| +  scoped_ptr<CircleLayerDelegate> circle_layer_delegate_; | 
| + | 
| +  // ui::LayerDelegate to paint rectangles for all the rectangle layers. | 
| +  scoped_ptr<RectangleLayerDelegate> rect_layer_delegate_; | 
| + | 
| +  // The root layer that parents the animating layers. The root layer is used to | 
| +  // manipulate opacity and origin, and its children are used to manipulate the | 
| +  // different painted shapes that compose the ink drop. | 
| scoped_ptr<ui::Layer> root_layer_; | 
|  | 
| -  // The layer used for animating a user touch. | 
| -  scoped_ptr<ui::Layer> ink_drop_layer_; | 
| - | 
| -  // ui::LayerDelegate responsible for painting to |ink_drop_layer_|. | 
| -  scoped_ptr<InkDropDelegate> ink_drop_delegate_; | 
| - | 
| -  // ui::ImplicitAnimationObserver which observes |ink_drop_layer_| and can be | 
| -  // used to automatically trigger a hide animation upon completion. | 
| -  scoped_ptr<AppearAnimationObserver> appear_animation_observer_; | 
| - | 
| -  // The layer used for animating a long press. | 
| -  scoped_ptr<ui::Layer> long_press_layer_; | 
| - | 
| -  // ui::LayerDelegate responsible for painting to |long_press_layer_|. | 
| -  scoped_ptr<InkDropDelegate> long_press_delegate_; | 
| +  // The gfx::Transform to apply to the |root_layer_|. This is used to place the | 
| +  // ink drop to the specified origin. | 
| +  gfx::Transform root_layer_transform_; | 
|  | 
| -  // ui::ImplicitAnimationObserver which observers |long_press_layer_| and can | 
| -  // be used to automatically trigger a hide animation upon completion. | 
| -  scoped_ptr<AppearAnimationObserver> long_press_animation_observer_; | 
| +  // ui::Layers for all of the painted shape layers that compose the ink drop. | 
| +  scoped_ptr<ui::Layer> painted_layers_[PAINTED_SHAPE_COUNT]; | 
|  | 
| -  // The bounds of the ink drop layers. Defined in the coordinate space of the | 
| -  // parent ui::Layer that the ink drop layers were added to. | 
| -  gfx::Rect ink_drop_bounds_; | 
| +  // The current ink drop state. | 
| +  InkDropState ink_drop_state_; | 
|  | 
| DISALLOW_COPY_AND_ASSIGN(InkDropAnimation); | 
| }; | 
|  |