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

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: Fixed review comments and line breaks. Created 6 years, 4 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 672fd3eea1b4074985f4fb1ffa9895dbf6e7afa7..a19c54562eee4c06fbba172f2f4b14ff1500e765 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
@@ -293,6 +293,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 mWasPastePopupShowingOnInsertionDragStart;
private PopupTouchHandleDrawableDelegate mTouchHandleDelegate;
@@ -2209,14 +2210,24 @@ public class ContentViewCore
mHasInsertion = true;
break;
- case SelectionEventType.INSERTION_MOVED:
- // TODO(jdduke): Handle case where movement triggered by focus.
+ case SelectionEventType.INSERTION_DRAG_STARTED:
+ mWasPastePopupShowingOnInsertionDragStart =
+ mPastePopupMenu != null && mPastePopupMenu.isShowing();
hidePastePopup();
break;
+ case SelectionEventType.INSERTION_MOVED:
+ if (mPastePopupMenu == null) break;
+ if (!isScrollInProgress() && mPastePopupMenu.isShowing()) {
+ showPastePopup((int) posXDip, (int) posYDip);
+ } else {
+ hidePastePopup();
+ }
+ break;
+
case SelectionEventType.INSERTION_TAPPED:
- if (getPastePopup().isShowing())
- mPastePopupMenu.hide();
+ if (mWasPastePopupShowingOnInsertionDragStart)
+ hidePastePopup();
else
showPastePopup((int) posXDip, (int) posYDip);
break;

Powered by Google App Engine
This is Rietveld 408576698