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 655be6a7c7b82ab67db6a095193209f122d00684..fc784b899d71d771ea172f998bd5d8d7b5de1dd4 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 |
@@ -281,6 +281,7 @@ public class ContentViewCore |
// Lazily created paste popup menu, triggered either via long press in an |
// editable region or from tapping the insertion handle. |
private PastePopupMenu mPastePopupMenu; |
+ private boolean mWasPastePopupShowing = false; |
jdduke (slow)
2014/07/30 17:39:09
Maybe rename this to |mWasPastePopupShowingOnInser
AKVT
2014/08/01 14:42:08
Done.
|
private PopupTouchHandleDrawableDelegate mTouchHandleDelegate; |
@@ -2182,13 +2183,21 @@ public class ContentViewCore |
mHasInsertion = true; |
break; |
- case SelectionEventType.INSERTION_MOVED: |
- // TODO(jdduke): Handle case where movement triggered by focus. |
+ case SelectionEventType.INSERTION_DRAG_BEGUN: |
+ mWasPastePopupShowing = getPastePopup().isShowing(); |
hidePastePopup(); |
break; |
+ case SelectionEventType.INSERTION_MOVED: |
+ if (getPastePopup().isShowing() && !isScrollInProgress()) { |
+ showPastePopup((int) posXDip, (int) posYDip); |
+ } else { |
+ hidePastePopup(); |
+ } |
+ break; |
+ |
case SelectionEventType.INSERTION_TAPPED: |
- if (getPastePopup().isShowing()) |
+ if (mWasPastePopupShowing) |
mPastePopupMenu.hide(); |
else |
showPastePopup((int) posXDip, (int) posYDip); |
@@ -2196,6 +2205,7 @@ public class ContentViewCore |
case SelectionEventType.INSERTION_CLEARED: |
mHasInsertion = false; |
+ mWasPastePopupShowing = false; |
hidePastePopup(); |
break; |