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

Unified Diff: Source/web/WebFrameWidgetImpl.cpp

Issue 1313763004: Support gesture events in WebFrameWidgetImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update Created 5 years, 4 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
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | Source/web/tests/WebFrameTest.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebFrameWidgetImpl.cpp
diff --git a/Source/web/WebFrameWidgetImpl.cpp b/Source/web/WebFrameWidgetImpl.cpp
index bfd1d4968049e1320aaf4c1b00cc30b028791228..9f63725c766a238ffb4bf3503bca08ac163c9004 100644
--- a/Source/web/WebFrameWidgetImpl.cpp
+++ b/Source/web/WebFrameWidgetImpl.cpp
@@ -722,8 +722,33 @@ bool WebFrameWidgetImpl::handleMouseWheel(LocalFrame& mainFrame, const WebMouseW
bool WebFrameWidgetImpl::handleGestureEvent(const WebGestureEvent& event)
{
- // FIXME: Add gesture support.
- return false;
+ bool eventSwallowed = false;
+ bool eventCancelled = false;
+ switch (event.type) {
+ case WebInputEvent::GestureScrollBegin:
+ case WebInputEvent::GestureScrollEnd:
+ case WebInputEvent::GestureScrollUpdate:
+ case WebInputEvent::GestureTap:
+ case WebInputEvent::GestureTapUnconfirmed:
+ case WebInputEvent::GestureTapDown:
+ case WebInputEvent::GestureShowPress:
+ case WebInputEvent::GestureTapCancel:
+ case WebInputEvent::GestureDoubleTap:
+ case WebInputEvent::GestureTwoFingerTap:
+ case WebInputEvent::GestureLongPress:
+ case WebInputEvent::GestureLongTap:
+ break;
+ case WebInputEvent::GestureFlingStart:
+ case WebInputEvent::GestureFlingCancel:
+ m_client->didHandleGestureEvent(event, eventCancelled);
+ return false;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ const LocalFrame* frame = m_localRoot->frame();
dcheng 2015/08/31 16:51:20 Nit: const here looks weird: handling a gesture ev
Peng 2015/08/31 17:34:57 Done.
+ eventSwallowed = frame->eventHandler().handleGestureEvent(PlatformGestureEventBuilder(frame->view(), event));
+ m_client->didHandleGestureEvent(event, eventCancelled);
+ return eventSwallowed;
}
bool WebFrameWidgetImpl::handleKeyEvent(const WebKeyboardEvent& event)
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | Source/web/tests/WebFrameTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698