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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/input/InsertionHandleController.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/input/InsertionHandleController.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/InsertionHandleController.java b/content/public/android/java/src/org/chromium/content/browser/input/InsertionHandleController.java
index f251edf2720fde3fc26ddf8929671440e5cc24d5..39709b16dd3e85b0f2f76cb342d05074d47ec8b4 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/InsertionHandleController.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/InsertionHandleController.java
@@ -18,6 +18,8 @@ import android.widget.PopupWindow;
import com.google.common.annotations.VisibleForTesting;
+import org.chromium.content.browser.PositionObserver;
+
/**
* CursorController for inserting text at the cursor position.
*/
@@ -37,9 +39,13 @@ public abstract class InsertionHandleController implements CursorController {
private Context mContext;
- public InsertionHandleController(View parent) {
+ private PositionObserver mPositionObserver;
+
+ public InsertionHandleController(View parent, PositionObserver positionObserver) {
mParent = parent;
+
mContext = parent.getContext();
+ mPositionObserver = positionObserver;
}
/** Allows the handle to be shown automatically when cursor position changes */
@@ -167,7 +173,9 @@ public abstract class InsertionHandleController implements CursorController {
}
private void createHandleIfNeeded() {
- if (mHandle == null) mHandle = new HandleView(this, HandleView.CENTER, mParent);
+ if (mHandle == null) {
+ mHandle = new HandleView(this, HandleView.CENTER, mParent, mPositionObserver);
+ }
}
private void showHandleIfNeeded() {

Powered by Google App Engine
This is Rietveld 408576698