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

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

Issue 2115933002: Revert of Added tests and reworked ink-drop touch logic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | ui/views/animation/ink_drop_host_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2c6ffe2b2a0f209cbb18c2ae7c834653a427a04a..879dbc72d0a75e00b2863cc20102ea2d54245838 100644
--- a/ui/views/animation/ink_drop_host_view.cc
+++ b/ui/views/animation/ink_drop_host_view.cc
@@ -177,15 +177,22 @@
void InkDropHostView::AnimateInkDrop(InkDropState state,
const ui::LocatedEvent* event) {
#if defined(OS_WIN)
- // On Windows, don't initiate ink-drops for touch/gesture events.
- // Additionally, certain event states should dismiss existing ink-drop
- // animations. If the state is already other than HIDDEN, presumably from
- // a mouse or keyboard event, then the state should be allowed. Conversely,
- // if the requested state is ACTIVATED, then it should always be allowed.
- if (event && (event->IsTouchEvent() || event->IsGestureEvent()) &&
- ink_drop_->GetTargetInkDropState() == InkDropState::HIDDEN &&
- state != InkDropState::ACTIVATED)
- return;
+ // On Windows, don't initiate ink-drops. Additionally, certain event states
+ // should dismiss existing ink-drop animations.
+ if (event && event->IsGestureEvent()) {
+ // Don't transition the ink-drop to a "pending" state from a touch event.
+ if (state == InkDropState::ACTION_PENDING ||
+ state == InkDropState::ALTERNATE_ACTION_PENDING)
+ return;
+ // If the state is already pending, presumably from a mouse or keyboard
+ // event, then a "triggered" action state should be allowed. Conversely,
+ // if the state had already transitioned to hidden, then the touch event
+ // is ignored.
+ if ((state == InkDropState::ACTION_TRIGGERED ||
+ state == InkDropState::ALTERNATE_ACTION_TRIGGERED) &&
+ ink_drop_->GetTargetInkDropState() == InkDropState::HIDDEN)
+ return;
+ }
#endif
last_ripple_triggering_event_.reset(
event ? ui::Event::Clone(*event).release()->AsLocatedEvent() : nullptr);
« no previous file with comments | « no previous file | ui/views/animation/ink_drop_host_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698