Chromium Code Reviews| Index: ui/touch_selection/touch_selection_controller.cc |
| diff --git a/ui/touch_selection/touch_selection_controller.cc b/ui/touch_selection/touch_selection_controller.cc |
| index 90f7c6241580f66532ff678d360f070a8fa82bc3..9f463711bc6582f7294ee76210bea4a5ca5b61d3 100644 |
| --- a/ui/touch_selection/touch_selection_controller.cc |
| +++ b/ui/touch_selection/touch_selection_controller.cc |
| @@ -231,6 +231,23 @@ bool TouchSelectionController::WillHandleLongPressEvent( |
| return false; |
| } |
| +void TouchSelectionController::OnScrollBeginEvent() { |
| + // If a scroll happens after a long-press on an empty area, the long-press |
|
mfomitchev
2016/01/04 18:58:44
Can we rephrase to be a bit more explicit, e.g.:
I
mohsen
2016/01/04 19:23:05
Done.
|
| + // will not change the selection, however the scroll will move the selection. |
| + // In this case we might think incorrectly that the selection change was due |
|
mfomitchev
2016/01/04 18:58:44
Can we replace "might" with "will" here?
Also, per
mohsen
2016/01/04 19:23:05
Done.
|
| + // to long-press and will activate touch selection and start long-press drag |
| + // gesture. To prevent this, we need to reset the state of touch selection |
| + // controller and long-press drag selector. |
| + // TODO(mohsen): Remove this workaround when we have enough information about |
| + // the cause of a selection change (see https://crbug.com/571897). |
| + longpress_drag_selector_.OnScrollBeginEvent(); |
| + response_pending_input_event_ = INPUT_EVENT_TYPE_NONE; |
| + if (active_status_ == INACTIVE) { |
| + activate_insertion_automatically_ = false; |
| + activate_selection_automatically_ = false; |
| + } |
| +} |
| + |
| void TouchSelectionController::AllowShowingFromCurrentSelection() { |
| if (active_status_ != INACTIVE) |
| return; |