Index: content/browser/renderer_host/input/gesture_text_selector.cc |
diff --git a/content/browser/renderer_host/input/gesture_text_selector.cc b/content/browser/renderer_host/input/gesture_text_selector.cc |
index 59f28cf3245f0288b397ddb2a47117f88531086d..be2968204456b8a11db9176f0e7f8cf635226fdc 100644 |
--- a/content/browser/renderer_host/input/gesture_text_selector.cc |
+++ b/content/browser/renderer_host/input/gesture_text_selector.cc |
@@ -13,6 +13,7 @@ namespace content { |
GestureTextSelector::GestureTextSelector(GestureTextSelectorClient* client) |
: client_(client), |
text_selection_triggered_(false), |
+ spen_button_pressed_(false), |
jdduke (slow)
2014/09/19 17:34:22
We're trying to keep this class generic, for any k
AviD
2014/09/23 11:52:08
renamed to secondary_button_pressed_
|
anchor_x_(0.0f), |
anchor_y_(0.0f) { |
} |
@@ -26,6 +27,10 @@ bool GestureTextSelector::OnTouchEvent(const ui::MotionEvent& event) { |
// sequences from being forwarded. |
text_selection_triggered_ = ShouldStartTextSelection(event); |
} |
+ if (text_selection_triggered_ && |
+ event.GetAction() == ui::MotionEvent::ACTION_MOVE) { |
+ spen_button_pressed_ = ShouldStartTextSelection(event); |
jdduke (slow)
2014/09/19 17:34:22
Reusing this function with its current name is con
AviD
2014/09/23 11:52:08
Changed to check only Button state.
|
+ } |
return text_selection_triggered_; |
} |
@@ -48,8 +53,10 @@ bool GestureTextSelector::OnGestureEvent(const ui::GestureEventData& gesture) { |
// TODO(changwan): check if we can show handles on ET_GESTURE_SCROLL_END |
// instead. Currently it is not possible as ShowSelectionHandles should |
// be called before we change the selection. |
- client_->ShowSelectionHandlesAutomatically(); |
- client_->SelectRange(anchor_x_, anchor_y_, gesture.x, gesture.y); |
+ if (spen_button_pressed_) { |
+ client_->ShowSelectionHandlesAutomatically(); |
+ client_->SelectRange(anchor_x_, anchor_y_, gesture.x, gesture.y); |
+ } |
break; |
} |
default: |