Fix issue with longpress drag selection motion
commita188bd6dff9c2a0425d1f31e3ab929c373762d83
authorjdduke <jdduke@chromium.org>
Tue, 4 Aug 2015 21:05:10 +0000 (4 14:05 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 4 Aug 2015 21:07:55 +0000 (4 21:07 +0000)
treeba00664260231919785d39d1814ed6079e4afc16
parentdb6e9fc577a31e97de6273dfc03dd4d57e8f17d1
Fix issue with longpress drag selection motion

If the user has already dragged outside the initial selected word region
by the time the browser gets a selection update, or if the selected word
isn't coincident with the longpress location, the subsequently dragged
selection endpoint can be wrong. For such cases, rather than
using the drag direction for drag anchor picking, just use the distance
between the current touch point and the selection endpoints.

BUG=466749

Review URL: https://codereview.chromium.org/1271823002

Cr-Commit-Position: refs/heads/master@{#341791}
ui/touch_selection/longpress_drag_selector.cc
ui/touch_selection/longpress_drag_selector_unittest.cc