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

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

Issue 120513005: [Android] Perform eager gesture recognition on MotionEvents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More testing Created 6 years, 11 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 c1aa70b52ef90ce1733e1576ad58885982f04060..aca1c5801b9212072e22a4d9d578feaefd47d44e 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -1101,28 +1101,18 @@ void RenderWidgetHostViewAndroid::UnhandledWheelEvent(
}
void RenderWidgetHostViewAndroid::GestureEventAck(
- int gesture_event_type,
+ const blink::WebGestureEvent& event,
InputEventAckState ack_result) {
- // Scroll events.
- if (gesture_event_type == blink::WebInputEvent::GestureScrollBegin) {
- content_view_core_->OnScrollBeginEventAck();
- }
- if (gesture_event_type == blink::WebInputEvent::GestureScrollUpdate &&
- ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) {
- content_view_core_->OnScrollUpdateGestureConsumed();
- }
- if (gesture_event_type == blink::WebInputEvent::GestureScrollEnd) {
- content_view_core_->OnScrollEndEventAck();
- }
-
- // Fling events.
- if (gesture_event_type == blink::WebInputEvent::GestureFlingStart) {
- content_view_core_->OnFlingStartEventAck(ack_result);
- }
+ if (content_view_core_)
+ content_view_core_->OnGestureEventAck(event, ack_result);
}
InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent(
const blink::WebInputEvent& input_event) {
+ if (content_view_core_ &&
+ content_view_core_->FilterInputEvent(input_event))
+ return INPUT_EVENT_ACK_STATE_CONSUMED;
+
if (!host_)
return INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
@@ -1241,7 +1231,6 @@ void RenderWidgetHostViewAndroid::SendTouchEvent(
host_->ForwardTouchEventWithLatencyInfo(event, CreateLatencyInfo(event));
}
-
void RenderWidgetHostViewAndroid::SendMouseEvent(
const blink::WebMouseEvent& event) {
if (host_)
@@ -1367,11 +1356,6 @@ void RenderWidgetHostViewAndroid::SetContentViewCore(
if (content_view_core_ && !using_synchronous_compositor_)
content_view_core_->GetWindowAndroid()->AddObserver(this);
}
-
- // Ensure ContentsViewCore is aware of the current touch handling state, eg.
- // in case we've already been running JS for the page as part of preload.
- if (content_view_core_ && host_)
- content_view_core_->HasTouchEventHandlers(host_->has_touch_handler());
}
void RenderWidgetHostViewAndroid::RunAckCallbacks() {
@@ -1383,8 +1367,6 @@ void RenderWidgetHostViewAndroid::RunAckCallbacks() {
void RenderWidgetHostViewAndroid::HasTouchEventHandlers(
bool need_touch_events) {
- if (content_view_core_)
- content_view_core_->HasTouchEventHandlers(need_touch_events);
}
void RenderWidgetHostViewAndroid::OnCompositingDidCommit() {

Powered by Google App Engine
This is Rietveld 408576698