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

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

Issue 1102933003: [Contextual Search] Add support for tap on the selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved implementation methods to match declaration order. Used INACTIVE for active_status_ state ch… 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.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dc4df92d7e2d28820ae34f3511e6bf558ea618e5..2d41d0879d14ee457bb269722103664aacbb3dad 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -1582,16 +1582,17 @@ 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 (selection_controller_ &&
+ blink::WebInputEvent::isGestureEventType(input_event.type)) {
+ const blink::WebGestureEvent& gesture_event =
+ static_cast<const blink::WebGestureEvent&>(input_event);
+ gfx::PointF gesture_location(gesture_event.x, gesture_event.y);
+ if (input_event.type == blink::WebInputEvent::GestureLongPress) {
+ if (selection_controller_->WillHandleLongPressEvent(gesture_location))
+ return INPUT_EVENT_ACK_STATE_CONSUMED;
+ } else if (input_event.type == blink::WebInputEvent::GestureTap) {
+ if (selection_controller_->WillHandleTapEvent(gesture_location))
+ return INPUT_EVENT_ACK_STATE_CONSUMED;
}
}
« no previous file with comments | « no previous file | ui/touch_selection/touch_selection_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698