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

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

Issue 24449007: [Android] Allow text handles to observe position of "parent" view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 2 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 1053e1ca8b1fbfb4c7666efba393eca5cbd4c1e7..499051492aa250dd688e49bb07c17bea916c405d 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
@@ -378,6 +378,8 @@ import java.util.Map;
private Runnable mDeferredHandleFadeInRunnable;
+ private PositionObserver mPositionObserver;
+
// Size of the viewport in physical pixels as set from onSizeChanged.
private int mViewportWidthPix;
private int mViewportHeightPix;
@@ -718,6 +720,7 @@ import java.util.Map;
mHardwareAccelerated = hasHardwareAcceleration(mContext);
mContainerView = containerView;
+ mPositionObserver = new PositionObserver(mContainerView);
int windowNativePointer = windowAndroid != null ? windowAndroid.getNativePointer() : 0;
@@ -2000,7 +2003,10 @@ import java.util.Map;
private SelectionHandleController getSelectionHandleController() {
if (mSelectionHandleController == null) {
- mSelectionHandleController = new SelectionHandleController(getContainerView()) {
+ mSelectionHandleController = new SelectionHandleController(
+ new HandleView.ViewDelegate(getContainerView()),
+ new HandleView.ViewDelegate(getContainerView()),
+ mPositionObserver) {
@Override
public void selectBetweenCoordinates(int x1, int y1, int x2, int y2) {
if (mNativeContentViewCore != 0 && !(x1 == x2 && y1 == y2)) {
@@ -2026,7 +2032,8 @@ import java.util.Map;
private InsertionHandleController getInsertionHandleController() {
if (mInsertionHandleController == null) {
- mInsertionHandleController = new InsertionHandleController(getContainerView()) {
+ mInsertionHandleController = new InsertionHandleController(
+ getContainerView(), mPositionObserver) {
private static final int AVERAGE_LINE_HEIGHT = 14;
@Override

Powered by Google App Engine
This is Rietveld 408576698