Chromium Code Reviews| Index: ui/views/animation/ink_drop_host_view.cc |
| diff --git a/ui/views/animation/ink_drop_host_view.cc b/ui/views/animation/ink_drop_host_view.cc |
| index e6b1e424155d41e75056cdf1744fc2e7e2684fcc..5f9ae23bb12e1956b2b880f109e7015dd01176ad 100644 |
| --- a/ui/views/animation/ink_drop_host_view.cc |
| +++ b/ui/views/animation/ink_drop_host_view.cc |
| @@ -172,6 +172,37 @@ gfx::Point InkDropHostView::GetInkDropCenterBasedOnLastEvent() const { |
| void InkDropHostView::AnimateInkDrop(InkDropState state, |
| const ui::LocatedEvent* event) { |
| +#if defined(OS_WIN) |
| + // The reason for this code is to ensure the ink-drop never gets "stuck" |
|
Evan Stade
2016/06/27 15:19:46
I think you're skipping ahead a bit here, imo the
|
| + // because of mismatched events or states. |
| + // |
| + // The ink-drop should never transition to a "pending" state from a touch |
| + // event. This is the first part of the conditional: |
| + // |
| + // state == InkDropState::ACTION_PENDING || |
| + // state == InkDropState::ALTERNATE_ACTION_PENDING |
| + // |
| + // If the state is already "pending", presumably, from a non-touch event such |
| + // as mouse or keyboard, then a triggered action state should be allowed. The |
| + // second part of the conditional: |
| + // |
| + // (state == InkDropState::ACTION_TRIGGERED || |
| + // state == InkDropState::ALTERNATE_ACTION_TRIGGERED) && |
| + // ink_drop_->GetTargetInkDropState() == InkDropState::HIDDEN |
| + // |
| + // Finally, all of the above is predicated on the event itself being a |
| + // gesture/touch event: |
| + // |
| + // event && event->IsGestureEvent() |
| + // |
| + if ((state == InkDropState::ACTION_PENDING || |
| + state == InkDropState::ALTERNATE_ACTION_PENDING || |
| + ((state == InkDropState::ACTION_TRIGGERED || |
| + state == InkDropState::ALTERNATE_ACTION_TRIGGERED) && |
| + ink_drop_->GetTargetInkDropState() == InkDropState::HIDDEN)) && |
| + event && event->IsGestureEvent()) |
| + return; |
| +#endif |
| last_ripple_triggering_event_.reset( |
| event ? ui::Event::Clone(*event).release()->AsLocatedEvent() : nullptr); |
| ink_drop_->AnimateToState(state); |