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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 1087893003: Support longpress drag selection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 5 years, 8 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/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index f687931630d13362e870a52b05148dbc3da4b7a4..c480b201e88a190c70a0a1d838f0b7a6cfe31c3f 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -1330,12 +1330,6 @@ void RenderWidgetHostViewAndroid::OnSelectionEvent(
ui::SelectionEventType event) {
DCHECK(content_view_core_);
DCHECK(selection_controller_);
- // Showing the selection action bar can alter the current View coordinates in
- // such a way that the current MotionEvent stream is suddenly shifted in
- // space. Avoid the associated scroll jump by pre-emptively cancelling gesture
- // detection; scrolling after the selection is activated is unnecessary.
- if (event == ui::SelectionEventType::SELECTION_SHOWN)
- ResetGestureDetection();
content_view_core_->OnSelectionEvent(
event, selection_controller_->GetStartPosition(),
GetSelectionRect(*selection_controller_));
@@ -1653,15 +1647,13 @@ void RenderWidgetHostViewAndroid::GestureEventAck(
InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent(
const blink::WebInputEvent& input_event) {
if (selection_controller_) {
- switch (input_event.type) {
- case blink::WebInputEvent::GestureLongPress:
- selection_controller_->OnLongPressEvent();
- break;
- case blink::WebInputEvent::GestureTap:
- selection_controller_->OnTapEvent();
- break;
- default:
- break;
+ if (input_event.type == blink::WebInputEvent::GestureLongPress) {
+ const blink::WebGestureEvent& longpress =
+ static_cast<const blink::WebGestureEvent&>(input_event);
+ selection_controller_->OnLongPressEvent(
+ gfx::PointF(longpress.x, longpress.y));
+ } else if (input_event.type == blink::WebInputEvent::GestureTap) {
+ selection_controller_->OnTapEvent();
}
}
« no previous file with comments | « no previous file | ui/touch_selection/touch_selection_controller.h » ('j') | ui/touch_selection/touch_selection_controller.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698