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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 850443002: Scroll Customization Prototype (Not for review, WIP) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase / cleanup / minor bug fixes Created 5 years, 10 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 | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebInputEventConversionTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 5312dcdbdfd33254c2ee3bda5d186fc542e7e017..60316bd510b820d429b220340cc748edf3f648f6 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -653,18 +653,22 @@ bool WebViewImpl::scrollBy(const WebFloatSize& delta, const WebFloatSize& veloci
if (m_page && m_page->mainFrame() && m_page->mainFrame()->isLocalFrame() && m_page->deprecatedLocalMainFrame()->view())
return handleMouseWheel(*m_page->deprecatedLocalMainFrame(), syntheticWheel);
} else {
+ m_lastScrollVelocity = velocity;
WebGestureEvent syntheticGestureEvent;
syntheticGestureEvent.type = WebInputEvent::GestureScrollUpdate;
syntheticGestureEvent.data.scrollUpdate.preventPropagation = true;
syntheticGestureEvent.data.scrollUpdate.deltaX = delta.width;
syntheticGestureEvent.data.scrollUpdate.deltaY = delta.height;
+ syntheticGestureEvent.data.scrollUpdate.velocityX = velocity.width;
+ syntheticGestureEvent.data.scrollUpdate.velocityY = velocity.height;
syntheticGestureEvent.x = m_positionOnFlingStart.x;
syntheticGestureEvent.y = m_positionOnFlingStart.y;
syntheticGestureEvent.globalX = m_globalPositionOnFlingStart.x;
syntheticGestureEvent.globalY = m_globalPositionOnFlingStart.y;
syntheticGestureEvent.modifiers = m_flingModifier;
syntheticGestureEvent.sourceDevice = WebGestureDeviceTouchscreen;
+ syntheticGestureEvent.data.scrollUpdate.inertial = true;
if (m_page && m_page->mainFrame() && m_page->mainFrame()->isLocalFrame() && m_page->deprecatedLocalMainFrame()->view())
return handleGestureEvent(syntheticGestureEvent);
@@ -1935,7 +1939,8 @@ void WebViewImpl::beginFrame(const WebBeginFrameArgs& frameTime)
PlatformGestureEvent endScrollEvent(PlatformEvent::GestureScrollEnd,
m_positionOnFlingStart, m_globalPositionOnFlingStart,
IntSize(), 0, false, false, false, false,
- 0, 0, 0, 0, false);
+ 0, 0, m_lastScrollVelocity.width, m_lastScrollVelocity.height, false, true);
+ m_lastScrollVelocity = FloatSize(0, 0);
mainFrameImpl()->frame()->eventHandler().handleGestureScrollEnd(endScrollEvent);
}
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebInputEventConversionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698