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

Unified Diff: content/browser/web_contents/web_contents_android.cc

Issue 1251323002: Plumb smooth scrolling in Chromium compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use a blink page scale animation 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/browser/web_contents/web_contents_android.cc
diff --git a/content/browser/web_contents/web_contents_android.cc b/content/browser/web_contents/web_contents_android.cc
index 8fd5c506a2dfb263920e9538108c22af5985d837..17e0204f776f0bc5222a8e3eafeec05a07bd8519 100644
--- a/content/browser/web_contents/web_contents_android.cc
+++ b/content/browser/web_contents/web_contents_android.cc
@@ -393,6 +393,23 @@ void WebContentsAndroid::ScrollFocusedEditableNodeIntoView(
host->GetRoutingID(), gfx::Rect()));
}
+void WebContentsAndroid::SmoothScroll(JNIEnv* env,
+ jobject obj,
+ jint targetX,
+ jint targetY,
jdduke (slow) 2015/07/27 17:15:38 Nit: target_x,target_y,duration_ms
hush (inactive) 2015/07/28 00:10:43 Done.
+ jlong durationMs) {
+ RenderViewHost* host = web_contents_->GetRenderViewHost();
+ if (!host)
+ return;
+
+ ContentViewCoreImpl* contentViewCore =
+ ContentViewCoreImpl::FromWebContents(web_contents_);
+ float scale_factor = contentViewCore->GetScaleFactor();
+ host->Send(new InputMsg_SmoothScroll(host->GetRoutingID(),
+ targetX / scale_factor,
+ targetY / scale_factor, durationMs));
+}
+
void WebContentsAndroid::SelectWordAroundCaret(JNIEnv* env, jobject obj) {
RenderViewHost* host = web_contents_->GetRenderViewHost();
if (!host)

Powered by Google App Engine
This is Rietveld 408576698