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

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: Created 4 years, 7 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 d3ece9cf66144a93f5db4c0922a1c24384bfe8f3..3e39026068dc30d99612007ae71f36bde3898376 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
@@ -523,7 +523,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);
@@ -714,7 +714,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