| 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 e0a20015867d64a0be1b6c4d25e8330cbf8e8fe0..dbb18af1219cf652ae8c1844f3f634fefcbb05d1 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,7 @@ public class ContentViewCore
|
| private Runnable mDeferredHandleFadeInRunnable;
|
|
|
| private PositionObserver mPositionObserver;
|
| + private PositionObserver.Listener mPositionListener;
|
|
|
| // Size of the viewport in physical pixels as set from onSizeChanged.
|
| private int mViewportWidthPix;
|
| @@ -720,6 +721,14 @@ public class ContentViewCore
|
|
|
| mContainerView = containerView;
|
| mPositionObserver = new ViewPositionObserver(mContainerView);
|
| + mPositionListener = new PositionObserver.Listener() {
|
| + @Override
|
| + public void onPositionChanged(int x, int y) {
|
| + if (isSelectionHandleShowing() || isInsertionHandleShowing()) {
|
| + temporarilyHideTextHandles();
|
| + }
|
| + }
|
| + };
|
|
|
| int windowNativePointer = windowAndroid != null ? windowAndroid.getNativePointer() : 0;
|
|
|
| @@ -2097,6 +2106,7 @@ public class ContentViewCore
|
| if (mInsertionHandleController != null) {
|
| mInsertionHandleController.hideAndDisallowAutomaticShowing();
|
| }
|
| + mPositionObserver.removeListener(mPositionListener);
|
| }
|
|
|
| private void showSelectActionBar() {
|
| @@ -2527,6 +2537,9 @@ public class ContentViewCore
|
| }
|
| mHasSelection = false;
|
| }
|
| + if (isSelectionHandleShowing() || isInsertionHandleShowing()) {
|
| + mPositionObserver.addListener(mPositionListener);
|
| + }
|
| }
|
|
|
| @SuppressWarnings("unused")
|
|
|