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

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

Issue 246293006: Blink Support for Overlay Scrollbar Animation Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix unittest and move unittest to blink_platform_unittests Created 6 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 | « Source/platform/blink_platform.gypi ('k') | Source/platform/scroll/ScrollableArea.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ScrollAnimatorNone.cpp
diff --git a/Source/platform/scroll/ScrollAnimatorNone.cpp b/Source/platform/scroll/ScrollAnimatorNone.cpp
index d018d53809e6ae85a33f00309267d1aa0795f4d3..86fb57f183000db4bbc00aeb26d880e1c65f4d81 100644
--- a/Source/platform/scroll/ScrollAnimatorNone.cpp
+++ b/Source/platform/scroll/ScrollAnimatorNone.cpp
@@ -32,19 +32,24 @@
#include "platform/scroll/ScrollAnimatorNone.h"
-#include <algorithm>
+#include "platform/TraceEvent.h"
#include "platform/scroll/ScrollableArea.h"
#include "wtf/CurrentTime.h"
#include "wtf/PassOwnPtr.h"
+#include <algorithm>
#include "platform/TraceEvent.h"
-namespace blink {
+namespace {
const double kFrameRate = 60;
const double kTickTime = 1 / kFrameRate;
const double kMinimumTimerInterval = .001;
+} // namespace
+
+namespace blink {
+
PassOwnPtr<ScrollAnimator> ScrollAnimator::create(ScrollableArea* scrollableArea)
{
if (scrollableArea && scrollableArea->scrollAnimatorEnabled())
@@ -488,6 +493,7 @@ void ScrollAnimatorNone::animationTimerFired()
double currentTime = WTF::monotonicallyIncreasingTime();
bool continueAnimation = false;
+
if (m_horizontalData.m_startTime && m_horizontalData.animateScroll(currentTime))
continueAnimation = true;
if (m_verticalData.m_startTime && m_verticalData.animateScroll(currentTime))
« no previous file with comments | « Source/platform/blink_platform.gypi ('k') | Source/platform/scroll/ScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698