diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-17 19:42:56 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-17 19:42:56 +0000 |
commit | 05717341c721a0bd9eeea0f824e0007ceb23c354 (patch) | |
tree | 20a1a8bb3044e76d78154b852c47ac739291f521 /ui | |
parent | 5ab1e8dbd1d0aa6405e6bb02d5dec80952743f89 (diff) | |
download | chromium_src-05717341c721a0bd9eeea0f824e0007ceb23c354.zip chromium_src-05717341c721a0bd9eeea0f824e0007ceb23c354.tar.gz chromium_src-05717341c721a0bd9eeea0f824e0007ceb23c354.tar.bz2 |
ash: Select omnibox text on mouse up instead of down.
Defer selection of the text in an unfocused omnibox until
the release event. Otherwise, all of the text starting from
the left side is selected when the user is trying to
highlight just a portion of the URL.
BUG=128126
TEST=added, also did manual testing
Review URL: https://chromiumcodereview.appspot.com/10386173
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137711 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/views/controls/textfield/native_textfield_views.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ui/views/controls/textfield/native_textfield_views.cc b/ui/views/controls/textfield/native_textfield_views.cc index 03565d7..35fe3e2 100644 --- a/ui/views/controls/textfield/native_textfield_views.cc +++ b/ui/views/controls/textfield/native_textfield_views.cc @@ -105,13 +105,10 @@ NativeTextfieldViews::~NativeTextfieldViews() { bool NativeTextfieldViews::OnMousePressed(const MouseEvent& event) { OnBeforeUserAction(); TrackMouseClicks(event); - - // Allow the textfield/omnibox to optionally handle the mouse pressed event. - // This should be removed once native textfield implementations are - // consolidated to textfield. + // TODO: Remove once NativeTextfield implementations are consolidated to + // Textfield. if (!textfield_->OnMousePressed(event)) HandleMousePressEvent(event); - OnAfterUserAction(); return true; } @@ -129,14 +126,21 @@ bool NativeTextfieldViews::OnMouseDragged(const MouseEvent& event) { return true; OnBeforeUserAction(); - if (MoveCursorTo(event.location(), true)) - SchedulePaint(); + // TODO: Remove once NativeTextfield implementations are consolidated to + // Textfield. + if (!textfield_->OnMouseDragged(event)) { + if (MoveCursorTo(event.location(), true)) + SchedulePaint(); + } OnAfterUserAction(); return true; } void NativeTextfieldViews::OnMouseReleased(const MouseEvent& event) { OnBeforeUserAction(); + // TODO: Remove once NativeTextfield implementations are consolidated to + // Textfield. + textfield_->OnMouseReleased(event); // Cancel suspected drag initiations, the user was clicking in the selection. if (initiating_drag_ && MoveCursorTo(event.location(), false)) SchedulePaint(); |