| Index: content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java b/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
|
| index c955ac358cd3284de50d212ebf8d86a3962ee86c..9162eeb3bcac4be2b3950625da0e075b21a77a84 100644
|
| --- a/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
|
| @@ -15,7 +15,10 @@ import android.text.style.UnderlineSpan;
|
| import android.view.KeyCharacterMap;
|
| import android.view.KeyEvent;
|
| import android.view.View;
|
| +import android.view.inputmethod.CursorAnchorInfo;
|
| import android.view.inputmethod.EditorInfo;
|
| +import android.view.inputmethod.InputConnection;
|
| +import android.view.inputmethod.InputMethodManager;
|
|
|
| import org.chromium.base.CalledByNative;
|
| import org.chromium.base.JNINamespace;
|
| @@ -560,6 +563,17 @@ public class ImeAdapter {
|
| }
|
|
|
| /**
|
| + * Send a request to the native counterpart to call back
|
| + * {@link InputMethodManager#updateCursorAnchorInfo(View, CursorAnchorInfo)} when necessary.
|
| + * @param cursorUpdateMode The flag passed to {@link InputConnection#requestCursorUpdates(int)}.
|
| + * @return Whether the native counterpart of ImeAdapter received the call.
|
| + */
|
| + boolean requestCursorUpdates(int cursorUpdateMode) {
|
| + if (mNativeImeAdapterAndroid == 0) return false;
|
| + return nativeRequestCursorUpdates(mNativeImeAdapterAndroid, cursorUpdateMode);
|
| + }
|
| +
|
| + /**
|
| * Send a request to the native counterpart to unselect text.
|
| * @return Whether the native counterpart of ImeAdapter received the call.
|
| */
|
| @@ -617,6 +631,14 @@ public class ImeAdapter {
|
| }
|
|
|
| @CalledByNative
|
| + private void updateCursorAnchorInfo(Object cursorAnchorInfo) {
|
| + if (cursorAnchorInfo instanceof CursorAnchorInfo) {
|
| + mInputMethodManagerWrapper.updateCursorAnchorInfo(mViewEmbedder.getAttachedView(),
|
| + (CursorAnchorInfo) cursorAnchorInfo);
|
| + }
|
| + }
|
| +
|
| + @CalledByNative
|
| private void populateUnderlinesFromSpans(CharSequence text, long underlines) {
|
| if (!(text instanceof SpannableString)) return;
|
|
|
| @@ -680,6 +702,9 @@ public class ImeAdapter {
|
| private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid,
|
| int before, int after);
|
|
|
| + private native boolean nativeRequestCursorUpdates(long nativeImeAdapterAndroid,
|
| + int cursorUpdateMode);
|
| +
|
| private native void nativeUnselect(long nativeImeAdapterAndroid);
|
| private native void nativeSelectAll(long nativeImeAdapterAndroid);
|
| private native void nativeCut(long nativeImeAdapterAndroid);
|
|
|