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

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

Issue 2470713002: [WIP Approach 1] Straighten up input method reactivation
Patch Set: fix some tests Created 4 years, 1 month 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..28744004efbd60a11df4a97336ba6bd14765602c 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
@@ -54,7 +54,7 @@ import org.chromium.ui.picker.InputDialogContainer;
@JNINamespace("content")
public class ImeAdapter {
private static final String TAG = "cr_Ime";
- private static final boolean DEBUG_LOGS = false;
+ private static final boolean DEBUG_LOGS = true;
public static final int COMPOSITION_KEY_CODE = 229;
@@ -277,11 +277,7 @@ public class ImeAdapter {
mTextInputType, textInputType, textInputFlags, showIfNeeded);
}
mTextInputFlags = textInputFlags;
- if (mTextInputType != textInputType) {
- mTextInputType = textInputType;
- // No need to restart if we are going to hide anyways.
- if (textInputType != TextInputType.NONE) restartInput();
- }
+ mTextInputType = textInputType;
// There is no API for us to get notified of user's dismissal of keyboard.
// Therefore, we should try to show keyboard even when text input type hasn't changed.
@@ -664,9 +660,9 @@ public class ImeAdapter {
mCursorAnchorInfoController.focusedNodeChanged(isEditable);
}
- if (mTextInputType != TextInputType.NONE && mInputConnection != null && isEditable) {
- restartInput();
- }
+ // When it's not editable, we depend on updateKeyboardVisibility() to hide
+ // the keyboard first before restarting.
+ if (isEditable) restartInput();
}
/**

Powered by Google App Engine
This is Rietveld 408576698