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

Unified Diff: ui/events/event.cc

Issue 1068463003: A mouse event created from the same native event will be marked as repeated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified EventsXTest.ClickCount to account for the change. Created 5 years, 8 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/events/event_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event.cc
diff --git a/ui/events/event.cc b/ui/events/event.cc
index f0804d871cd9ad9790dcdbbb3af924e42e3cc32a..0cdf70d873394a0b5b5bd532df720c1a84ec3eb3 100644
--- a/ui/events/event.cc
+++ b/ui/events/event.cc
@@ -357,6 +357,10 @@ bool MouseEvent::IsRepeatedClickEvent(
(event2.flags() & ~EF_IS_DOUBLE_CLICK))
return false;
+ // The new event has been created from the same native event.
+ if (event1.time_stamp() == event2.time_stamp())
+ return false;
+
base::TimeDelta time_difference = event2.time_stamp() - event1.time_stamp();
if (time_difference.InMilliseconds() > kDoubleClickTimeMS)
« no previous file with comments | « no previous file | ui/events/event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698