Index: third_party/WebKit/Source/web/WebViewImpl.cpp |
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp |
index 27b2257ce476d635243430b6c24a9933cf7077e6..71ded6d99fd611eefd2e2df4b744990ddd37115b 100644 |
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
@@ -437,7 +437,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) |
, m_matchesHeuristicsForGpuRasterization(false) |
, m_recreatingGraphicsContext(false) |
, m_flingModifier(0) |
- , m_flingSourceDevice(false) |
+ , m_flingSourceDevice(WebGestureDeviceUninitialized) |
, m_fullscreenController(FullscreenController::create(this)) |
, m_showFPSCounter(false) |
, m_baseBackgroundColor(Color::white) |
@@ -642,6 +642,7 @@ bool WebViewImpl::handleMouseWheel(LocalFrame& mainFrame, const WebMouseWheelEve |
bool WebViewImpl::scrollBy(const WebFloatSize& delta, const WebFloatSize& velocity) |
{ |
+ ASSERT(m_flingSourceDevice != WebGestureDeviceUninitialized); |
if (m_flingSourceDevice == WebGestureDeviceTouchpad) { |
WebMouseWheelEvent syntheticWheel; |
const float tickDivisor = WheelEvent::TickMultiplier; |
@@ -913,6 +914,7 @@ void WebViewImpl::transferActiveWheelFlingAnimation(const WebActiveWheelFlingPar |
OwnPtr<WebGestureCurve> curve = adoptPtr(Platform::current()->createFlingAnimationCurve(parameters.sourceDevice, WebFloatPoint(parameters.delta), parameters.cumulativeScroll)); |
ASSERT(curve); |
m_gestureAnimation = WebActiveGestureAnimation::createWithTimeOffset(curve.release(), this, parameters.startTime); |
+ m_flingSourceDevice = parameters.sourceDevice; |
scheduleAnimation(); |
} |
@@ -920,6 +922,7 @@ bool WebViewImpl::endActiveFlingAnimation() |
{ |
if (m_gestureAnimation) { |
m_gestureAnimation.clear(); |
+ m_flingSourceDevice = WebGestureDeviceUninitialized; |
if (m_layerTreeView) |
m_layerTreeView->didStopFlinging(); |
return true; |
@@ -1872,9 +1875,10 @@ void WebViewImpl::beginFrame(const WebBeginFrameArgs& frameTime) |
else { |
endActiveFlingAnimation(); |
+ ASSERT(m_flingSourceDevice != WebGestureDeviceUninitialized); |
PlatformGestureEvent endScrollEvent(PlatformEvent::GestureScrollEnd, |
m_positionOnFlingStart, m_globalPositionOnFlingStart, |
- IntSize(), 0, PlatformEvent::NoModifiers); |
+ IntSize(), 0, PlatformEvent::NoModifiers, m_flingSourceDevice == WebGestureDeviceTouchpad ? PlatformGestureSourceTouchpad : PlatformGestureSourceTouchscreen); |
endScrollEvent.setScrollGestureData(0, 0, 0, 0, true, false, -1 /* null plugin id */); |
mainFrameImpl()->frame()->eventHandler().handleGestureScrollEnd(endScrollEvent); |