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

Unified Diff: ui/views/animation/ink_drop_animation_controller_factory.cc

Issue 1390113006: Added material design mouse hover feedback support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved MouseEntered/Exit() to hover handling in to the ButtonInkDropDelegate. Created 4 years, 11 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_factory.cc
diff --git a/ui/views/animation/ink_drop_animation_controller_factory.cc b/ui/views/animation/ink_drop_animation_controller_factory.cc
index 6a3f8a37bfc9a495de410df7595f2e3bce786169..ce187d983dc922c73675403471d48a99f6775f05 100644
--- a/ui/views/animation/ink_drop_animation_controller_factory.cc
+++ b/ui/views/animation/ink_drop_animation_controller_factory.cc
@@ -27,6 +27,8 @@ class InkDropAnimationControllerStub
// InkDropAnimationController:
InkDropState GetInkDropState() const override;
void AnimateToState(InkDropState 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,
@@ -35,10 +37,15 @@ class InkDropAnimationControllerStub
void SetInkDropCenter(const gfx::Point& center_point) override;
private:
+ // Tracks whether the ink drop is hovered or not. This is used to ensure that
+ // this behaves like all other InkDropAnimationController implementations.
+ bool is_hovered_;
+
DISALLOW_COPY_AND_ASSIGN(InkDropAnimationControllerStub);
};
-InkDropAnimationControllerStub::InkDropAnimationControllerStub() {}
+InkDropAnimationControllerStub::InkDropAnimationControllerStub()
+ : is_hovered_(false) {}
InkDropAnimationControllerStub::~InkDropAnimationControllerStub() {}
@@ -46,7 +53,17 @@ InkDropState InkDropAnimationControllerStub::GetInkDropState() const {
return InkDropState::HIDDEN;
}
-void InkDropAnimationControllerStub::AnimateToState(InkDropState state) {}
+void InkDropAnimationControllerStub::AnimateToState(InkDropState state) {
+ SetHovered(false);
+}
+
+void InkDropAnimationControllerStub::SetHovered(bool is_hovered) {
+ is_hovered_ = is_hovered;
+}
+
+bool InkDropAnimationControllerStub::IsHovered() const {
+ return is_hovered_;
+}
gfx::Size InkDropAnimationControllerStub::GetInkDropLargeSize() const {
return gfx::Size();

Powered by Google App Engine
This is Rietveld 408576698