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

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

Issue 392943002: Fix Handle above IME issue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 681ed5a981b61aca5d575f8369d3bbfd0ee657e0..6961e2f8306b88eae1140897569ec20a6b3b8a92 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
@@ -323,6 +323,9 @@ public class ContentViewCore
// because the OSK was just brought up.
private final Rect mFocusPreOSKViewportRect = new Rect();
+ // Whether Keyboard state has been changed (hidden/shown)
+ private boolean mIsKeyboardStateChanged = false;
+
// On tap this will store the x, y coordinates of the touch.
private int mLastTapX;
private int mLastTapY;
@@ -573,6 +576,7 @@ public class ContentViewCore
// always be called, crbug.com/294908.
getContainerView().getWindowVisibleDisplayFrame(
mFocusPreOSKViewportRect);
+ mIsKeyboardStateChanged = true;
} else if (hasFocus() && resultCode ==
InputMethodManager.RESULT_UNCHANGED_SHOWN) {
// If the OSK was already there, focus the form immediately.
@@ -1601,10 +1605,14 @@ public class ContentViewCore
}
cancelRequestToScrollFocusedEditableNodeIntoView();
}
+ mIsKeyboardStateChanged = false;
}
}
private void cancelRequestToScrollFocusedEditableNodeIntoView() {
+ // Ignore if onTouchEvent triggerred this call after IME state is updated
+ if (mIsKeyboardStateChanged == true) return;
+
// Zero-ing the rect will prevent |updateAfterSizeChanged()| from
// issuing the delayed form focus event.
mFocusPreOSKViewportRect.setEmpty();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698