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

Unified Diff: ui/views/animation/button_ink_drop_delegate.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/button_ink_drop_delegate.cc
diff --git a/ui/views/animation/button_ink_drop_delegate.cc b/ui/views/animation/button_ink_drop_delegate.cc
index 2fa6000574b196631b220bde9ca8a3fa8e494b30..40172abaab70d6e68634f47516c923c93e5cd876 100644
--- a/ui/views/animation/button_ink_drop_delegate.cc
+++ b/ui/views/animation/button_ink_drop_delegate.cc
@@ -43,9 +43,24 @@ void ButtonInkDropDelegate::OnAction(InkDropState state) {
ink_drop_animation_controller_->AnimateToState(state);
}
+void ButtonInkDropDelegate::SetHovered(bool is_hovered) {
+ ink_drop_animation_controller_->SetHovered(is_hovered);
+}
+
////////////////////////////////////////////////////////////////////////////////
// ui::EventHandler:
+void ButtonInkDropDelegate::OnMouseEvent(ui::MouseEvent* event) {
+ switch (event->type()) {
+ case ui::ET_MOUSE_ENTERED:
+ case ui::ET_MOUSE_EXITED:
+ SetHovered(ink_drop_host_->ShouldShowInkDropHover());
+ break;
+ default:
+ return;
+ }
+}
+
void ButtonInkDropDelegate::OnGestureEvent(ui::GestureEvent* event) {
InkDropState current_ink_drop_state =
ink_drop_animation_controller_->GetInkDropState();

Powered by Google App Engine
This is Rietveld 408576698