Index: content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java |
diff --git a/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java b/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java |
index 6493e4abb98f9cef067f2f883888a7c320db3d72..2fa9625b9b501fe0eada1ed33addc511989af0cd 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java |
@@ -927,12 +927,13 @@ public class SelectionPopupController extends ActionModeCallbackHelper { |
mSelectionRect.set(left, top, right, bottom); |
mHasSelection = true; |
mUnselectAllOnDismiss = true; |
- if (mSelectionClient == null || !mSelectionClient.sendsSelectionPopupUpdates()) { |
- showActionModeOrClearOnFailure(); |
- } else { |
+ if (mSelectionClient != null |
+ && mSelectionClient.requestSelectionPopupUpdates(true /* suggest */)) { |
// Rely on |mSelectionClient| sending a classification request and the request |
// always calling onClassified() callback. |
mPendingShowActionMode = true; |
+ } else { |
+ showActionModeOrClearOnFailure(); |
} |
break; |
@@ -949,6 +950,7 @@ public class SelectionPopupController extends ActionModeCallbackHelper { |
mHasSelection = false; |
mUnselectAllOnDismiss = false; |
mSelectionRect.setEmpty(); |
+ if (mSelectionClient != null) mSelectionClient.cancelAllRequests(); |
finishActionMode(); |
break; |
@@ -957,11 +959,13 @@ public class SelectionPopupController extends ActionModeCallbackHelper { |
break; |
case SelectionEventType.SELECTION_HANDLE_DRAG_STOPPED: |
- if (mSelectionClient == null || !mSelectionClient.sendsSelectionPopupUpdates()) { |
+ if (mSelectionClient != null |
+ && mSelectionClient.requestSelectionPopupUpdates(false /* suggest */)) { |
+ // Rely on |mSelectionClient| sending a classification request and the request |
+ // always calling onClassified() callback. |
+ } else { |
hideActionMode(false); |
} |
- // Otherwise rely on |mSelectionClient| sending a classification request and the |
- // request always calling onClassified() callback. |
break; |
case SelectionEventType.INSERTION_HANDLE_SHOWN: |