Chromium Code Reviews| 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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 605 /** | 605 /** |
| 606 * Send a request to the native counterpart of ImeAdapter to paste the text from the clipboard. | 606 * Send a request to the native counterpart of ImeAdapter to paste the text from the clipboard. |
| 607 * @return Whether the native counterpart of ImeAdapter received the call. | 607 * @return Whether the native counterpart of ImeAdapter received the call. |
| 608 */ | 608 */ |
| 609 public boolean paste() { | 609 public boolean paste() { |
| 610 if (mNativeImeAdapterAndroid == 0) return false; | 610 if (mNativeImeAdapterAndroid == 0) return false; |
| 611 nativePaste(mNativeImeAdapterAndroid); | 611 nativePaste(mNativeImeAdapterAndroid); |
| 612 return true; | 612 return true; |
| 613 } | 613 } |
| 614 | 614 |
| 615 /** | |
| 616 * Advances the focus to next input field in the current form. | |
| 617 * | |
| 618 * @param direction indicates whether to advance forward or backward directi on. | |
| 619 */ | |
| 620 public void advanceFocusToNextInputField(boolean direction) { | |
|
bcwhite
2015/04/13 16:51:34
direction -> forward (here and elsewhere)
AKV
2015/04/13 18:35:46
Done.
| |
| 621 if (mNativeImeAdapterAndroid == 0) return; | |
| 622 nativeAdvanceFocusToNextInputField(mNativeImeAdapterAndroid, direction); | |
| 623 } | |
| 624 | |
| 615 // Calls from C++ to Java | 625 // Calls from C++ to Java |
| 616 | 626 |
| 617 @CalledByNative | 627 @CalledByNative |
| 618 private void focusedNodeChanged(boolean isEditable) { | 628 private void focusedNodeChanged(boolean isEditable) { |
| 619 if (mInputConnection != null && isEditable) mInputConnection.restartInpu t(); | 629 if (mInputConnection != null && isEditable) mInputConnection.restartInpu t(); |
| 620 } | 630 } |
| 621 | 631 |
| 622 @CalledByNative | 632 @CalledByNative |
| 623 private void populateUnderlinesFromSpans(CharSequence text, long underlines) { | 633 private void populateUnderlinesFromSpans(CharSequence text, long underlines) { |
| 624 if (!(text instanceof SpannableString)) return; | 634 if (!(text instanceof SpannableString)) return; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 679 | 689 |
| 680 private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid , | 690 private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid , |
| 681 int before, int after); | 691 int before, int after); |
| 682 | 692 |
| 683 private native void nativeUnselect(long nativeImeAdapterAndroid); | 693 private native void nativeUnselect(long nativeImeAdapterAndroid); |
| 684 private native void nativeSelectAll(long nativeImeAdapterAndroid); | 694 private native void nativeSelectAll(long nativeImeAdapterAndroid); |
| 685 private native void nativeCut(long nativeImeAdapterAndroid); | 695 private native void nativeCut(long nativeImeAdapterAndroid); |
| 686 private native void nativeCopy(long nativeImeAdapterAndroid); | 696 private native void nativeCopy(long nativeImeAdapterAndroid); |
| 687 private native void nativePaste(long nativeImeAdapterAndroid); | 697 private native void nativePaste(long nativeImeAdapterAndroid); |
| 688 private native void nativeResetImeAdapter(long nativeImeAdapterAndroid); | 698 private native void nativeResetImeAdapter(long nativeImeAdapterAndroid); |
| 699 private native void nativeAdvanceFocusToNextInputField( | |
| 700 long nativeImeAdapterAndroid, boolean direction); | |
| 689 } | 701 } |
| OLD | NEW |