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

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

Issue 2863573004: Explicitly tell Smart Select whether or not to suggest (Closed)
Patch Set: fixing nits Created 3 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 | « content/public/android/java/src/org/chromium/content/browser/SelectionClient.java ('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/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:
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/SelectionClient.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698