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

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
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/PositionObserver.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6921884b5d75c11cc065950abe13beaea525c7e4..d3348f9b0560a6b6bec374c371de0d001aefcf05 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
@@ -377,6 +377,8 @@ public class ContentViewCore
private Runnable mDeferredHandleFadeInRunnable;
+ private PositionObserver mPositionObserver;
+
// Size of the viewport in physical pixels as set from onSizeChanged.
private int mViewportWidthPix;
private int mViewportHeightPix;
@@ -717,6 +719,7 @@ public class ContentViewCore
mHardwareAccelerated = hasHardwareAcceleration(mContext);
mContainerView = containerView;
+ mPositionObserver = new ViewPositionObserver(mContainerView);
int windowNativePointer = windowAndroid != null ? windowAndroid.getNativePointer() : 0;
@@ -1999,7 +2002,8 @@ public class ContentViewCore
private SelectionHandleController getSelectionHandleController() {
if (mSelectionHandleController == null) {
- mSelectionHandleController = new SelectionHandleController(getContainerView()) {
+ mSelectionHandleController = new SelectionHandleController(
+ getContainerView(), mPositionObserver) {
@Override
public void selectBetweenCoordinates(int x1, int y1, int x2, int y2) {
if (mNativeContentViewCore != 0 && !(x1 == x2 && y1 == y2)) {
@@ -2025,7 +2029,8 @@ public class ContentViewCore
private InsertionHandleController getInsertionHandleController() {
if (mInsertionHandleController == null) {
- mInsertionHandleController = new InsertionHandleController(getContainerView()) {
+ mInsertionHandleController = new InsertionHandleController(
+ getContainerView(), mPositionObserver) {
private static final int AVERAGE_LINE_HEIGHT = 14;
@Override
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/PositionObserver.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698