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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java

Issue 2777223004: Migrate IME state update flow (Closed)
Patch Set: rebase Created 3 years, 8 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: chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
index ed0bc3c71ce1d32da7413075e15f9a9f9cac92cf..d3de2ebd4f8698e44b0f77ab109acb9a64c2e573 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
@@ -94,6 +94,7 @@ import org.chromium.content.browser.ContentViewClient;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.crypto.CipherFactory;
import org.chromium.content_public.browser.GestureStateListener;
+import org.chromium.content_public.browser.ImeEventObserver;
import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.common.BrowserControlsState;
@@ -374,20 +375,6 @@ public class Tab
private class TabContentViewClient extends ContentViewClient {
@Override
- public void onImeEvent() {
- // Some text was set in the page. Don't reuse it if a tab is
- // open from the same external application, we might lose some
- // user data.
- mAppAssociatedWith = null;
- }
-
- @Override
- public void onFocusedNodeEditabilityChanged(boolean editable) {
- if (getFullscreenManager() == null) return;
- updateFullscreenEnabledState();
- }
-
- @Override
public int getSystemWindowInsetBottom() {
ChromeActivity activity = getActivity();
if (activity != null && activity.getInsetObserverView() != null) {
@@ -1327,6 +1314,22 @@ public class Tab
setContentViewCore(contentViewCore);
}
+ mContentViewCore.addImeEventObserver(new ImeEventObserver() {
+ @Override
+ public void onImeEvent() {
+ // Some text was set in the page. Don't reuse it if a tab is
+ // open from the same external application, we might lose some
+ // user data.
+ mAppAssociatedWith = null;
+ }
+
+ @Override
+ public void onNodeAttributeUpdated(boolean editable, boolean password) {
+ if (getFullscreenManager() == null) return;
+ updateFullscreenEnabledState();
+ }
+ });
+
if (!creatingWebContents && webContents.isLoadingToDifferentDocument()) {
didStartPageLoad(webContents.getUrl(), false);
}

Powered by Google App Engine
This is Rietveld 408576698