diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-09 14:16:12 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-09 14:16:12 +0100 |
commit | 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (patch) | |
tree | 52599cd0ab782b1768e23ad176f7618f98333cb6 /Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp | |
parent | cd44dc59cdfc39534aef4d417e9f3c412e3be139 (diff) | |
download | qtwebkit-03e12282df9aa1e1fb05a8b90f1cfc2e08764cec.tar.gz |
Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223)
Diffstat (limited to 'Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp')
-rw-r--r-- | Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp | 65 |
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 */); } |