Chromium Code Reviews| 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 f642a0ff3cca5a1ea1b5f5cf361aaaeeaf5b3910..02d65364557baeb47e11e5bc10513594d265ded3 100644 |
| --- a/chrome/browser/ui/views/toolbar/toolbar_button.cc |
| +++ b/chrome/browser/ui/views/toolbar/toolbar_button.cc |
| @@ -185,19 +185,24 @@ 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_state == views::InkDropState::HIDDEN && |
| + 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. |
|
Peter Kasting
2015/11/11 22:07:21
Nit: I'd move this comment above the conditional,
bruthig
2015/11/12 18:30:30
Done.
|
| + return; |
| + } |
| ink_drop_animation_controller_->AnimateToState(ink_drop_state); |
| } |