Chromium Code Reviews| 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 831f9e1691a06034b7758c7a004287350c6849f8..4c7c7f6d4094072484cb9542eab49060ee4e46df 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 |
| @@ -273,6 +273,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
Nit: booleans always default to false in Java, no
AKVT
2014/08/01 14:42:07
Done.
|
| private PopupTouchHandleDrawableDelegate mTouchHandleDelegate; |
| @@ -2150,13 +2151,20 @@ public class ContentViewCore |
| mHasInsertion = true; |
| break; |
| + case SelectionEventType.INSERTION_DRAG_BEGUN: |
| + mWasPastePopupShowing = getPastePopup().isShowing(); |
|
jdduke (slow)
2014/07/23 16:54:58
Hmm, I'd like to first land a change that suppress
AKVT
2014/07/23 17:19:01
Thanks for the clarification. I will hold this cha
|
| + hidePastePopup(); |
| + break; |
| + |
| case SelectionEventType.INSERTION_MOVED: |
| - // TODO(jdduke): Handle case where movement triggered by focus. |
| + boolean isPastePopupShowing = getPastePopup().isShowing(); |
| hidePastePopup(); |
|
jdduke (slow)
2014/07/28 15:51:07
Can we avoid hiding then immediately showing? I th
AKVT
2014/07/28 16:56:58
We have to reposition the popup even when it was s
jdduke (slow)
2014/07/28 17:26:28
That sounds like a bug to me. What if you delete t
AKVT
2014/07/30 12:06:56
@jdduke Thanks for pointing the issue in positionA
|
| + if (isPastePopupShowing && !isScrollInProgress()) |
| + showPastePopup((int) posXDip, (int) posYDip); |
| break; |
| case SelectionEventType.INSERTION_TAPPED: |
| - if (getPastePopup().isShowing()) |
| + if (mWasPastePopupShowing) |
| mPastePopupMenu.hide(); |
| else |
| showPastePopup((int) posXDip, (int) posYDip); |
| @@ -2164,6 +2172,7 @@ public class ContentViewCore |
| case SelectionEventType.INSERTION_CLEARED: |
| mHasInsertion = false; |
| + mWasPastePopupShowing = false; |
| hidePastePopup(); |
| break; |