| Index: third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
|
| diff --git a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
|
| index 516eed533a8be643ee4b9a1c0b32f7df95180df5..2d7adf6ec53e962f116ed486f9156abcf0d7238e 100644
|
| --- a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
|
| +++ b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
|
| @@ -27,13 +27,13 @@
|
|
|
| #include <algorithm>
|
| #include "platform/HostWindow.h"
|
| -#include "platform/PlatformGestureEvent.h"
|
| #include "platform/PlatformMouseEvent.h"
|
| #include "platform/geometry/FloatRect.h"
|
| #include "platform/graphics/paint/CullRect.h"
|
| #include "platform/scroll/ScrollAnimatorBase.h"
|
| #include "platform/scroll/ScrollableArea.h"
|
| #include "platform/scroll/ScrollbarTheme.h"
|
| +#include "public/platform/WebGestureEvent.h"
|
|
|
| namespace blink {
|
|
|
| @@ -320,25 +320,27 @@ void Scrollbar::setPressedPart(ScrollbarPart part) {
|
| m_pressedPart = part;
|
| }
|
|
|
| -bool Scrollbar::gestureEvent(const PlatformGestureEvent& evt,
|
| +bool Scrollbar::gestureEvent(const WebGestureEvent& evt,
|
| bool* shouldUpdateCapture) {
|
| DCHECK(shouldUpdateCapture);
|
| - switch (evt.type()) {
|
| - case PlatformEvent::GestureTapDown:
|
| - setPressedPart(theme().hitTest(*this, evt.position()));
|
| + switch (evt.type) {
|
| + case WebInputEvent::GestureTapDown: {
|
| + IntPoint position = flooredIntPoint(evt.positionInRootFrame());
|
| + setPressedPart(theme().hitTest(*this, position));
|
| m_pressedPos = orientation() == HorizontalScrollbar
|
| - ? convertFromRootFrame(evt.position()).x()
|
| - : convertFromRootFrame(evt.position()).y();
|
| + ? convertFromRootFrame(position).x()
|
| + : convertFromRootFrame(position).y();
|
| *shouldUpdateCapture = true;
|
| return true;
|
| - case PlatformEvent::GestureTapDownCancel:
|
| + }
|
| + case WebInputEvent::GestureTapCancel:
|
| if (m_pressedPart != ThumbPart)
|
| return false;
|
| m_scrollPos = m_pressedPos;
|
| return true;
|
| - case PlatformEvent::GestureScrollBegin:
|
| - switch (evt.source()) {
|
| - case PlatformGestureSourceTouchpad:
|
| + case WebInputEvent::GestureScrollBegin:
|
| + switch (evt.sourceDevice) {
|
| + case WebGestureDeviceTouchpad:
|
| // Update the state on GSB for touchpad since GestureTapDown
|
| // is not generated by that device. Touchscreen uses the tap down
|
| // gesture since the scrollbar enters a visual active state.
|
| @@ -346,7 +348,7 @@ bool Scrollbar::gestureEvent(const PlatformGestureEvent& evt,
|
| setPressedPart(NoPart);
|
| m_pressedPos = 0;
|
| return true;
|
| - case PlatformGestureSourceTouchscreen:
|
| + case WebGestureDeviceTouchscreen:
|
| if (m_pressedPart != ThumbPart)
|
| return false;
|
| m_scrollPos = m_pressedPos;
|
| @@ -356,22 +358,25 @@ bool Scrollbar::gestureEvent(const PlatformGestureEvent& evt,
|
| return true;
|
| }
|
| break;
|
| - case PlatformEvent::GestureScrollUpdate:
|
| - switch (evt.source()) {
|
| - case PlatformGestureSourceTouchpad: {
|
| - FloatSize delta(-evt.deltaX(), -evt.deltaY());
|
| + case WebInputEvent::GestureScrollUpdate:
|
| + switch (evt.sourceDevice) {
|
| + case WebGestureDeviceTouchpad: {
|
| + FloatSize delta(-evt.deltaXInRootFrame(), -evt.deltaYInRootFrame());
|
| if (m_scrollableArea &&
|
| - m_scrollableArea->userScroll(evt.deltaUnits(), delta)
|
| + m_scrollableArea
|
| + ->userScroll(toPlatformScrollGranularity(evt.deltaUnits()),
|
| + delta)
|
| .didScroll()) {
|
| return true;
|
| }
|
| return false;
|
| }
|
| - case PlatformGestureSourceTouchscreen:
|
| + case WebGestureDeviceTouchscreen:
|
| if (m_pressedPart != ThumbPart)
|
| return false;
|
| - m_scrollPos += orientation() == HorizontalScrollbar ? evt.deltaX()
|
| - : evt.deltaY();
|
| + m_scrollPos += orientation() == HorizontalScrollbar
|
| + ? evt.deltaXInRootFrame()
|
| + : evt.deltaYInRootFrame();
|
| moveThumb(m_scrollPos, false);
|
| return true;
|
| default:
|
| @@ -379,14 +384,14 @@ bool Scrollbar::gestureEvent(const PlatformGestureEvent& evt,
|
| return true;
|
| }
|
| break;
|
| - case PlatformEvent::GestureScrollEnd:
|
| - case PlatformEvent::GestureLongPress:
|
| - case PlatformEvent::GestureFlingStart:
|
| + case WebInputEvent::GestureScrollEnd:
|
| + case WebInputEvent::GestureLongPress:
|
| + case WebInputEvent::GestureFlingStart:
|
| m_scrollPos = 0;
|
| m_pressedPos = 0;
|
| setPressedPart(NoPart);
|
| return false;
|
| - case PlatformEvent::GestureTap: {
|
| + case WebInputEvent::GestureTap: {
|
| if (m_pressedPart != ThumbPart && m_pressedPart != NoPart &&
|
| m_scrollableArea &&
|
| m_scrollableArea
|
|
|