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 a6441ffe1b9b3e815d151d82a2d571825c0ef59c..b5935b94f0210327c26ad43e2c6cc1e5f56a6aac 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 |
@@ -44,6 +44,7 @@ import org.chromium.base.JNINamespace; |
import org.chromium.base.WeakContext; |
import org.chromium.content.R; |
import org.chromium.content.browser.ContentViewGestureHandler.MotionEventDelegate; |
+import org.chromium.content.browser.ImeAdapter.AdapterInputConnectionFactory; |
import org.chromium.content.browser.accessibility.AccessibilityInjector; |
import org.chromium.content.common.ProcessInitException; |
import org.chromium.content.common.TraceEvent; |
@@ -211,6 +212,7 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
// Only valid when focused on a text / password field. |
private ImeAdapter mImeAdapter; |
+ private ImeAdapter.AdapterInputConnectionFactory mAdapterInputConnectionFactory; |
private ImeAdapter.AdapterInputConnection mInputConnection; |
private SelectionHandleController mSelectionHandleController; |
@@ -319,6 +321,7 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
WeakContext.initializeWeakContext(context); |
mPersonality = personality; |
HeapStatsLogger.init(mContext.getApplicationContext()); |
+ mAdapterInputConnectionFactory = new AdapterInputConnectionFactory(); |
} |
/** |
@@ -367,6 +370,11 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
} |
@VisibleForTesting |
+ protected void setAdapterInputConnectionFactory(AdapterInputConnectionFactory factory) { |
+ mAdapterInputConnectionFactory = factory; |
+ } |
+ |
+ @VisibleForTesting |
protected ImeAdapter.AdapterInputConnection getInputConnectionForTest() { |
return mInputConnection; |
} |
@@ -1261,8 +1269,8 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
// enter fullscreen mode. |
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN; |
} |
- mInputConnection = ImeAdapter.AdapterInputConnection.getInstance( |
- mContainerView, mImeAdapter, outAttrs); |
+ mInputConnection = |
+ mAdapterInputConnectionFactory.get(mContainerView, mImeAdapter, outAttrs); |
return mInputConnection; |
} |