Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
index 42f25ff8122ba8b92018edf71ba1260a07404484..1f57881458a209892d0beb8a9d6311c0598d4fa7 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
@@ -1399,7 +1399,6 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
} else { |
undoScrollFocusedEditableNodeIntoViewIfNeeded(false); |
} |
- mImeAdapter.dispatchKeyEventPreIme(event); |
return mContainerViewInternals.super_dispatchKeyEventPreIme(event); |
} finally { |
TraceEvent.end(); |
@@ -1414,16 +1413,14 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
!mImeAdapter.isNativeImeAdapterAttached() && mNativeContentViewCore != 0) { |
mImeAdapter.attach(nativeGetNativeImeAdapter(mNativeContentViewCore)); |
} |
- // The key handling logic is kind of confusing here. |
- // The purpose of shouldOverrideKeyEvent() is to filter out some keys that is critical |
- // to browser function but useless in renderer process (for example, the back button), |
- // so the browser can still respond to these keys in a timely manner when the renderer |
- // process is busy/blocked/busted. mImeAdapter.dispatchKeyEvent() forwards the key event |
- // to the renderer process. If mImeAdapter is bypassed or is not interested to the event, |
- // fall back to the default dispatcher to propagate the event to sub-views. |
- return (!getContentViewClient().shouldOverrideKeyEvent(event) |
- && mImeAdapter.dispatchKeyEvent(event)) |
- || mContainerViewInternals.super_dispatchKeyEvent(event); |
+ |
+ if (getContentViewClient().shouldOverrideKeyEvent(event)) { |
+ return mContainerViewInternals.super_dispatchKeyEvent(event); |
+ } |
+ |
+ if (mKeyboardConnected && mImeAdapter.dispatchKeyEvent(event)) return true; |
+ |
+ return mContainerViewInternals.super_dispatchKeyEvent(event); |
} |
/** |