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

Unified Diff: ui/touch_selection/touch_selection_controller.cc

Issue 1139123009: Ensure async selections after longpress activate the handles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | ui/touch_selection/touch_selection_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ad010c3807275ac0aee8b74fe7b2dc227e8c4510..34cc30a526172079f53e9319952ca4127031b08d 100644
--- a/ui/touch_selection/touch_selection_controller.cc
+++ b/ui/touch_selection/touch_selection_controller.cc
@@ -491,8 +491,14 @@ void TouchSelectionController::DeactivateSelection() {
}
void TouchSelectionController::ForceNextUpdateIfInactive() {
- if (active_status_ == INACTIVE)
+ // Only force the update if the reported selection is non-empty but still
+ // considered "inactive", i.e., it wasn't preceded by a user gesture or
+ // the handles have since been explicitly hidden.
+ if (active_status_ == INACTIVE &&
+ start_.type() != SelectionBound::EMPTY &&
+ end_.type() != SelectionBound::EMPTY) {
force_next_update_ = true;
+ }
}
gfx::Vector2dF TouchSelectionController::GetStartLineOffset() const {
« no previous file with comments | « no previous file | ui/touch_selection/touch_selection_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698