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

Unified Diff: sky/engine/platform/scroll/ScrollAnimator.cpp

Issue 870073003: Remove mouse events from Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
Index: sky/engine/platform/scroll/ScrollAnimator.cpp
diff --git a/sky/engine/platform/scroll/ScrollAnimator.cpp b/sky/engine/platform/scroll/ScrollAnimator.cpp
index ed7d7a939d9857a45030cb310871c0e01d8a15ce..d8a42e179c68f57b17cb03394bae1123e266ab80 100644
--- a/sky/engine/platform/scroll/ScrollAnimator.cpp
+++ b/sky/engine/platform/scroll/ScrollAnimator.cpp
@@ -74,53 +74,6 @@ void ScrollAnimator::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
notifyPositionChanged();
}
-bool ScrollAnimator::handleWheelEvent(const PlatformWheelEvent& e)
-{
- bool canScrollX = m_scrollableArea->userInputScrollable(HorizontalScrollbar);
- bool canScrollY = m_scrollableArea->userInputScrollable(VerticalScrollbar);
-
- // Accept the event if we are scrollable in that direction and can still
- // scroll any further.
- float deltaX = canScrollX ? e.deltaX() : 0;
- float deltaY = canScrollY ? e.deltaY() : 0;
-
- bool handled = false;
-
- ScrollGranularity granularity = e.hasPreciseScrollingDeltas() ? ScrollByPrecisePixel : ScrollByPixel;
-
- IntSize maxForwardScrollDelta = m_scrollableArea->maximumScrollPosition() - m_scrollableArea->scrollPosition();
- IntSize maxBackwardScrollDelta = m_scrollableArea->scrollPosition() - m_scrollableArea->minimumScrollPosition();
- if ((deltaX < 0 && maxForwardScrollDelta.width() > 0)
- || (deltaX > 0 && maxBackwardScrollDelta.width() > 0)
- || (deltaY < 0 && maxForwardScrollDelta.height() > 0)
- || (deltaY > 0 && maxBackwardScrollDelta.height() > 0)) {
- handled = true;
-
- if (deltaY) {
- if (e.granularity() == ScrollByPageWheelEvent) {
- bool negative = deltaY < 0;
- deltaY = m_scrollableArea->pageStep(VerticalScrollbar);
- if (negative)
- deltaY = -deltaY;
- }
-
- scroll(VerticalScrollbar, granularity, m_scrollableArea->pixelStep(VerticalScrollbar), -deltaY);
- }
-
- if (deltaX) {
- if (e.granularity() == ScrollByPageWheelEvent) {
- bool negative = deltaX < 0;
- deltaX = m_scrollableArea->pageStep(HorizontalScrollbar);
- if (negative)
- deltaX = -deltaX;
- }
-
- scroll(HorizontalScrollbar, granularity, m_scrollableArea->pixelStep(HorizontalScrollbar), -deltaX);
- }
- }
- return handled;
-}
-
void ScrollAnimator::setCurrentPosition(const FloatPoint& position)
{
m_currentPosX = position.x();

Powered by Google App Engine
This is Rietveld 408576698