Chromium Code Reviews| 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 c8447b0e7cf88b35d5e2948a92549eaaabaf3231..b9410e0909501083b5e4371a1e02256072add216 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 |
| @@ -347,6 +347,7 @@ public class ImeAdapter { |
| if (nativeImeAdapter != 0) { |
| createInputConnectionFactory(); |
| } |
| + resetAndHideKeyboard(); |
| } |
| /** |
| @@ -368,11 +369,9 @@ public class ImeAdapter { |
| private void hideKeyboard() { |
| if (DEBUG_LOGS) Log.w(TAG, "hideKeyboard"); |
| View view = mViewEmbedder.getAttachedView(); |
| - if (mInputMethodManagerWrapper.isActive(view)) { |
|
Changwan Ryu
2016/10/19 05:10:21
Is this really causing flakiness in test with onDe
yabinh
2016/10/24 01:40:57
Still flaky, but it's because of the test itself,
|
| - // NOTE: we should not set ResultReceiver here. Otherwise, IMM will own ContentViewCore |
| - // and ImeAdapter even after input method goes away and result gets received. |
| - mInputMethodManagerWrapper.hideSoftInputFromWindow(view.getWindowToken(), 0, null); |
| - } |
| + // NOTE: we should not set ResultReceiver here. Otherwise, IMM will own ContentViewCore |
| + // and ImeAdapter even after input method goes away and result gets received. |
| + mInputMethodManagerWrapper.hideSoftInputFromWindow(view.getWindowToken(), 0, null); |
| // Detach input connection by returning null from onCreateInputConnection(). |
| if (mTextInputType == TextInputType.NONE && mInputConnection != null) { |
| restartInput(); |
| @@ -427,6 +426,7 @@ public class ImeAdapter { |
| * Call this when view is detached from window |
| */ |
| public void onViewDetachedFromWindow() { |
| + resetAndHideKeyboard(); |
|
Changwan Ryu
2016/10/19 05:10:21
As we talked offline, I now prefer this approach b
|
| if (mInputConnectionFactory != null) { |
| mInputConnectionFactory.onViewDetachedFromWindow(); |
| } |
| @@ -438,7 +438,6 @@ public class ImeAdapter { |
| */ |
| public void onViewFocusChanged(boolean gainFocus) { |
| if (DEBUG_LOGS) Log.w(TAG, "onViewFocusChanged: gainFocus [%b]", gainFocus); |
| - if (!gainFocus) resetAndHideKeyboard(); |
| if (mInputConnectionFactory != null) { |
| mInputConnectionFactory.onViewFocusChanged(gainFocus); |
| } |