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

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

Issue 10386173: ash: Select omnibox text on mouse up instead of down. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: only run tests for USE_AURA Created 8 years, 7 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
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 2cdd450f07bbd05c344d025ba8255b7ad6638b1b..bdbe036e23d340912f0282d774f0f6495f0425b5 100644
--- a/ui/views/controls/textfield/native_textfield_views.cc
+++ b/ui/views/controls/textfield/native_textfield_views.cc
@@ -104,13 +104,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;
}
@@ -128,14 +125,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();

Powered by Google App Engine
This is Rietveld 408576698