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

Unified Diff: Source/platform/mac/ScrollAnimatorMac.mm

Issue 1158673006: Replace various ScrollableArea scroll methods with setScrollPosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase 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
Index: Source/platform/mac/ScrollAnimatorMac.mm
diff --git a/Source/platform/mac/ScrollAnimatorMac.mm b/Source/platform/mac/ScrollAnimatorMac.mm
index 6ab30748bb030c8766b1660684868531208ea12e..3ced5e97d72f9c4134b58ead8403f3947a0ea6ed 100644
--- a/Source/platform/mac/ScrollAnimatorMac.mm
+++ b/Source/platform/mac/ScrollAnimatorMac.mm
@@ -733,10 +733,10 @@ ScrollResultOneDimensional ScrollAnimatorMac::userScroll(ScrollbarOrientation or
return ScrollResultOneDimensional(true, delta - usedDelta);
}
-void ScrollAnimatorMac::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
+void ScrollAnimatorMac::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollType scrollType)
{
[m_scrollAnimationHelper.get() _stopRun];
- immediateScrollTo(offset);
+ immediateScrollTo(offset, scrollType);
}
FloatPoint ScrollAnimatorMac::adjustScrollPositionIfNecessary(const FloatPoint& position) const
@@ -753,7 +753,7 @@ FloatPoint ScrollAnimatorMac::adjustScrollPositionIfNecessary(const FloatPoint&
return FloatPoint(newX, newY);
}
-void ScrollAnimatorMac::immediateScrollTo(const FloatPoint& newPosition)
+void ScrollAnimatorMac::immediateScrollTo(const FloatPoint& newPosition, ScrollType scrollType)
{
FloatPoint adjustedPosition = adjustScrollPositionIfNecessary(newPosition);
@@ -766,13 +766,14 @@ void ScrollAnimatorMac::immediateScrollTo(const FloatPoint& newPosition)
m_currentPosX = adjustedPosition.x();
m_currentPosY = adjustedPosition.y();
notifyContentAreaScrolled(delta);
- notifyPositionChanged();
+ notifyPositionChanged(scrollType);
}
void ScrollAnimatorMac::immediateScrollToPointForScrollAnimation(const FloatPoint& newPosition)
{
+ // TODO(bokan): I'm no ObjC expert but this method's only caller seems to be unused.
skobes 2015/06/04 23:35:47 The caller is passed into NSScrollAnimationHelper,
bokan 2015/06/05 15:15:23 Doesn't look like it, it's one of the CLs I split
ASSERT(m_scrollAnimationHelper);
- immediateScrollTo(newPosition);
+ immediateScrollTo(newPosition, ProgrammaticScroll);
}
void ScrollAnimatorMac::contentAreaWillPaint() const

Powered by Google App Engine
This is Rietveld 408576698