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 a5b5039861dc873ecf92e07bf59715a168fb59a9..aff2b42588eb0fdd561106fb79ae51012458e98a 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; |
@@ -322,6 +324,7 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
WeakContext.initializeWeakContext(context); |
mPersonality = personality; |
HeapStatsLogger.init(mContext.getApplicationContext()); |
+ mAdapterInputConnectionFactory = new AdapterInputConnectionFactory(); |
} |
/** |
@@ -370,6 +373,11 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
} |
@VisibleForTesting |
+ protected void setAdapterInputConnectionFactory(AdapterInputConnectionFactory factory) { |
+ mAdapterInputConnectionFactory = factory; |
+ } |
+ |
+ @VisibleForTesting |
protected ImeAdapter.AdapterInputConnection getInputConnectionForTest() { |
return mInputConnection; |
} |
@@ -1266,8 +1274,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; |
} |