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..bcd2b56d28fbd008254afb96ba140b77b23959ad 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 target_x, |
+ jint target_y, |
+ jlong duration_ms) { |
+ 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(), |
+ target_x / scale_factor, |
+ target_y / scale_factor, duration_ms)); |
+} |
+ |
void WebContentsAndroid::SelectWordAroundCaret(JNIEnv* env, jobject obj) { |
RenderViewHost* host = web_contents_->GetRenderViewHost(); |
if (!host) |