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

Unified Diff: ui/touch_selection/touch_selection_controller.cc

Issue 1239583003: Update touch selection notification names, add ESTABLISHED. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add new SelectionEventTypes for bounds changing instead of reusing an insertion event. Created 5 years, 5 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
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 ea5db91a766055c25968c6ea1f9eec101dc2fe66..96577df31d24d28fb022089beabb31e2bb672e00 100644
--- a/ui/touch_selection/touch_selection_controller.cc
+++ b/ui/touch_selection/touch_selection_controller.cc
@@ -80,6 +80,15 @@ void TouchSelectionController::OnSelectionBoundsChanged(
if (!force_next_update_ && start == start_ && end_ == end)
return;
+ // Notify if selection bounds have just been established or dissolved.
+ if (start.type() != SelectionBound::EMPTY &&
+ start_.type() == SelectionBound::EMPTY) {
+ client_->OnSelectionEvent(BOUNDS_ESTABLISHED);
+ } else if (start.type() == SelectionBound::EMPTY &&
+ start_.type() != SelectionBound::EMPTY) {
+ client_->OnSelectionEvent(BOUNDS_DISSOLVED);
+ }
+
start_ = start;
end_ = end;
start_orientation_ = ToTouchHandleOrientation(start_.type());
« ui/touch_selection/selection_event_type.h ('K') | « ui/touch_selection/selection_event_type.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698