Chromium Code Reviews| 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 d3bc650c1ad0ea29b25920fc136c83af82790be2..3e22032caca62c15b43ebbdbe7b99fd03dcdf3ea 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 |
| @@ -61,10 +61,11 @@ import org.chromium.content.browser.accessibility.captioning.CaptioningBridgeFac |
| import org.chromium.content.browser.accessibility.captioning.SystemCaptioningBridge; |
| import org.chromium.content.browser.accessibility.captioning.TextTrackSettings; |
| import org.chromium.content.browser.input.AdapterInputConnection; |
| +import org.chromium.content.browser.input.ChromiumBaseInputConnection; |
| +import org.chromium.content.browser.input.ChromiumBaseInputConnectionFactory; |
| import org.chromium.content.browser.input.FloatingPastePopupMenu; |
| import org.chromium.content.browser.input.GamepadList; |
| import org.chromium.content.browser.input.ImeAdapter; |
| -import org.chromium.content.browser.input.ImeAdapter.AdapterInputConnectionFactory; |
| import org.chromium.content.browser.input.InputMethodManagerWrapper; |
| import org.chromium.content.browser.input.JoystickScrollProvider; |
| import org.chromium.content.browser.input.LegacyPastePopupMenu; |
| @@ -487,8 +488,8 @@ public class ContentViewCore implements |
| // Only valid when focused on a text / password field. |
| private ImeAdapter mImeAdapter; |
| - private ImeAdapter.AdapterInputConnectionFactory mAdapterInputConnectionFactory; |
| - private AdapterInputConnection mInputConnection; |
| + private ChromiumBaseInputConnectionFactory mInputConnectionFactory; |
| + private ChromiumBaseInputConnection mInputConnection; |
| private InputMethodManagerWrapper mInputMethodManagerWrapper; |
| // Lazily created paste popup menu, triggered either via long press in an |
| @@ -637,7 +638,7 @@ public class ContentViewCore implements |
| public ContentViewCore(Context context) { |
| mContext = context; |
| - mAdapterInputConnectionFactory = new AdapterInputConnectionFactory(); |
| + mInputConnectionFactory = new ChromiumBaseInputConnectionFactory(); |
| mInputMethodManagerWrapper = new InputMethodManagerWrapper(mContext); |
| mRenderCoordinates = new RenderCoordinates(); |
| @@ -738,8 +739,8 @@ public class ContentViewCore implements |
| } |
| @VisibleForTesting |
| - public void setAdapterInputConnectionFactory(AdapterInputConnectionFactory factory) { |
| - mAdapterInputConnectionFactory = factory; |
| + public void setInputConnectionFactory(ChromiumBaseInputConnectionFactory factory) { |
| + mInputConnectionFactory = factory; |
| } |
| @VisibleForTesting |
| @@ -748,7 +749,7 @@ public class ContentViewCore implements |
| } |
| @VisibleForTesting |
| - public AdapterInputConnection getInputConnectionForTest() { |
| + public ChromiumBaseInputConnection getInputConnectionForTest() { |
| return mInputConnection; |
| } |
| @@ -1483,7 +1484,8 @@ public class ContentViewCore implements |
| private void clearUserSelection() { |
| if (mFocusedNodeEditable) { |
| - if (mInputConnection != null) { |
| + if (mInputConnection != null |
| + && AdapterInputConnection.class.isInstance(mInputConnection)) { |
| int selectionEnd = Selection.getSelectionEnd(mEditable); |
| mInputConnection.setSelection(selectionEnd, selectionEnd); |
| } |
| @@ -1576,13 +1578,8 @@ public class ContentViewCore implements |
| // enter fullscreen mode. |
| outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN; |
| } |
| - mInputConnection = mAdapterInputConnectionFactory.get(mContainerView, mImeAdapter, |
| - mEditable, outAttrs); |
| - return mInputConnection; |
| - } |
| - |
| - @VisibleForTesting |
| - public AdapterInputConnection getAdapterInputConnectionForTest() { |
| + mInputConnection = |
| + mInputConnectionFactory.get(mContainerView, mImeAdapter, mEditable, outAttrs); |
|
AKV
2015/11/04 17:20:49
Is this factory stuff really needed ?, Can we remo
Changwan Ryu
2016/01/19 07:31:52
Since the AdapterInputConnection and ChromiumInput
|
| return mInputConnection; |
| } |
| @@ -1612,7 +1609,7 @@ public class ContentViewCore implements |
| if (mNativeContentViewCore != 0) { |
| mImeAdapter.attach(nativeGetNativeImeAdapter(mNativeContentViewCore)); |
| } |
| - mInputMethodManagerWrapper.restartInput(mContainerView); |
| + mImeAdapter.restartInput(); |
| // By default, we show soft keyboard on keyboard changes. This is useful |
| // when the user transitions from hardware keyboard to software keyboard. |
| mImeAdapter.showSoftKeyboard(); |
| @@ -2479,8 +2476,11 @@ public class ContentViewCore implements |
| nativeImeAdapterAndroid, textInputType, textInputFlags, showImeIfNeeded); |
| if (mInputConnection != null) { |
| - mInputConnection.updateState(text, selectionStart, selectionEnd, compositionStart, |
| - compositionEnd, isNonImeChange); |
| + // TODO |
| + if (mImeAdapter.mInputConnection != null) { |
| + mImeAdapter.mInputConnection.updateState(text, selectionStart, selectionEnd, |
| + compositionStart, compositionEnd, isNonImeChange); |
| + } |
| } |
| if (mActionMode != null) { |