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

Unified Diff: ui/touch_selection/touch_handle.cc

Issue 903143003: wip: Touch Text Selection Prototypes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@selection_granularity_on_unified
Patch Set: Created 5 years, 10 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 | « ui/touch_selection/touch_handle.h ('k') | ui/touch_selection/touch_selection_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/touch_selection/touch_handle.cc
diff --git a/ui/touch_selection/touch_handle.cc b/ui/touch_selection/touch_handle.cc
index 0680e6db8afeca5bbe649bf07992391810777efe..84ab0b0a27b37755f65fd2d32c1853e184e30f15 100644
--- a/ui/touch_selection/touch_handle.cc
+++ b/ui/touch_selection/touch_handle.cc
@@ -152,7 +152,7 @@ bool TouchHandle::WillHandleTouchEvent(const MotionEvent& event) {
touch_down_position_ = touch_point;
touch_to_focus_offset_ = position_ - touch_down_position_;
touch_down_time_ = event.GetEventTime();
- BeginDrag();
+ BeginDrag(event.GetEventTime());
} break;
case MotionEvent::ACTION_MOVE: {
@@ -167,7 +167,8 @@ bool TouchHandle::WillHandleTouchEvent(const MotionEvent& event) {
// Note that we signal drag update even if we're inside the tap region,
// as there are cases where characters are narrower than the slop length.
client_->OnHandleDragUpdate(*this,
- touch_move_position + touch_to_focus_offset_);
+ touch_move_position + touch_to_focus_offset_,
+ event.GetEventTime());
} break;
case MotionEvent::ACTION_UP: {
@@ -211,14 +212,14 @@ bool TouchHandle::Animate(base::TimeTicks frame_time) {
return true;
}
-void TouchHandle::BeginDrag() {
+void TouchHandle::BeginDrag(base::TimeTicks event_time) {
DCHECK(enabled_);
if (is_dragging_)
return;
EndFade();
is_dragging_ = true;
is_drag_within_tap_region_ = true;
- client_->OnHandleDragBegin(*this);
+ client_->OnHandleDragBegin(*this, event_time);
}
void TouchHandle::EndDrag() {
« no previous file with comments | « ui/touch_selection/touch_handle.h ('k') | ui/touch_selection/touch_selection_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698