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

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

Issue 312293002: Paste popup is positioning properly during content scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added braces as per coding standard. Created 6 years, 5 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
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;

Powered by Google App Engine
This is Rietveld 408576698