| Index: ui/views/animation/ink_drop_impl.h
|
| diff --git a/ui/views/animation/ink_drop_impl.h b/ui/views/animation/ink_drop_impl.h
|
| index e9b2640f363a320b2bfdf8b7212e448fd8d79e65..47b8f508657200ada6560f48b85746960758c5d4 100644
|
| --- a/ui/views/animation/ink_drop_impl.h
|
| +++ b/ui/views/animation/ink_drop_impl.h
|
| @@ -11,7 +11,7 @@
|
| #include "ui/gfx/geometry/rect.h"
|
| #include "ui/gfx/geometry/size.h"
|
| #include "ui/views/animation/ink_drop.h"
|
| -#include "ui/views/animation/ink_drop_hover_observer.h"
|
| +#include "ui/views/animation/ink_drop_highlight_observer.h"
|
| #include "ui/views/animation/ink_drop_ripple_observer.h"
|
| #include "ui/views/views_export.h"
|
|
|
| @@ -26,13 +26,13 @@ class InkDropImplTestApi;
|
|
|
| class InkDropRipple;
|
| class InkDropHost;
|
| -class InkDropHover;
|
| +class InkDropHighlight;
|
| class InkDropFactoryTest;
|
|
|
| // A functional implementation of an InkDrop.
|
| class VIEWS_EXPORT InkDropImpl : public InkDrop,
|
| public InkDropRippleObserver,
|
| - public InkDropHoverObserver {
|
| + public InkDropHighlightObserver {
|
| public:
|
| // Constructs an ink drop that will attach the ink drop to the given
|
| // |ink_drop_host|.
|
| @@ -61,38 +61,40 @@ class VIEWS_EXPORT InkDropImpl : public InkDrop,
|
| // Destroys the current |ink_drop_ripple_|.
|
| void DestroyInkDropRipple();
|
|
|
| - // Creates a new InkDropHover and sets it to |hover_|. If |hover_| wasn't null
|
| - // then it will be destroyed using DestroyInkDropHover().
|
| - void CreateInkDropHover();
|
| + // Creates a new InkDropHighlight and assigns it to |highlight_|. If
|
| + // |highlight_| wasn't null then it will be destroyed using
|
| + // DestroyInkDropHighlight().
|
| + void CreateInkDropHighlight();
|
|
|
| - // Destroys the current |hover_|.
|
| - void DestroyInkDropHover();
|
| + // Destroys the current |highlight_|.
|
| + void DestroyInkDropHighlight();
|
|
|
| // Adds the |root_layer_| to the |ink_drop_host_| if it hasn't already been
|
| // added.
|
| void AddRootLayerToHostIfNeeded();
|
|
|
| // Removes the |root_layer_| from the |ink_drop_host_| if no ink drop ripple
|
| - // or hover is active.
|
| + // or highlight is active.
|
| void RemoveRootLayerFromHostIfNeeded();
|
|
|
| - // Returns true if the hover animation is in the process of fading in or
|
| + // Returns true if the highlight animation is in the process of fading in or
|
| // is visible.
|
| - bool IsHoverFadingInOrVisible() const;
|
| + bool IsHighlightFadingInOrVisible() const;
|
|
|
| // views::InkDropRippleObserver:
|
| void AnimationStarted(InkDropState ink_drop_state) override;
|
| void AnimationEnded(InkDropState ink_drop_state,
|
| InkDropAnimationEndedReason reason) override;
|
|
|
| - // views::InkDropHoverObserver:
|
| - void AnimationStarted(InkDropHover::AnimationType animation_type) override;
|
| - void AnimationEnded(InkDropHover::AnimationType animation_type,
|
| + // views::InkDropHighlightObserver:
|
| + void AnimationStarted(
|
| + InkDropHighlight::AnimationType animation_type) override;
|
| + void AnimationEnded(InkDropHighlight::AnimationType animation_type,
|
| InkDropAnimationEndedReason reason) override;
|
|
|
| - // Enables or disables the hover state based on |should_highlight| and if an
|
| - // animation is triggered it will be scheduled to have the given
|
| - // |animation_duration|. If |explode| is true the hover will expand as it
|
| + // Enables or disables the highlight state based on |should_highlight| and if
|
| + // an animation is triggered it will be scheduled to have the given
|
| + // |animation_duration|. If |explode| is true the highlight will expand as it
|
| // fades out. |explode| is ignored when |should_higlight| is true.
|
| void SetHighlight(bool should_highlight,
|
| base::TimeDelta animation_duration,
|
| @@ -101,30 +103,32 @@ class VIEWS_EXPORT InkDropImpl : public InkDrop,
|
| // Returns true if this ink drop is hovered or focused.
|
| bool ShouldHighlight() const;
|
|
|
| - // Starts the |hover_after_ripple_timer_| timer. This will stop the current
|
| - // |hover_after_ripple_timer_| instance if it exists.
|
| - void StartHoverAfterRippleTimer();
|
| + // Starts the |highlight_after_ripple_timer_| timer. This will stop the
|
| + // current
|
| + // |highlight_after_ripple_timer_| instance if it exists.
|
| + void StartHighlightAfterRippleTimer();
|
|
|
| - // Stops and destroys the current |hover_after_ripple_timer_| instance.
|
| - void StopHoverAfterRippleTimer();
|
| + // Stops and destroys the current |highlight_after_ripple_timer_| instance.
|
| + void StopHighlightAfterRippleTimer();
|
|
|
| - // Callback for when the |hover_after_ripple_timer_| fires.
|
| - void HoverAfterRippleTimerFired();
|
| + // Callback for when the |highlight_after_ripple_timer_| fires.
|
| + void HighlightAfterRippleTimerFired();
|
|
|
| // The host of the ink drop. Used to poll for information such as whether the
|
| - // hover should be shown or not.
|
| + // highlight should be shown or not.
|
| InkDropHost* ink_drop_host_;
|
|
|
| - // The root Layer that parents the InkDropRipple layers and the InkDropHover
|
| - // layers. The |root_layer_| is the one that is added and removed from the
|
| - // InkDropHost.
|
| + // The root Layer that parents the InkDropRipple layers and the
|
| + // InkDropHighlight layers. The |root_layer_| is the one that is added and
|
| + // removed from the InkDropHost.
|
| std::unique_ptr<ui::Layer> root_layer_;
|
|
|
| // True when the |root_layer_| has been added to the |ink_drop_host_|.
|
| bool root_layer_added_to_host_;
|
|
|
| - // The current InkDropHover. Lazily created using CreateInkDropHover();
|
| - std::unique_ptr<InkDropHover> hover_;
|
| + // The current InkDropHighlight. Lazily created using
|
| + // CreateInkDropHighlight();
|
| + std::unique_ptr<InkDropHighlight> highlight_;
|
|
|
| // Tracks the logical hovered state of |this| as manipulated by the public
|
| // SetHovered() function.
|
| @@ -137,9 +141,9 @@ class VIEWS_EXPORT InkDropImpl : public InkDrop,
|
| // The current InkDropRipple. Created on demand using CreateInkDropRipple().
|
| std::unique_ptr<InkDropRipple> ink_drop_ripple_;
|
|
|
| - // The timer used to delay the hover fade in after an ink drop ripple
|
| + // The timer used to delay the highlight fade in after an ink drop ripple
|
| // animation.
|
| - std::unique_ptr<base::Timer> hover_after_ripple_timer_;
|
| + std::unique_ptr<base::Timer> highlight_after_ripple_timer_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(InkDropImpl);
|
| };
|
|
|