summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraurimas@google.com <aurimas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-15 00:45:33 +0000
committeraurimas@google.com <aurimas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-15 00:45:33 +0000
commit420164789fe3ea4655944dc077ac6718b0074d29 (patch)
tree03221b35dc5beb3111df9993880e8bbb2b42d7ef
parent3c9bc55babeaf90be1c24f27d4abd61de1b681b1 (diff)
downloadchromium_src-420164789fe3ea4655944dc077ac6718b0074d29.zip
chromium_src-420164789fe3ea4655944dc077ac6718b0074d29.tar.gz
chromium_src-420164789fe3ea4655944dc077ac6718b0074d29.tar.bz2
Merge 199851 "[Android] Fix AdapterInputConnection#finishComposi..."
> [Android] Fix AdapterInputConnection#finishComposingText() > > The previous fix https://chromiumcodereview.appspot.com/13996027 > did not fix the case when commitComposition("\n") is called right > after finishComposingText(). It is caused by a bug in Blink crbug.com/237715. > > This will work until the Blink crbug.com/239923 gets implemented. > > TEST=updated ImeTest#testFinishComposingText() > BUG=237480 > NOTRY=true > > Review URL: https://chromiumcodereview.appspot.com/15141006 TBR=aurimas@chromium.org Review URL: https://codereview.chromium.org/14918007 git-svn-id: svn://svn.chromium.org/chrome/branches/1453/src@200126 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java b/content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java
index 933dd20..093582b 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java
@@ -689,13 +689,16 @@ class ImeAdapter {
if (getComposingSpanStart(editable) == getComposingSpanEnd(editable)) {
return true;
}
+ int selectionStart = Selection.getSelectionStart(editable);
+ int compositionStart = getComposingSpanStart(editable);
super.finishComposingText();
beginBatchEdit();
- int selectionStart = Selection.getSelectionStart(editable);
- int selectionEnd = Selection.getSelectionEnd(editable);
+ if (compositionStart != -1 && compositionStart < selectionStart
+ && !mImeAdapter.setComposingRegion(compositionStart, selectionStart)) {
+ return false;
+ }
if (!mImeAdapter.checkCompositionQueueAndCallNative("", 0, true)) return false;
- if (!mImeAdapter.setEditableSelectionOffsets(selectionStart, selectionEnd)) return false;
endBatchEdit();
return true;
}