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

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

Issue 26575006: [Android] Hide handles when the containing view moves (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 | no next file » | 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 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")
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698