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

Unified Diff: Source/platform/scroll/ScrollAnimator.cpp

Issue 1158673006: Replace various ScrollableArea scroll methods with setScrollPosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Build fix Created 5 years, 6 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/platform/scroll/ScrollAnimator.h ('k') | Source/platform/scroll/ScrollAnimatorNone.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ScrollAnimator.cpp
diff --git a/Source/platform/scroll/ScrollAnimator.cpp b/Source/platform/scroll/ScrollAnimator.cpp
index ba1c3023b74767b1b77b417bd22e36aa68e8f907..b755a7e29c9e3fe7246570701aa3f307307e12b1 100644
--- a/Source/platform/scroll/ScrollAnimator.cpp
+++ b/Source/platform/scroll/ScrollAnimator.cpp
@@ -60,16 +60,16 @@ ScrollResultOneDimensional ScrollAnimator::userScroll(ScrollbarOrientation orien
float usedDelta = (newPos - currentPos) / step;
currentPos = newPos;
- notifyPositionChanged();
+ notifyPositionChanged(UserScroll);
return ScrollResultOneDimensional(true, delta - usedDelta);
}
-void ScrollAnimator::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
+void ScrollAnimator::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollType scrollType)
{
m_currentPosX = offset.x();
m_currentPosY = offset.y();
- notifyPositionChanged();
+ notifyPositionChanged(scrollType);
}
ScrollResult ScrollAnimator::handleWheelEvent(const PlatformWheelEvent& e)
@@ -154,12 +154,12 @@ FloatPoint ScrollAnimator::currentPosition() const
return FloatPoint(m_currentPosX, m_currentPosY);
}
-void ScrollAnimator::notifyPositionChanged()
+void ScrollAnimator::notifyPositionChanged(ScrollType scrollType)
{
if (!m_scrollableArea->shouldUseIntegerScrollOffset())
- m_scrollableArea->setScrollOffsetFromAnimation(DoublePoint(m_currentPosX, m_currentPosY));
+ m_scrollableArea->setScrollOffsetFromAnimation(DoublePoint(m_currentPosX, m_currentPosY), scrollType);
else
- m_scrollableArea->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_currentPosY));
+ m_scrollableArea->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_currentPosY), scrollType);
}
float ScrollAnimator::clampScrollPosition(ScrollbarOrientation orientation, float pos)
« no previous file with comments | « Source/platform/scroll/ScrollAnimator.h ('k') | Source/platform/scroll/ScrollAnimatorNone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698