Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/input/CursorAnchorInfoController.java

Issue 2650113004: [WIP] Add support for Android SuggestionSpans when editing text (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}
}

Powered by Google App Engine
This is Rietveld 408576698