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

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: merge and add test todo 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
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_views.cc ('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/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 c56f876ee3d7723d83a1bc7f049a6010e7e306be..915a05ee6ec3f70f4b904e7d5ce5e17a8a734c4b 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();
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698