| 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 3ee52e862976573aaa5484ef6d37bc001c0dde56..9dea1cf20d90e39fef4c10dde07a10e3e14892b0 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
|
| @@ -574,6 +574,11 @@ public class ContentViewCore
|
| }
|
|
|
| @VisibleForTesting
|
| + public void setImeAdapterForTest(ImeAdapter imeAdapter) {
|
| + mImeAdapter = imeAdapter;
|
| + }
|
| +
|
| + @VisibleForTesting
|
| public ImeAdapter getImeAdapterForTest() {
|
| return mImeAdapter;
|
| }
|
| @@ -1825,6 +1830,17 @@ public class ContentViewCore
|
| return mContainerViewInternals.super_dispatchKeyEvent(event);
|
| }
|
|
|
| + if (event.getKeyCode() == KeyEvent.KEYCODE_DPAD_CENTER) {
|
| + showImeIfNeeded();
|
| + // Event is not consumed here, because ImeAdapter might interpret
|
| + // it as "Enter".
|
| + // showImeIfNeeded respects the policy of
|
| + // InputMethodService.onEvaluateInputViewShown. So IME will not be
|
| + // shown if you have QWERTY physical keyboard attached.
|
| + // Also, IME will not be shown if the focus is not on the input
|
| + // field. See ImeAdapter.attachAndShowIfNeeded
|
| + }
|
| +
|
| if (mImeAdapter.dispatchKeyEvent(event)) return true;
|
|
|
| return mContainerViewInternals.super_dispatchKeyEvent(event);
|
|
|