Commit 79b60e68 authored by amaralp's avatar amaralp Committed by Commit bot

Smart Select shouldn't shorten selection

If the Smart Select classifier suggests shortening the selection, we discard the
suggestion. This makes it so Smart Select can only extend a selection and thus
fixes the issue where sometimes it would shorten a SelectAll selection.

BUG=714106

Review-Url: https://codereview.chromium.org/2847133004
Cr-Commit-Position: refs/heads/master@{#468473}
parent c8feff62
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment