| 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 12e658bee619c6abd9f161af5d9551f39a7a8ac4..7752b4a58b3b354f52402350e1af612642515399 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
|
| @@ -16,6 +16,7 @@ import android.content.res.Configuration;
|
| import android.database.ContentObserver;
|
| import android.graphics.Bitmap;
|
| import android.graphics.Canvas;
|
| +import android.graphics.Matrix;
|
| import android.graphics.Rect;
|
| import android.net.Uri;
|
| import android.os.Build;
|
| @@ -2105,7 +2106,9 @@ public class ContentViewCore
|
| float pageScaleFactor, float minPageScaleFactor, float maxPageScaleFactor,
|
| float contentWidth, float contentHeight,
|
| float viewportWidth, float viewportHeight,
|
| - float controlsOffsetYCss, float contentOffsetYCss) {
|
| + float controlsOffsetYCss, float contentOffsetYCss,
|
| + boolean hasInsertionMarker, float insertionMarkerX,
|
| + float insertionMarkerTop, float insertionMarkerBottom) {
|
| TraceEvent.begin("ContentViewCore:updateFrameInfo");
|
| // Adjust contentWidth/Height to be always at least as big as
|
| // the actual viewport (as set by onSizeChanged).
|
| @@ -2171,6 +2174,34 @@ public class ContentViewCore
|
| if (mBrowserAccessibilityManager != null) {
|
| mBrowserAccessibilityManager.notifyFrameInfoInitialized();
|
| }
|
| +
|
| + if (mImeAdapter.isCursorAnchorInfoSupported()) {
|
| + int[] viewOrigin = new int[2];
|
| + mContainerView.getLocationOnScreen(viewOrigin);
|
| + float viewOriginX = viewOrigin[0];
|
| + float viewOriginY = viewOrigin[1];
|
| +
|
| + RenderCoordinates.NormalizedPoint normalizedPoint =
|
| + mRenderCoordinates.createNormalizedPoint();
|
| + normalizedPoint.setAbsoluteCss(0.0f, 0.0f);
|
| + float tx = normalizedPoint.getXPix();
|
| + float ty = normalizedPoint.getYPix();
|
| + normalizedPoint.setAbsoluteCss(1.0f, 0.0f);
|
| + float ax = normalizedPoint.getXPix();
|
| + float ay = normalizedPoint.getYPix();
|
| + normalizedPoint.setAbsoluteCss(0.0f, 1.0f);
|
| + float bx = normalizedPoint.getXPix();
|
| + float by = normalizedPoint.getYPix();
|
| +
|
| + Matrix matrix = new Matrix();
|
| + matrix.setValues(new float[]{
|
| + ax - tx, bx - tx, tx + viewOriginX,
|
| + ay - ty, by - ty, ty + viewOriginY,
|
| + 0.0f, 0.0f, 1.0f});
|
| + mImeAdapter.updateCursorAnchorInfo(mContainerView, matrix, hasInsertionMarker,
|
| + insertionMarkerX, insertionMarkerTop, insertionMarkerBottom);
|
| + }
|
| +
|
| TraceEvent.end("ContentViewCore:updateFrameInfo");
|
| }
|
|
|
| @@ -2183,6 +2214,9 @@ public class ContentViewCore
|
| mFocusedNodeEditable = (textInputType != ImeAdapter.getTextInputTypeNone());
|
| if (!mFocusedNodeEditable) hidePastePopup();
|
|
|
| + mImeAdapter.updateCursorAnchorInfoSource(text, selectionStart, selectionEnd,
|
| + compositionStart, compositionEnd);
|
| +
|
| mImeAdapter.updateKeyboardVisibility(
|
| nativeImeAdapterAndroid, textInputType, textInputFlags, showImeIfNeeded);
|
|
|
|
|