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

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: Rebased the patch to align dependent patches. 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 5f0f0fefcc5bfd439a086ea1baa684bafbb6b04a..008229414c6eeedf3fdaf303a59344cb378062fa 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
@@ -292,6 +292,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;
@@ -2191,13 +2192,21 @@ 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 = getPastePopup().isShowing();
jdduke (slow) 2014/08/07 21:18:04 getPastePopup() will create a new PastePopup if no
AKVT 2014/08/08 12:54:44 Done. Thanks
hidePastePopup();
break;
+ case SelectionEventType.INSERTION_MOVED:
jdduke (slow) 2014/08/07 21:18:04 if (mPastePopupMenu != null && mPastePopupMenu.isS
AKVT 2014/08/08 12:54:44 Done.
+ if (getPastePopup().isShowing() && !isScrollInProgress()) {
+ showPastePopup((int) posXDip, (int) posYDip);
+ } else {
+ hidePastePopup();
+ }
+ break;
+
case SelectionEventType.INSERTION_TAPPED:
- if (getPastePopup().isShowing())
+ if (mWasPastePopupShowingOnInsertionDragStart)
mPastePopupMenu.hide();
jdduke (slow) 2014/08/07 21:18:04 Let's make this |hidePastePopup()| to match the |s
AKVT 2014/08/08 12:54:44 Done.
else
showPastePopup((int) posXDip, (int) posYDip);
@@ -2205,6 +2214,7 @@ public class ContentViewCore
case SelectionEventType.INSERTION_CLEARED:
mHasInsertion = false;
+ mWasPastePopupShowingOnInsertionDragStart = false;
hidePastePopup();
break;

Powered by Google App Engine
This is Rietveld 408576698