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 b8394ca23a122b07ceb199e6d97c1ffcb87213a3..7642d8da835885dbf2dfb31709e6524a371c1061 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 |
| @@ -575,18 +575,17 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Displa |
| mJoystickScrollProvider = |
| new JoystickScrollProvider(webContents, getContainerView(), windowAndroid); |
| + mImeAdapter = createImeAdapter(); |
| mNativeContentViewCore = nativeInit(webContents, mViewAndroidDelegate, windowNativePointer, |
| - dipScale, mRetainedJavaScriptObjects); |
| + mImeAdapter.getNativePointer(), dipScale, mRetainedJavaScriptObjects); |
| mWebContents = nativeGetWebContentsAndroid(mNativeContentViewCore); |
| setContainerViewInternals(internalDispatcher); |
| initPopupZoomer(mContext); |
| - mImeAdapter = createImeAdapter(); |
| - attachImeAdapter(); |
| mSelectionPopupController = new SelectionPopupController(mContext, windowAndroid, |
| - webContents, viewDelegate.getContainerView(), mRenderCoordinates, mImeAdapter); |
| + webContents, viewDelegate.getContainerView(), mRenderCoordinates); |
| mSelectionPopupController.setCallback(ActionModeCallbackHelper.EMPTY_CALLBACK); |
| mSelectionPopupController.setContainerView(getContainerView()); |
| @@ -784,6 +783,7 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Displa |
| mWebContentsObserver.destroy(); |
| mWebContentsObserver = null; |
| mImeAdapter.resetAndHideKeyboard(); |
| + |
|
boliu
2017/03/24 17:13:16
empty line change..
Jinsuk Kim
2017/03/27 03:19:33
Done.
|
| // TODO(igsolla): address TODO in ContentViewClient because ContentViewClient is not |
| // currently a real Null Object. |
| // |
| @@ -1752,16 +1752,14 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Displa |
| } |
| @CalledByNative |
| - private void updateImeAdapter(long nativeImeAdapterAndroid, int textInputType, |
| - int textInputFlags, int textInputMode, String text, int selectionStart, |
| - int selectionEnd, int compositionStart, int compositionEnd, boolean showImeIfNeeded, |
| - boolean replyToRequest) { |
| + private void updateImeAdapter(int textInputType, int textInputFlags, int textInputMode, |
| + String text, int selectionStart, int selectionEnd, int compositionStart, |
| + int compositionEnd, boolean showImeIfNeeded, boolean replyToRequest) { |
| try { |
| TraceEvent.begin("ContentViewCore.updateImeAdapter"); |
| boolean focusedNodeEditable = (textInputType != TextInputType.NONE); |
| boolean focusedNodeIsPassword = (textInputType == TextInputType.PASSWORD); |
| - mImeAdapter.attach(nativeImeAdapterAndroid); |
| mImeAdapter.updateState(textInputType, textInputFlags, textInputMode, showImeIfNeeded, |
| text, selectionStart, selectionEnd, compositionStart, compositionEnd, |
| replyToRequest); |
| @@ -1778,11 +1776,6 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Displa |
| } |
| } |
| - @CalledByNative |
| - private void forceUpdateImeAdapter(long nativeImeAdapterAndroid) { |
| - mImeAdapter.attach(nativeImeAdapterAndroid); |
| - } |
| - |
| /** |
| * Called (from native) when the <select> popup needs to be shown. |
| * @param anchorView View anchored for popup. |
| @@ -1893,21 +1886,11 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Displa |
| @SuppressWarnings("unused") |
| @CalledByNative |
| private void onRenderProcessChange() { |
| - attachImeAdapter(); |
| // Immediately sync closed caption settings to the new render process. |
| mSystemCaptioningBridge.syncToListener(this); |
| } |
| /** |
| - * Attaches the native ImeAdapter object to the java ImeAdapter to allow communication via JNI. |
| - */ |
| - public void attachImeAdapter() { |
| - if (mImeAdapter != null && mNativeContentViewCore != 0) { |
| - mImeAdapter.attach(nativeGetNativeImeAdapter(mNativeContentViewCore)); |
| - } |
| - } |
| - |
| - /** |
| * @see View#hasFocus() |
| */ |
| @CalledByNative |
| @@ -2586,7 +2569,8 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Displa |
| } |
| private native long nativeInit(WebContents webContents, ViewAndroidDelegate viewAndroidDelegate, |
| - long windowAndroidPtr, float dipScale, HashSet<Object> retainedObjectSet); |
| + long windowAndroidPtr, long imeAdapterPtr, float dipScale, |
| + HashSet<Object> retainedObjectSet); |
| private static native ContentViewCore nativeFromWebContentsAndroid(WebContents webContents); |
| private native void nativeUpdateWindowAndroid( |
| @@ -2651,9 +2635,6 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Displa |
| private native void nativeSelectPopupMenuItems(long nativeContentViewCoreImpl, |
| long nativeSelectPopupSourceFrame, int[] indices); |
| - |
| - private native long nativeGetNativeImeAdapter(long nativeContentViewCoreImpl); |
| - |
| private native int nativeGetCurrentRenderProcessId(long nativeContentViewCoreImpl); |
| private native void nativeSetAllowJavascriptInterfacesInspection( |