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

Unified Diff: content/child/fling_animator_impl_android.cc

Issue 275113002: [Android] Avoid early fling termination if initial time is non-positive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/fling_animator_impl_android.cc
diff --git a/content/child/fling_animator_impl_android.cc b/content/child/fling_animator_impl_android.cc
index 377af483c00bddb4d245f02d22377de497956a74..7583c03772fcf598966ff6178fe4fa2f029d3fd1 100644
--- a/content/child/fling_animator_impl_android.cc
+++ b/content/child/fling_animator_impl_android.cc
@@ -66,6 +66,11 @@ void FlingAnimatorImpl::CancelFling() {
bool FlingAnimatorImpl::apply(double time,
blink::WebGestureCurveTarget* target) {
+ // If the fling has yet to start, simply return and report true to prevent
+ // fling termination.
+ if (time <= 0)
+ return true;
+
const base::TimeTicks time_ticks =
base::TimeTicks() + base::TimeDelta::FromMicroseconds(
time * base::Time::kMicrosecondsPerSecond);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698