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

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

Issue 1478303003: Converted all Views to use an InkDropDelegate instead of a InkDropAnimationController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed compile errors 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
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 5d3b9ebedabc418c74d1e56ddcf09f79f0fb2f86..6dabf60a3b991ed54435debb7d16cbb1edb8e5a2 100644
--- a/ui/views/animation/button_ink_drop_delegate.cc
+++ b/ui/views/animation/button_ink_drop_delegate.cc
@@ -47,6 +47,9 @@ void ButtonInkDropDelegate::OnAction(InkDropState state) {
// ui::EventHandler:
void ButtonInkDropDelegate::OnGestureEvent(ui::GestureEvent* event) {
+ InkDropState current_ink_drop_state =
+ ink_drop_animation_controller_->GetInkDropState();
+
InkDropState ink_drop_state = InkDropState::HIDDEN;
switch (event->type()) {
case ui::ET_GESTURE_TAP_DOWN:
@@ -61,17 +64,17 @@ void ButtonInkDropDelegate::OnGestureEvent(ui::GestureEvent* event) {
case ui::ET_GESTURE_LONG_TAP:
ink_drop_state = InkDropState::SLOW_ACTION;
break;
- case ui::ET_GESTURE_SCROLL_BEGIN:
case ui::ET_GESTURE_END:
+ if (current_ink_drop_state == InkDropState::ACTIVATED)
+ return;
+ // Fall through to ui::ET_GESTURE_SCROLL_BEGIN case.
+ case ui::ET_GESTURE_SCROLL_BEGIN:
ink_drop_state = InkDropState::HIDDEN;
break;
default:
return;
}
- InkDropState current_ink_drop_state =
- ink_drop_animation_controller_->GetInkDropState();
-
if (ink_drop_state == InkDropState::HIDDEN &&
(current_ink_drop_state == InkDropState::QUICK_ACTION ||
current_ink_drop_state == InkDropState::SLOW_ACTION ||

Powered by Google App Engine
This is Rietveld 408576698