Chromium Code Reviews| Index: content/public/android/java/src/org/chromium/content/browser/input/CursorAnchorInfoController.java |
| diff --git a/content/public/android/java/src/org/chromium/content/browser/input/CursorAnchorInfoController.java b/content/public/android/java/src/org/chromium/content/browser/input/CursorAnchorInfoController.java |
| index 718db1632ed332fb1d255499929383050720e4aa..ea4408bb3d46113fa83bc535ce8f4b7b1781c55b 100644 |
| --- a/content/public/android/java/src/org/chromium/content/browser/input/CursorAnchorInfoController.java |
| +++ b/content/public/android/java/src/org/chromium/content/browser/input/CursorAnchorInfoController.java |
| @@ -81,24 +81,28 @@ final class CursorAnchorInfoController { |
| private final ComposingTextDelegate mComposingTextDelegate; |
| @Nonnull |
| private final ViewDelegate mViewDelegate; |
| + @Nullable |
| + private final ImeAdapter mImeAdapter; |
| private CursorAnchorInfoController(InputMethodManagerWrapper inputMethodManagerWrapper, |
| - ComposingTextDelegate composingTextDelegate, ViewDelegate viewDelegate) { |
| + ComposingTextDelegate composingTextDelegate, ViewDelegate viewDelegate, |
| + ImeAdapter imeAdapter) { |
| mInputMethodManagerWrapper = inputMethodManagerWrapper; |
| mComposingTextDelegate = composingTextDelegate; |
| mViewDelegate = viewDelegate; |
| + mImeAdapter = imeAdapter; |
| } |
| public static CursorAnchorInfoController create( |
| InputMethodManagerWrapper inputMethodManagerWrapper, |
| - ComposingTextDelegate composingTextDelegate) { |
| - return new CursorAnchorInfoController(inputMethodManagerWrapper, |
| - composingTextDelegate, new ViewDelegate() { |
| + ComposingTextDelegate composingTextDelegate, ImeAdapter imeAdapter) { |
| + return new CursorAnchorInfoController( |
| + inputMethodManagerWrapper, composingTextDelegate, new ViewDelegate() { |
| @Override |
| public void getLocationOnScreen(View view, int[] location) { |
| view.getLocationOnScreen(location); |
| } |
| - }); |
| + }, imeAdapter); |
| } |
| @VisibleForTesting |
| @@ -110,10 +114,10 @@ final class CursorAnchorInfoController { |
| @VisibleForTesting |
| public static CursorAnchorInfoController createForTest( |
| InputMethodManagerWrapper inputMethodManagerWrapper, |
| - ComposingTextDelegate composingTextDelegate, |
| - ViewDelegate viewDelegate) { |
| - return new CursorAnchorInfoController(inputMethodManagerWrapper, composingTextDelegate, |
| - viewDelegate); |
| + ComposingTextDelegate composingTextDelegate, ViewDelegate viewDelegate, |
| + ImeAdapter imeAdapter) { |
| + return new CursorAnchorInfoController( |
| + inputMethodManagerWrapper, composingTextDelegate, viewDelegate, imeAdapter); |
| } |
| /** |
| @@ -193,12 +197,8 @@ final class CursorAnchorInfoController { |
| mInsertionMarkerBottom = insertionMarkerBottom; |
| } |
| - // Notify to IME if there is a pending request, or if it is in monitor mode and we have |
| - // some change in the state. |
| - if (mHasPendingImmediateRequest |
|
aelias_OOO_until_Jul13
2017/01/25 03:34:26
These conditions are important to preserve for per
rlanday
2017/01/25 19:21:56
I think we probably want to turn on "monitor mode"
|
| - || (mMonitorModeEnabled && mLastCursorAnchorInfo == null)) { |
| - updateCursorAnchorInfo(view); |
| - } |
| + // Notify ImeAdapter |
| + updateCursorAnchorInfo(view); |
| } |
| public void focusedNodeChanged(boolean isEditable) { |
| @@ -277,6 +277,9 @@ final class CursorAnchorInfoController { |
| if (mInputMethodManagerWrapper != null) { |
| mInputMethodManagerWrapper.updateCursorAnchorInfo(view, mLastCursorAnchorInfo); |
| } |
| + if (mImeAdapter != null) { |
| + mImeAdapter.updateCursorAnchorInfo(view, mLastCursorAnchorInfo); |
| + } |
| mHasPendingImmediateRequest = false; |
| } |
| } |