| Index: content/public/android/java/src/org/chromium/content/browser/input/SelectionHandleController.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/input/SelectionHandleController.java b/content/public/android/java/src/org/chromium/content/browser/input/SelectionHandleController.java
|
| index 289dfa259c21e7938c7869811aa75221623421cd..f4da5f9ecf1a239484d3d81dafa334328bdc7d89 100644
|
| --- a/content/public/android/java/src/org/chromium/content/browser/input/SelectionHandleController.java
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/input/SelectionHandleController.java
|
| @@ -8,6 +8,8 @@ import android.view.View;
|
|
|
| import com.google.common.annotations.VisibleForTesting;
|
|
|
| +import org.chromium.content.browser.PositionObserverInterface;
|
| +
|
| /**
|
| * CursorController for selecting a range of text.
|
| */
|
| @@ -28,13 +30,19 @@ public abstract class SelectionHandleController implements CursorController {
|
| /** Whether selection anchors are active. */
|
| private boolean mIsShowing;
|
|
|
| - private View mParent;
|
| + private HandleView.Delegate mStartHandleDelegate;
|
| + private HandleView.Delegate mEndHandleDelegate;
|
|
|
| private int mFixedHandleX;
|
| private int mFixedHandleY;
|
|
|
| - public SelectionHandleController(View parent) {
|
| - mParent = parent;
|
| + private PositionObserverInterface mPositionObserver;
|
| +
|
| + public SelectionHandleController(HandleView.Delegate startHandleDelegate,
|
| + HandleView.Delegate endHandleDelegate, PositionObserverInterface positionObserver) {
|
| + mStartHandleDelegate = startHandleDelegate;
|
| + mEndHandleDelegate = endHandleDelegate;
|
| + mPositionObserver = positionObserver;
|
| }
|
|
|
| /** Automatically show selection anchors when text is selected. */
|
| @@ -190,11 +198,13 @@ public abstract class SelectionHandleController implements CursorController {
|
| private void createHandlesIfNeeded(int startDir, int endDir) {
|
| if (mStartHandle == null) {
|
| mStartHandle = new HandleView(this,
|
| - startDir == TEXT_DIRECTION_RTL ? HandleView.RIGHT : HandleView.LEFT, mParent);
|
| + startDir == TEXT_DIRECTION_RTL ? HandleView.RIGHT : HandleView.LEFT,
|
| + mStartHandleDelegate, mPositionObserver);
|
| }
|
| if (mEndHandle == null) {
|
| mEndHandle = new HandleView(this,
|
| - endDir == TEXT_DIRECTION_RTL ? HandleView.LEFT : HandleView.RIGHT, mParent);
|
| + endDir == TEXT_DIRECTION_RTL ? HandleView.LEFT : HandleView.RIGHT,
|
| + mEndHandleDelegate, mPositionObserver);
|
| }
|
| }
|
|
|
|
|