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

Unified Diff: content/browser/renderer_host/input/touch_selection_controller.cc

Issue 469483002: [Android] Route selection event updates to ContentViewClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 6 years, 4 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: content/browser/renderer_host/input/touch_selection_controller.cc
diff --git a/content/browser/renderer_host/input/touch_selection_controller.cc b/content/browser/renderer_host/input/touch_selection_controller.cc
index 8643910c2dc6b4f0858f0acca1a519932f558d12..8193fb180668397e589d451edf2f107e782af49a 100644
--- a/content/browser/renderer_host/input/touch_selection_controller.cc
+++ b/content/browser/renderer_host/input/touch_selection_controller.cc
@@ -184,7 +184,7 @@ bool TouchSelectionController::Animate(base::TimeTicks frame_time) {
void TouchSelectionController::OnHandleDragBegin(const TouchHandle& handle) {
if (&handle == insertion_handle_.get()) {
- client_->OnSelectionEvent(INSERTION_DRAG_STARTED, GetStartPosition());
+ client_->OnSelectionEvent(INSERTION_DRAG_STARTED, handle.position());
return;
}
@@ -195,6 +195,7 @@ void TouchSelectionController::OnHandleDragBegin(const TouchHandle& handle) {
fixed_handle_position_ = start_selection_handle_->position() -
gfx::Vector2dF(0, GetStartLineHeight() / 2.f);
}
+ client_->OnSelectionEvent(SELECTION_DRAG_STARTED, handle.position());
}
void TouchSelectionController::OnHandleDragUpdate(const TouchHandle& handle,
@@ -213,11 +214,13 @@ void TouchSelectionController::OnHandleDragUpdate(const TouchHandle& handle,
}
void TouchSelectionController::OnHandleDragEnd(const TouchHandle& handle) {
+ if (&handle != insertion_handle_.get())
+ client_->OnSelectionEvent(SELECTION_DRAG_STOPPED, handle.position());
}
void TouchSelectionController::OnHandleTapped(const TouchHandle& handle) {
if (insertion_handle_ && &handle == insertion_handle_.get())
- client_->OnSelectionEvent(INSERTION_TAPPED, GetStartPosition());
+ client_->OnSelectionEvent(INSERTION_TAPPED, handle.position());
}
void TouchSelectionController::SetNeedsAnimate() {

Powered by Google App Engine
This is Rietveld 408576698