Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: ui/views/animation/ink_drop_hover.h

Issue 1951593002: Add MD Ink Drop to host only when a ripple/hover is active. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Replaced unique_ptr with scoped_ptr. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/animation/ink_drop_animation_observer.h ('k') | ui/views/animation/ink_drop_hover.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/ink_drop_hover.h
diff --git a/ui/views/animation/ink_drop_hover.h b/ui/views/animation/ink_drop_hover.h
index e6bd62715008a60db01790f645fe3a10947f400a..e1cd2d42e5e0aa267be7dac32181277f8c7ac276 100644
--- a/ui/views/animation/ink_drop_hover.h
+++ b/ui/views/animation/ink_drop_hover.h
@@ -26,17 +26,22 @@ class InkDropHoverTestApi;
} // namespace test
class RoundedRectangleLayerDelegate;
+class InkDropHoverObserver;
// Manages fade in/out animations for a painted Layer that is used to provide
// visual feedback on ui::Views for mouse hover states.
class VIEWS_EXPORT InkDropHover {
public:
+ enum AnimationType { FADE_IN, FADE_OUT };
+
InkDropHover(const gfx::Size& size,
int corner_radius,
const gfx::Point& center_point,
SkColor color);
virtual ~InkDropHover();
+ void set_observer(InkDropHoverObserver* observer) { observer_ = observer; }
+
void set_explode_size(const gfx::Size& size) { explode_size_ = size; }
// Returns true if the hover animation is either in the process of fading
@@ -61,12 +66,10 @@ class VIEWS_EXPORT InkDropHover {
private:
friend class test::InkDropHoverTestApi;
- enum HoverAnimationType { FADE_IN, FADE_OUT };
-
// Animates a fade in/out as specified by |animation_type| combined with a
// transformation from the |initial_size| to the |target_size| over the given
// |duration|.
- void AnimateFade(HoverAnimationType animation_type,
+ void AnimateFade(AnimationType animation_type,
const base::TimeDelta& duration,
const gfx::Size& initial_size,
const gfx::Size& target_size);
@@ -74,9 +77,14 @@ class VIEWS_EXPORT InkDropHover {
// Calculates the Transform to apply to |layer_| for the given |size|.
gfx::Transform CalculateTransform(const gfx::Size& size) const;
+ // The callback that will be invoked when a fade in/out animation is started.
+ void AnimationStartedCallback(
+ AnimationType animation_type,
+ const ui::CallbackLayerAnimationObserver& observer);
+
// The callback that will be invoked when a fade in/out animation is complete.
bool AnimationEndedCallback(
- HoverAnimationType animation_type,
+ AnimationType animation_type,
const ui::CallbackLayerAnimationObserver& observer);
// The size of the hover shape when fully faded in.
@@ -99,6 +107,8 @@ class VIEWS_EXPORT InkDropHover {
// The visual hover layer that is painted by |layer_delegate_|.
scoped_ptr<ui::Layer> layer_;
+ InkDropHoverObserver* observer_;
+
DISALLOW_COPY_AND_ASSIGN(InkDropHover);
};
« no previous file with comments | « ui/views/animation/ink_drop_animation_observer.h ('k') | ui/views/animation/ink_drop_hover.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698