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

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

Issue 1129193007: aw: Ensure synchronization of PopupWindow handle visibility/position (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Slightly simpler visibility fix Created 5 years, 7 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 | « no previous file | content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java » ('j') | 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 43f223cd803aadfb03ac1f04a6e22be733d4f4b3..1e33a9590e4e6589bee9529ee74f7c84089ca6fa 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
@@ -2176,6 +2176,10 @@ public class ContentViewCore implements
@CalledByNative
private void onSelectionEvent(
int eventType, int xAnchor, int yAnchor, int left, int top, int right, int bottom) {
+ // Ensure the provided selection coordinates form a non-empty rect, as required by
+ // the selection action mode.
+ if (left == right) ++right;
+ if (top == bottom) ++bottom;
switch (eventType) {
case SelectionEventType.SELECTION_SHOWN:
mSelectionRect.set(left, top, right, bottom);
@@ -2184,11 +2188,7 @@ public class ContentViewCore implements
// TODO(cjhopman): Remove this when there is a better signal that long press caused
// a selection. See http://crbug.com/150151.
mContainerView.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
- // There may already be an active selection, e.g., if the user
- // longpresses different text while an existing selection is
- // active. In such case, we need to update the selection rect.
showSelectActionMode(true);
- invalidateActionModeContentRect();
break;
case SelectionEventType.SELECTION_MOVED:
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698