| Index: content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java b/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java
|
| index 2bcd30a2d52d7eeb529e397bd0adee5237b9e1c0..ce538f30de91981503d8b941236a121f04b32e72 100644
|
| --- a/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java
|
| @@ -66,6 +66,20 @@ public class ThreadedInputConnection extends BaseInputConnection
|
| }
|
| };
|
|
|
| + private final Runnable mBeginBatchEdit = new Runnable() {
|
| + @Override
|
| + public void run() {
|
| + mImeAdapter.beginBatchEdit();
|
| + }
|
| + };
|
| +
|
| + private final Runnable mEndBatchEdit = new Runnable() {
|
| + @Override
|
| + public void run() {
|
| + mImeAdapter.endBatchEdit();
|
| + }
|
| + };
|
| +
|
| private final Runnable mRequestTextInputStateUpdate = new Runnable() {
|
| @Override
|
| public void run() {
|
| @@ -197,7 +211,6 @@ public class ThreadedInputConnection extends BaseInputConnection
|
| private void updateSelection(TextInputState textInputState) {
|
| if (textInputState == null) return;
|
| assertOnImeThread();
|
| - if (mNumNestedBatchEdits != 0) return;
|
| Range selection = textInputState.selection();
|
| Range composition = textInputState.composition();
|
| mImeAdapter.updateSelection(
|
| @@ -375,6 +388,9 @@ public class ThreadedInputConnection extends BaseInputConnection
|
| if (DEBUG_LOGS) Log.w(TAG, "beginBatchEdit [%b]", (mNumNestedBatchEdits == 0));
|
| assertOnImeThread();
|
| mNumNestedBatchEdits++;
|
| + if (mNumNestedBatchEdits == 1) {
|
| + ThreadUtils.postOnUiThread(mBeginBatchEdit);
|
| + }
|
| return true;
|
| }
|
|
|
| @@ -388,7 +404,7 @@ public class ThreadedInputConnection extends BaseInputConnection
|
| --mNumNestedBatchEdits;
|
| if (DEBUG_LOGS) Log.w(TAG, "endBatchEdit [%b]", (mNumNestedBatchEdits == 0));
|
| if (mNumNestedBatchEdits == 0) {
|
| - updateSelection(requestAndWaitForTextInputState());
|
| + ThreadUtils.postOnUiThread(mEndBatchEdit);
|
| }
|
| return mNumNestedBatchEdits != 0;
|
| }
|
|
|