Chromium Code Reviews| 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) |