OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/web_contents/web_contents_android.h" | 5 #include "content/browser/web_contents/web_contents_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
386 void WebContentsAndroid::ScrollFocusedEditableNodeIntoView( | 386 void WebContentsAndroid::ScrollFocusedEditableNodeIntoView( |
387 JNIEnv* env, | 387 JNIEnv* env, |
388 jobject obj) { | 388 jobject obj) { |
389 RenderViewHost* host = web_contents_->GetRenderViewHost(); | 389 RenderViewHost* host = web_contents_->GetRenderViewHost(); |
390 if (!host) | 390 if (!host) |
391 return; | 391 return; |
392 host->Send(new InputMsg_ScrollFocusedEditableNodeIntoRect( | 392 host->Send(new InputMsg_ScrollFocusedEditableNodeIntoRect( |
393 host->GetRoutingID(), gfx::Rect())); | 393 host->GetRoutingID(), gfx::Rect())); |
394 } | 394 } |
395 | 395 |
396 void WebContentsAndroid::SmoothScroll(JNIEnv* env, | |
397 jobject obj, | |
398 jint targetX, | |
399 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.
| |
400 jlong durationMs) { | |
401 RenderViewHost* host = web_contents_->GetRenderViewHost(); | |
402 if (!host) | |
403 return; | |
404 | |
405 ContentViewCoreImpl* contentViewCore = | |
406 ContentViewCoreImpl::FromWebContents(web_contents_); | |
407 float scale_factor = contentViewCore->GetScaleFactor(); | |
408 host->Send(new InputMsg_SmoothScroll(host->GetRoutingID(), | |
409 targetX / scale_factor, | |
410 targetY / scale_factor, durationMs)); | |
411 } | |
412 | |
396 void WebContentsAndroid::SelectWordAroundCaret(JNIEnv* env, jobject obj) { | 413 void WebContentsAndroid::SelectWordAroundCaret(JNIEnv* env, jobject obj) { |
397 RenderViewHost* host = web_contents_->GetRenderViewHost(); | 414 RenderViewHost* host = web_contents_->GetRenderViewHost(); |
398 if (!host) | 415 if (!host) |
399 return; | 416 return; |
400 host->SelectWordAroundCaret(); | 417 host->SelectWordAroundCaret(); |
401 } | 418 } |
402 | 419 |
403 void WebContentsAndroid::AdjustSelectionByCharacterOffset(JNIEnv* env, | 420 void WebContentsAndroid::AdjustSelectionByCharacterOffset(JNIEnv* env, |
404 jobject obj, | 421 jobject obj, |
405 jint start_adjust, | 422 jint start_adjust, |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
517 | 534 |
518 void WebContentsAndroid::ResumeMediaSession(JNIEnv* env, jobject obj) { | 535 void WebContentsAndroid::ResumeMediaSession(JNIEnv* env, jobject obj) { |
519 web_contents_->ResumeMediaSession(); | 536 web_contents_->ResumeMediaSession(); |
520 } | 537 } |
521 | 538 |
522 void WebContentsAndroid::SuspendMediaSession(JNIEnv* env, jobject obj) { | 539 void WebContentsAndroid::SuspendMediaSession(JNIEnv* env, jobject obj) { |
523 web_contents_->SuspendMediaSession(); | 540 web_contents_->SuspendMediaSession(); |
524 } | 541 } |
525 | 542 |
526 } // namespace content | 543 } // namespace content |
OLD | NEW |