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

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

Issue 1390113006: Added material design mouse hover feedback support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
Index: ui/views/animation/ink_drop_animation_controller_impl.h
diff --git a/ui/views/animation/ink_drop_animation_controller_impl.h b/ui/views/animation/ink_drop_animation_controller_impl.h
index 5ca25633ba16cb6687e34b07ac96af79fdb7ad75..4aa11dd8394fd4aa580d3b8530ee4a2cd9a516fe 100644
--- a/ui/views/animation/ink_drop_animation_controller_impl.h
+++ b/ui/views/animation/ink_drop_animation_controller_impl.h
@@ -15,6 +15,7 @@
namespace views {
class InkDropAnimation;
class InkDropHost;
+class InkDropHover;
// A functional implementation of an InkDropAnimationController.
class VIEWS_EXPORT InkDropAnimationControllerImpl
@@ -29,6 +30,8 @@ class VIEWS_EXPORT InkDropAnimationControllerImpl
// InkDropAnimationController:
InkDropState GetInkDropState() const override;
void AnimateToState(InkDropState ink_drop_state) override;
+ void SetHovered(bool is_hovered) override;
+ bool IsHovered() const override;
gfx::Size GetInkDropLargeSize() const override;
void SetInkDropSize(const gfx::Size& large_size,
int large_corner_radius,
@@ -45,6 +48,13 @@ class VIEWS_EXPORT InkDropAnimationControllerImpl
// Destroys the current |ink_drop_animation_|.
void DestroyInkDropAnimation();
+ // Creates a new InkDropHover and sets it to |hover_|. If |hover_| wasn't null
+ // then it will be destroyed using DestroyInkDropHover().
+ void CreateInkDropHover();
+
+ // Destroys the current |hover_|.
+ void DestroyInkDropHover();
+
// views::InkDropAnimationObserver:
void InkDropAnimationStarted(InkDropState ink_drop_state) override;
void InkDropAnimationEnded(InkDropState ink_drop_state,
@@ -68,6 +78,19 @@ class VIEWS_EXPORT InkDropAnimationControllerImpl
// Cached center point for the ink drop.
gfx::Point ink_drop_center_;
+ // The root Layer that parents the InkDropAnimation layers and the
+ // InkDropHover layers. The |root_layer_| is the one that is added and removed
+ // from the InkDropHost.
+ scoped_ptr<ui::Layer> root_layer_;
+
+ // The current InkDropHover. Lazily created using CreateInkDropHover();
+ scoped_ptr<InkDropHover> hover_;
+
+ // Tracks whether the ink drop is currently in a hover state or not. Note this
+ // will not always have the same value as |hover_|->is_hovered() because the
+ // hover layer is faded out when the ink drop ripple is active.
+ bool is_hovered_;
+
// The current InkDropAnimation. Created on demand using
// CreateInkDropAnimation().
scoped_ptr<InkDropAnimation> ink_drop_animation_;

Powered by Google App Engine
This is Rietveld 408576698