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

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

Issue 2709633002: Make chrome hide keyboard when opening a new window (Closed)
Patch Set: Add a comment Created 3 years, 10 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 930afc0edbdb982daf9482aacb1c705ab2e3c5f3..124dbcc865f01e00f126fa1a6ff48c0b2605993f 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
@@ -416,7 +416,7 @@ public class ImeAdapter {
}
/**
- * Call this when view is detached from window
+ * Call this when view is attached to window.
*/
public void onViewAttachedToWindow() {
if (mInputConnectionFactory != null) {
@@ -425,7 +425,7 @@ public class ImeAdapter {
}
/**
- * Call this when view is detached from window
+ * Call this when view is detached from window.
*/
public void onViewDetachedFromWindow() {
resetAndHideKeyboard();
@@ -437,9 +437,11 @@ public class ImeAdapter {
/**
* Call this when view's focus has changed.
* @param gainFocus True if we're gaining focus.
+ * @param hideKeyboardOnBlur True if we should hide soft keyboard when losing focus.
*/
- public void onViewFocusChanged(boolean gainFocus) {
+ public void onViewFocusChanged(boolean gainFocus, boolean hideKeyboardOnBlur) {
if (DEBUG_LOGS) Log.w(TAG, "onViewFocusChanged: gainFocus [%b]", gainFocus);
+ if (!gainFocus && hideKeyboardOnBlur) resetAndHideKeyboard();
if (mInputConnectionFactory != null) {
mInputConnectionFactory.onViewFocusChanged(gainFocus);
}

Powered by Google App Engine
This is Rietveld 408576698