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

Unified Diff: content/browser/renderer_host/input/gesture_text_selector.cc

Issue 590483002: Check if Button is pressed for changing selection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « content/browser/renderer_host/input/gesture_text_selector.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « content/browser/renderer_host/input/gesture_text_selector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698