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 bc92bd0cb0716549647c03cc525fbf757c653e38..cc7868e12a8bd5c15a63b54fe23727ebc2070291 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 |
@@ -53,9 +53,9 @@ public class ImeAdapter { |
*/ |
public interface ImeAdapterDelegate { |
/** |
- * @param isFinish whether the event is occurring because input is finished. |
+ * Called to notify the delegate about synthetic/real key events before sending to renderer. |
*/ |
- void onImeEvent(boolean isFinish); |
+ void onImeEvent(); |
/** |
* Called when a request to hide the keyboard is sent to InputMethodManager. |
@@ -383,11 +383,9 @@ public class ImeAdapter { |
boolean checkCompositionQueueAndCallNative(CharSequence text, int newCursorPosition, |
boolean isCommit) { |
if (mNativeImeAdapterAndroid == 0) return false; |
- String textStr = text.toString(); |
+ mViewEmbedder.onImeEvent(); |
- // Committing an empty string finishes the current composition. |
- boolean isFinish = textStr.isEmpty(); |
- mViewEmbedder.onImeEvent(isFinish); |
+ String textStr = text.toString(); |
int keyCode = shouldSendKeyEventWithKeyCode(textStr); |
long timeStampMs = SystemClock.uptimeMillis(); |
@@ -457,7 +455,7 @@ public class ImeAdapter { |
// event. |
return false; |
} |
- mViewEmbedder.onImeEvent(false); |
+ mViewEmbedder.onImeEvent(); |
return nativeSendKeyEvent(mNativeImeAdapterAndroid, event, event.getAction(), |
getModifiers(event.getMetaState()), event.getEventTime(), event.getKeyCode(), |
/*isSystemKey=*/false, event.getUnicodeChar()); |
@@ -480,7 +478,7 @@ public class ImeAdapter { |
* @return Whether the native counterpart of ImeAdapter received the call. |
*/ |
boolean deleteSurroundingText(int beforeLength, int afterLength) { |
- mViewEmbedder.onImeEvent(false); |
+ mViewEmbedder.onImeEvent(); |
if (mNativeImeAdapterAndroid == 0) return false; |
nativeDeleteSurroundingText(mNativeImeAdapterAndroid, beforeLength, afterLength); |
return true; |