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

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

Issue 1593533002: Trigger compositionstart/end on commitText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change commitText instead Created 4 years, 11 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/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java » ('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/AdapterInputConnection.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java b/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java
index b0f8f3f05dfcef1dfbffb4de61ad63974df35519..5ccc821b45e62ff7b237f5dd6e65fe0fcad2a120 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java
@@ -288,14 +288,9 @@ public class AdapterInputConnection extends BaseInputConnection {
public boolean commitText(CharSequence text, int newCursorPosition) {
Log.d(TAG, "commitText [%s] [%d]", text, newCursorPosition);
mPendingAccent = 0;
- if (newCursorPosition == 1) {
- super.commitText(text, newCursorPosition);
- updateSelectionIfRequired();
- return mImeAdapter.commitText(text);
- }
-
// This takes slightly longer, but commitText with newCursorPosition != 1 isn't
- // implemented in the native side.
+ // implemented in the native side. Also, we want to trigger composition events
+ // for commitText().
beginBatchEdit();
boolean result = setComposingText(text, newCursorPosition) && finishComposingText();
endBatchEdit();
« no previous file with comments | « no previous file | content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698