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); |
} |