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

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

Issue 2290133002: Make WebView keep keyboard when losing focus (Closed)
Patch Set: Created 4 years, 2 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
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);
}

Powered by Google App Engine
This is Rietveld 408576698