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; |