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

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: Optimized the condition checks 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
« no previous file with comments | « content/browser/renderer_host/input/touch_selection_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « content/browser/renderer_host/input/touch_selection_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698