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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 1251323002: Plumb smooth scrolling in Chromium compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 974f69353e715413a06e07cd2a46528d41c74b49..fec7756f42d916fe7ba13dfac780588306f3039f 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -1244,8 +1244,7 @@ public class ContentViewCore implements
}
public boolean isScrollInProgress() {
- return mTouchScrollInProgress || mPotentiallyActiveFlingCount > 0
- || getContentViewClient().isExternalScrollActive();
+ return mTouchScrollInProgress || mPotentiallyActiveFlingCount > 0;
}
@SuppressWarnings("unused")
@@ -1354,6 +1353,13 @@ public class ContentViewCore implements
nativeFlingStart(mNativeContentViewCore, timeMs, 0, 0, velocityX, velocityY, true);
}
+ public void smoothScroll(long timeMs, int startX, int startY, int dx, int dy, long durationMs) {
+ if (mNativeContentViewCore == 0) return;
+ nativeFlingCancel(mNativeContentViewCore, timeMs);
+ nativeScrollBegin(mNativeContentViewCore, timeMs, startX, startY, -dx, -dy, true);
+ nativeSmoothScrollStart(mNativeContentViewCore, timeMs, startX, startY, dx, dy, durationMs);
+ }
+
/**
* Cancel any fling gestures active.
* @param timeMs Current time (in milliseconds).
@@ -1395,9 +1401,6 @@ public class ContentViewCore implements
computeVerticalScrollOffset(),
computeVerticalScrollExtent());
break;
- case GestureEventType.FLING_CANCEL:
- listener.onFlingCancelGesture();
- break;
case GestureEventType.SCROLL_START:
listener.onScrollStarted(
computeVerticalScrollOffset(),
@@ -3247,6 +3250,9 @@ public class ContentViewCore implements
private native void nativeFlingCancel(long nativeContentViewCoreImpl, long timeMs);
+ private native void nativeSmoothScrollStart(long nativeContentViewCoreImpl, long timeMs,
+ float startX, float startY, float dx, float dy, long durationMs);
+
private native void nativeSingleTap(
long nativeContentViewCoreImpl, long timeMs, float x, float y);

Powered by Google App Engine
This is Rietveld 408576698