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

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

Issue 67383002: Initial browser-side implementation for touch-action (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweak include for moved synthetic_web_input_event_builders.h Created 7 years 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/input_router_impl.cc
diff --git a/content/browser/renderer_host/input/input_router_impl.cc b/content/browser/renderer_host/input/input_router_impl.cc
index 32f3d89b82f5a57fbdf1271154922bafbbe4668f..3020165910d13da861d09701e49f71a3a2de1a40 100644
--- a/content/browser/renderer_host/input/input_router_impl.cc
+++ b/content/browser/renderer_host/input/input_router_impl.cc
@@ -15,6 +15,7 @@
#include "content/browser/renderer_host/overscroll_controller.h"
#include "content/common/content_constants_internal.h"
#include "content/common/edit_command.h"
+#include "content/common/input/touch_action.h"
#include "content/common/input/web_input_event_traits.h"
#include "content/common/input_messages.h"
#include "content/common/view_messages.h"
@@ -176,6 +177,9 @@ void InputRouterImpl::SendKeyboardEvent(const NativeWebKeyboardEvent& key_event,
void InputRouterImpl::SendGestureEvent(
const GestureEventWithLatencyInfo& gesture_event) {
+ if (touch_action_filter_.FilterGestureEvent(gesture_event.event))
+ return;
+
HandleGestureScroll(gesture_event);
if (!IsInOverscrollGesture() &&
@@ -250,6 +254,8 @@ bool InputRouterImpl::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewHostMsg_SelectRange_ACK, OnSelectRangeAck)
IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers,
OnHasTouchEventHandlers)
+ IPC_MESSAGE_HANDLER(InputHostMsg_SetTouchAction,
+ OnSetTouchAction)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -469,6 +475,14 @@ void InputRouterImpl::OnHasTouchEventHandlers(bool has_handlers) {
client_->OnHasTouchEventHandlers(has_handlers);
}
+void InputRouterImpl::OnSetTouchAction(
+ content::TouchAction touch_action) {
+ // Synthetic touchstart events should get filtered out in RenderWidget.
+ DCHECK(touch_event_queue_->IsPendingAckTouchStart());
+
+ touch_action_filter_.OnSetTouchAction(touch_action);
+}
+
void InputRouterImpl::ProcessInputEventAck(
WebInputEvent::Type event_type,
InputEventAckState ack_result,
« no previous file with comments | « content/browser/renderer_host/input/input_router_impl.h ('k') | content/browser/renderer_host/input/touch_action_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698