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

Unified Diff: ui/views/controls/textfield/textfield.cc

Issue 2007083002: Validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@453559-use-timeticks-ui-event
Patch Set: Fix macOS test 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
« ui/events/test/event_generator.cc ('K') | « ui/message_center/message_center.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index 24eb8bde75bfe042cad79c4c2737a829e0f117fd..bb5ab806a4f59b6b1fa947d820883a1561afc10a 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -1930,7 +1930,8 @@ void Textfield::UpdateContextMenu() {
void Textfield::TrackMouseClicks(const ui::MouseEvent& event) {
if (event.IsOnlyLeftMouseButton()) {
base::TimeDelta time_delta = event.time_stamp() - last_click_time_;
- if (time_delta.InMilliseconds() <= GetDoubleClickInterval() &&
+ if (!last_click_time_.is_null() &&
+ time_delta.InMilliseconds() <= GetDoubleClickInterval() &&
!ExceededDragThreshold(event.location() - last_click_location_)) {
// Upon clicking after a triple click, the count should go back to double
// click and alternate between double and triple. This assignment maps
« ui/events/test/event_generator.cc ('K') | « ui/message_center/message_center.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698