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

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

Issue 2847133004: Smart Select shouldn't shorten selection (Closed)
Patch Set: adding tod Created 3 years, 8 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 | 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 df436286db9f02491051f09dbb0e97f44afb2607..33d15074697addc10640d7fda5c6298bc53f7c05 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
@@ -1034,6 +1034,18 @@ public class SelectionPopupController extends ActionModeCallbackHelper {
return;
}
+ // Do not allow classifier to shorten the selection. If the suggested selection is
+ // smaller than the original we throw away classification result and show the menu.
+ // TODO(amaralp): This was added to fix the SelectAll problem in
+ // http://crbug.com/714106. Once we know the cause of the original selection we can
+ // remove this check.
+ if (result.startAdjust > 0 || result.endAdjust < 0) {
+ mClassificationResult = null;
+ mPendingShowActionMode = false;
+ showActionModeOrClearOnFailure();
+ return;
+ }
+
// The classificationresult is a property of the selection. Keep it even the action
// mode has been dismissed.
mClassificationResult = result;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698