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

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

Issue 67383002: Initial browser-side implementation for touch-action (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update for new blink API - no touch ID for now Created 7 years, 1 month 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/immediate_input_router.cc
diff --git a/content/browser/renderer_host/input/immediate_input_router.cc b/content/browser/renderer_host/input/immediate_input_router.cc
index a52c0ee90428238e9ea58c073bb33c0b28a8a08d..deebd33b5b18ecaee443a7c294a58b8d3de8ac1e 100644
--- a/content/browser/renderer_host/input/immediate_input_router.cc
+++ b/content/browser/renderer_host/input/immediate_input_router.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"
@@ -180,6 +181,9 @@ void ImmediateInputRouter::SendKeyboardEvent(
void ImmediateInputRouter::SendGestureEvent(
const GestureEventWithLatencyInfo& gesture_event) {
+ if (touch_action_filter_.FilterGestureEvent(gesture_event.event))
+ return;
+
HandleGestureScroll(gesture_event);
if (!IsInOverscrollGesture() &&
@@ -255,6 +259,8 @@ bool ImmediateInputRouter::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()
@@ -474,6 +480,14 @@ void ImmediateInputRouter::OnHasTouchEventHandlers(bool has_handlers) {
client_->OnHasTouchEventHandlers(has_handlers);
}
+void ImmediateInputRouter::OnSetTouchAction(
+ content::TouchAction touch_action) {
+ // Synthetic touchsstart events should get filtered out in RenderWidget.
sadrul 2013/11/20 23:28:30 *touchstart
Rick Byers 2013/11/21 02:37:36 Done.
+ DCHECK(touch_event_queue_->IsPendingAckTouchStart());
+
+ touch_action_filter_.OnSetTouchAction(touch_action);
+}
+
void ImmediateInputRouter::ProcessInputEventAck(
WebInputEvent::Type event_type,
InputEventAckState ack_result,

Powered by Google App Engine
This is Rietveld 408576698