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

Unified Diff: WebCore/platform/Scrollbar.cpp

Issue 3364013: Merge 67001 - 2010-09-08 Peter Kasting <pkasting@google.com>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 3 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 | « WebCore/platform/Scrollbar.h ('k') | WebCore/platform/ScrollbarClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/platform/Scrollbar.cpp
===================================================================
--- WebCore/platform/Scrollbar.cpp (revision 67003)
+++ WebCore/platform/Scrollbar.cpp (working copy)
@@ -101,12 +101,12 @@
m_theme->unregisterScrollbar(this);
}
-bool Scrollbar::setValue(int v)
+bool Scrollbar::setValue(int v, ScrollSource source)
{
v = max(min(v, m_totalSize - m_visibleSize), 0);
if (value() == v)
return false; // Our value stayed the same.
- setCurrentPos(v);
+ setCurrentPos(v, source);
return true;
}
@@ -154,8 +154,10 @@
}
if (direction == ScrollUp || direction == ScrollLeft)
multiplier = -multiplier;
+ if (client())
+ return client()->scroll(m_orientation, granularity, step, multiplier);
- return setCurrentPos(max(min(m_currentPos + (step * multiplier), static_cast<float>(m_totalSize - m_visibleSize)), 0.0f));
+ return setCurrentPos(max(min(m_currentPos + (step * multiplier), static_cast<float>(m_totalSize - m_visibleSize)), 0.0f), NotFromScrollAnimator);
}
void Scrollbar::updateThumb()
@@ -287,11 +289,14 @@
else if (delta < 0)
delta = max(-thumbPos, delta);
if (delta)
- setCurrentPos(static_cast<float>(thumbPos + delta) * maximum() / (trackLen - thumbLen));
+ setCurrentPos(static_cast<float>(thumbPos + delta) * maximum() / (trackLen - thumbLen), NotFromScrollAnimator);
}
-bool Scrollbar::setCurrentPos(float pos)
+bool Scrollbar::setCurrentPos(float pos, ScrollSource source)
{
+ if ((source != FromScrollAnimator) && client())
+ client()->setScrollPositionAndStopAnimation(m_orientation, pos);
+
if (pos == m_currentPos)
return false;
@@ -336,7 +341,7 @@
{
if (m_pressedPart == ThumbPart) {
if (theme()->shouldSnapBackToDragOrigin(this, evt))
- setCurrentPos(m_dragOrigin);
+ setCurrentPos(m_dragOrigin, NotFromScrollAnimator);
else {
moveThumb(m_orientation == HorizontalScrollbar ?
convertFromContainingWindow(evt.pos()).x() :
« no previous file with comments | « WebCore/platform/Scrollbar.h ('k') | WebCore/platform/ScrollbarClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698