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

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

Issue 2095873004: Ink drops with touch input are redundant on Windows since the OS does something similar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rework comments and the code based on feedback in the review 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 | no next file » | 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 e6b1e424155d41e75056cdf1744fc2e7e2684fcc..fdfc7c7fb8f2bff62ff3a7936fe05bbaae538856 100644
--- a/ui/views/animation/ink_drop_host_view.cc
+++ b/ui/views/animation/ink_drop_host_view.cc
@@ -172,6 +172,24 @@ gfx::Point InkDropHostView::GetInkDropCenterBasedOnLastEvent() const {
void InkDropHostView::AnimateInkDrop(InkDropState state,
const ui::LocatedEvent* event) {
+#if defined(OS_WIN)
+ // On Windows, don't initiate ink-drops. Additionally, certain event states
+ // should dismiss existing ink-drop animations.
+ if (event && event->IsGestureEvent()) {
+ // Don't transtion the ink-drop to a "pending" state from a touch event.
Evan Stade 2016/06/27 16:42:51 nit: sp (transition)
+ 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);
ink_drop_->AnimateToState(state);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698