summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp')
-rw-r--r--Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp b/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp
index 408f1264f..40c151dfd 100644
--- a/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp
+++ b/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp
@@ -81,6 +81,11 @@ WebCompositorInputHandlerImpl::WebCompositorInputHandlerImpl(CCInputHandlerClien
: m_client(0)
, m_identifier(s_nextAvailableIdentifier++)
, m_inputHandlerClient(inputHandlerClient)
+#ifndef NDEBUG
+ , m_expectScrollUpdateEnd(false)
+ , m_expectPinchUpdateEnd(false)
+#endif
+ , m_scrollStarted(false)
{
ASSERT(CCProxy::isImplThread());
@@ -131,6 +136,66 @@ void WebCompositorInputHandlerImpl::handleInputEvent(const WebInputEvent& event)
case CCInputHandlerClient::ScrollFailed:
break;
}
+ } else if (event.type == WebInputEvent::GestureScrollBegin) {
+ ASSERT(!m_scrollStarted);
+ ASSERT(!m_expectScrollUpdateEnd);
+#ifndef NDEBUG
+ m_expectScrollUpdateEnd = true;
+#endif
+ const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent*>(&event);
+ CCInputHandlerClient::ScrollStatus scrollStatus = m_inputHandlerClient->scrollBegin(IntPoint(gestureEvent.x, gestureEvent.y));
+ switch (scrollStatus) {
+ case CCInputHandlerClient::ScrollStarted:
+ m_scrollStarted = true;
+ m_client->didHandleInputEvent();
+ return;
+ case CCInputHandlerClient::ScrollIgnored:
+ m_client->didNotHandleInputEvent(false /* sendToWidget */);
+ return;
+ case CCInputHandlerClient::ScrollFailed:
+ break;
+ }
+ } else if (event.type == WebInputEvent::GestureScrollUpdate) {
+ ASSERT(m_expectScrollUpdateEnd);
+ if (m_scrollStarted) {
+ const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent*>(&event);
+ m_inputHandlerClient->scrollBy(IntSize(-gestureEvent.deltaX, -gestureEvent.deltaY));
+ m_client->didHandleInputEvent();
+ return;
+ }
+ } else if (event.type == WebInputEvent::GestureScrollEnd) {
+ ASSERT(m_expectScrollUpdateEnd);
+#ifndef NDEBUG
+ m_expectScrollUpdateEnd = false;
+#endif
+ if (m_scrollStarted) {
+ m_inputHandlerClient->scrollEnd();
+ m_client->didHandleInputEvent();
+ m_scrollStarted = false;
+ return;
+ }
+ } else if (event.type == WebInputEvent::GesturePinchBegin) {
+ ASSERT(!m_expectPinchUpdateEnd);
+#ifndef NDEBUG
+ m_expectPinchUpdateEnd = true;
+#endif
+ m_inputHandlerClient->pinchGestureBegin();
+ m_client->didHandleInputEvent();
+ return;
+ } else if (event.type == WebInputEvent::GesturePinchEnd) {
+ ASSERT(m_expectPinchUpdateEnd);
+#ifndef NDEBUG
+ m_expectPinchUpdateEnd = false;
+#endif
+ m_inputHandlerClient->pinchGestureEnd();
+ m_client->didHandleInputEvent();
+ return;
+ } else if (event.type == WebInputEvent::GesturePinchUpdate) {
+ ASSERT(m_expectPinchUpdateEnd);
+ const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent*>(&event);
+ m_inputHandlerClient->pinchGestureUpdate(gestureEvent.deltaX, IntPoint(gestureEvent.x, gestureEvent.y));
+ m_client->didHandleInputEvent();
+ return;
}
m_client->didNotHandleInputEvent(true /* sendToWidget */);
}