summaryrefslogtreecommitdiffstats
path: root/ui/views/controls
diff options
context:
space:
mode:
authorjunmin.zhu@intel.com <junmin.zhu@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-17 07:48:07 +0000
committerjunmin.zhu@intel.com <junmin.zhu@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-17 07:48:07 +0000
commitfa192fb2727ddf3bc27cdf674722f8458a83d77c (patch)
treef8de5e7a2db2cee2fec84021243b4d3af2b29e78 /ui/views/controls
parentf2c65560962b79220933e534c43267a0aa981829 (diff)
downloadchromium_src-fa192fb2727ddf3bc27cdf674722f8458a83d77c.zip
chromium_src-fa192fb2727ddf3bc27cdf674722f8458a83d77c.tar.gz
chromium_src-fa192fb2727ddf3bc27cdf674722f8458a83d77c.tar.bz2
TextField should be able to copy&paste with long press gesture.
BUG=135188 Test=manually Review URL: https://chromiumcodereview.appspot.com/10699036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146960 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/controls')
-rw-r--r--ui/views/controls/textfield/native_textfield_views.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/views/controls/textfield/native_textfield_views.cc b/ui/views/controls/textfield/native_textfield_views.cc
index 6372aaf..746d2d4 100644
--- a/ui/views/controls/textfield/native_textfield_views.cc
+++ b/ui/views/controls/textfield/native_textfield_views.cc
@@ -149,12 +149,18 @@ void NativeTextfieldViews::OnMouseReleased(const MouseEvent& event) {
ui::GestureStatus NativeTextfieldViews::OnGestureEvent(
const GestureEvent& event) {
+ ui::GestureStatus status = textfield_->OnGestureEvent(event);
+ if (status != ui::GESTURE_STATUS_UNKNOWN)
+ return status;
switch (event.type()) {
case ui::ET_GESTURE_TAP_DOWN:
OnBeforeUserAction();
textfield_->RequestFocus();
- if (MoveCursorTo(event.location(), false))
+ // We don't deselect if the point is in the selection
+ // because TAP_DOWN may turn into a LONG_PRESS.
+ if (!GetRenderText()->IsPointInSelection(event.location()) &&
+ MoveCursorTo(event.location(), false))
SchedulePaint();
OnAfterUserAction();
return ui::GESTURE_STATUS_CONSUMED;