OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 package org.chromium.content.browser.input; | 5 package org.chromium.content.browser.input; |
6 | 6 |
7 import android.content.res.Configuration; | 7 import android.content.res.Configuration; |
8 import android.os.Handler; | 8 import android.os.Handler; |
9 import android.os.ResultReceiver; | 9 import android.os.ResultReceiver; |
10 import android.os.SystemClock; | 10 import android.os.SystemClock; |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 /** | 602 /** |
603 * Send a request to the native counterpart of ImeAdapter to paste the text
from the clipboard. | 603 * Send a request to the native counterpart of ImeAdapter to paste the text
from the clipboard. |
604 * @return Whether the native counterpart of ImeAdapter received the call. | 604 * @return Whether the native counterpart of ImeAdapter received the call. |
605 */ | 605 */ |
606 public boolean paste() { | 606 public boolean paste() { |
607 if (mNativeImeAdapterAndroid == 0) return false; | 607 if (mNativeImeAdapterAndroid == 0) return false; |
608 nativePaste(mNativeImeAdapterAndroid); | 608 nativePaste(mNativeImeAdapterAndroid); |
609 return true; | 609 return true; |
610 } | 610 } |
611 | 611 |
| 612 /** |
| 613 * Advances the focus to next input field in the current form. |
| 614 * |
| 615 * @param forward indicates whether to advance forward or backward direction
. |
| 616 */ |
| 617 public void advanceFocusInForm(boolean forward) { |
| 618 if (mNativeImeAdapterAndroid == 0) return; |
| 619 nativeAdvanceFocusInForm(mNativeImeAdapterAndroid, forward); |
| 620 } |
| 621 |
612 // Calls from C++ to Java | 622 // Calls from C++ to Java |
613 | 623 |
614 @CalledByNative | 624 @CalledByNative |
615 private void focusedNodeChanged(boolean isEditable) { | 625 private void focusedNodeChanged(boolean isEditable) { |
616 if (mInputConnection != null && isEditable) mInputConnection.restartInpu
t(); | 626 if (mInputConnection != null && isEditable) mInputConnection.restartInpu
t(); |
617 } | 627 } |
618 | 628 |
619 @CalledByNative | 629 @CalledByNative |
620 private void populateUnderlinesFromSpans(CharSequence text, long underlines)
{ | 630 private void populateUnderlinesFromSpans(CharSequence text, long underlines)
{ |
621 if (!(text instanceof SpannableString)) return; | 631 if (!(text instanceof SpannableString)) return; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 | 686 |
677 private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid
, | 687 private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid
, |
678 int before, int after); | 688 int before, int after); |
679 | 689 |
680 private native void nativeUnselect(long nativeImeAdapterAndroid); | 690 private native void nativeUnselect(long nativeImeAdapterAndroid); |
681 private native void nativeSelectAll(long nativeImeAdapterAndroid); | 691 private native void nativeSelectAll(long nativeImeAdapterAndroid); |
682 private native void nativeCut(long nativeImeAdapterAndroid); | 692 private native void nativeCut(long nativeImeAdapterAndroid); |
683 private native void nativeCopy(long nativeImeAdapterAndroid); | 693 private native void nativeCopy(long nativeImeAdapterAndroid); |
684 private native void nativePaste(long nativeImeAdapterAndroid); | 694 private native void nativePaste(long nativeImeAdapterAndroid); |
685 private native void nativeResetImeAdapter(long nativeImeAdapterAndroid); | 695 private native void nativeResetImeAdapter(long nativeImeAdapterAndroid); |
| 696 private native void nativeAdvanceFocusInForm(long nativeImeAdapterAndroid, b
oolean forward); |
686 } | 697 } |
OLD | NEW |