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

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: 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 8bfa8b2fb88b2f835df484e7a14d67da0943b3c8..c0c74d087f0042fb6f8e1db519eae3cb133e7d7d 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -1643,15 +1643,16 @@ 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;
+ const blink::WebGestureEvent& gesture_event =
jdduke (slow) 2015/05/01 20:52:06 Hmm, this cast isn't safe for non-gesture events.
Donn Denman 2015/05/01 22:46:03 Done.
+ 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)) {
jdduke (slow) 2015/05/01 20:52:06 Nit: No need for braces for this if conditional.
Donn Denman 2015/05/01 22:46:03 Done.
+ 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') | ui/touch_selection/touch_selection_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698