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

Unified Diff: chrome/browser/ui/views/toolbar/toolbar_button.cc

Issue 1422593003: Made material design ink drop QUICK_ACTION animation more visible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added varkha@'s behavioural changes Created 5 years, 1 month 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 | « no previous file | ui/views/animation/ink_drop_animation.h » ('j') | ui/views/animation/ink_drop_animation.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/toolbar_button.cc
diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.cc b/chrome/browser/ui/views/toolbar/toolbar_button.cc
index 6cba92fb2c86eae1d27962438e8c87033da06c6d..c32aac573af149668b2150e2a9807c2c380fe55c 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_button.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_button.cc
@@ -189,19 +189,23 @@ void ToolbarButton::OnGestureEvent(ui::GestureEvent* event) {
case ui::ET_GESTURE_LONG_PRESS:
ink_drop_state = views::InkDropState::SLOW_ACTION_PENDING;
break;
- case ui::ET_GESTURE_TAP:
- ink_drop_state = views::InkDropState::QUICK_ACTION;
- break;
case ui::ET_GESTURE_LONG_TAP:
ink_drop_state = views::InkDropState::SLOW_ACTION;
break;
+ case ui::ET_GESTURE_SCROLL_BEGIN:
case ui::ET_GESTURE_END:
- case ui::ET_GESTURE_TAP_CANCEL:
ink_drop_state = views::InkDropState::HIDDEN;
break;
default:
return;
}
+
+ if (ink_drop_animation_controller_->WillAutoAnimateToHidden()) {
+ // Some InkDropStates automatically transition to the HIDDEN state so we
+ // don't make an explicit call. Explicitly animating to HIDDEN in this case
+ // would prematurely pre-empt these animations.
+ return;
+ }
ink_drop_animation_controller_->AnimateToState(ink_drop_state);
}
« no previous file with comments | « no previous file | ui/views/animation/ink_drop_animation.h » ('j') | ui/views/animation/ink_drop_animation.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698