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

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

Issue 22638016: Views Textfield: multiple clicks should alternate between double and triple click behavior (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added comment Created 7 years, 4 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/controls/textfield/native_textfield_views_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/native_textfield_views.cc
diff --git a/ui/views/controls/textfield/native_textfield_views.cc b/ui/views/controls/textfield/native_textfield_views.cc
index 2ac35aac75cf0d252946fd1bde4f53c96478ebe9..c3f096955105ca2d1c929a04294b7da41828ca2c 100644
--- a/ui/views/controls/textfield/native_textfield_views.cc
+++ b/ui/views/controls/textfield/native_textfield_views.cc
@@ -1409,7 +1409,10 @@ void NativeTextfieldViews::TrackMouseClicks(const ui::MouseEvent& event) {
base::TimeDelta time_delta = event.time_stamp() - last_click_time_;
if (time_delta.InMilliseconds() <= GetDoubleClickInterval() &&
!ExceededDragThresholdFromLastClickLocation(event)) {
- aggregated_clicks_ = (aggregated_clicks_ + 1) % 3;
+ // Upon clicking after a triple click, the count should go back to double
+ // click and alternate between double and triple. This assignment maps
+ // 0 to 1, 1 to 2, 2 to 1.
+ aggregated_clicks_ = (aggregated_clicks_ % 2) + 1;
} else {
aggregated_clicks_ = 0;
}
« no previous file with comments | « no previous file | ui/views/controls/textfield/native_textfield_views_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698