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

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

Issue 2463583002: Revert of Fix endBatchEdit() state update order issue (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | content/renderer/render_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a295eb041941a12d6e0750d7ddd69367a5936d13..9926e670452081013d3aafb4e2d9d36c12f73957 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
@@ -115,6 +115,7 @@
private final BlockingQueue<TextInputState> mQueue = new LinkedBlockingQueue<>();
private int mPendingAccent;
private TextInputState mCachedTextInputState;
+ private boolean mLastInBatchEditMode;
ThreadedInputConnection(View view, ImeAdapter imeAdapter, Handler handler) {
super(view, true);
@@ -145,8 +146,12 @@
if (DEBUG_LOGS) Log.w(TAG, "updateState: %s", mCachedTextInputState);
addToQueueOnUiThread(mCachedTextInputState);
-
- if (isNonImeChange) mHandler.post(mProcessPendingInputStatesRunnable);
+ // If state update is caused by explicitly requesting the state update,
+ // or batch edit just finished, then we may need to update state to IMM.
+ if (isNonImeChange || (mLastInBatchEditMode && !inBatchEditMode)) {
+ mHandler.post(mProcessPendingInputStatesRunnable);
+ mLastInBatchEditMode = inBatchEditMode;
+ }
}
/**
« no previous file with comments | « no previous file | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698