Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1324)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java

Issue 1995333002: Handle newCursorPosition correctly for Android's commitText() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adjust selection in confirmCompositionOrInsertText() Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 ade6398bbb375e7330f2b6b55340e0d7d0b206f2..ade77fdd37e98ce97f354d6b81c8b3e8a1478bb0 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
@@ -566,7 +566,7 @@ public class ImeAdapter {
timestampMs, COMPOSITION_KEY_CODE, 0, unicodeFromKeyEvent);
if (isCommit) {
- nativeCommitText(mNativeImeAdapterAndroid, text.toString());
+ nativeCommitText(mNativeImeAdapterAndroid, text.toString(), newCursorPosition);
} else {
nativeSetComposingText(
mNativeImeAdapterAndroid, text, text.toString(), newCursorPosition);
@@ -770,7 +770,8 @@ public class ImeAdapter {
int end, int backgroundColor);
private native void nativeSetComposingText(long nativeImeAdapterAndroid, CharSequence text,
String textStr, int newCursorPosition);
- private native void nativeCommitText(long nativeImeAdapterAndroid, String textStr);
+ private native void nativeCommitText(
+ long nativeImeAdapterAndroid, String textStr, int newCursorPosition);
private native void nativeFinishComposingText(long nativeImeAdapterAndroid);
private native void nativeAttachImeAdapter(long nativeImeAdapterAndroid);
private native void nativeSetEditableSelectionOffsets(long nativeImeAdapterAndroid,

Powered by Google App Engine
This is Rietveld 408576698