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

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

Issue 643193003: Support InputMethodManager#updateCursorAnchorInfo for Android 5.0 (C++ version) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Send ImeCompositionRangeChanged only when necessary Created 5 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/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 9246385f8588d6205b54339e37e350166fdcc358..6ed1d8d5ba6befd1c42361b3a211ef4d2d1312e2 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
@@ -425,6 +425,9 @@ public class ContentViewCore
// Cached copy of all positions and scales as reported by the renderer.
private final RenderCoordinates mRenderCoordinates;
+ // Buffer to receive return value from View#getLocationOnScreen(int[]).
+ private final int[] mGetLocationOnScreenBuffer = new int[2];
+
// Tracks whether a selection is currently active. When applied to selected text, indicates
// whether the last selected text is still highlighted.
private boolean mHasSelection;
@@ -3073,6 +3076,13 @@ public class ContentViewCore
mContextualSearchClient = contextualSearchClient;
}
+ @CalledByNative
+ private long getLocationOnScreen() {
+ // TODO(yukawa): ViewPositionObserver has similar logic. Try to merge them.
+ mContainerView.getLocationInWindow(mGetLocationOnScreenBuffer);
+ return ((long) mGetLocationOnScreenBuffer[0]) << 32 | mGetLocationOnScreenBuffer[1];
+ }
+
private native WebContents nativeGetWebContentsAndroid(long nativeContentViewCoreImpl);
private native void nativeOnJavaContentViewCoreDestroyed(long nativeContentViewCoreImpl);

Powered by Google App Engine
This is Rietveld 408576698