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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java

Issue 2910713002: [TTS] Fix expanding selection at end of some lines (Closed)
Patch Set: Rebase only 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
index 3f43032a04195889d686a236ac5143c9455ec21b..e308ce3094baa412c8f83b31a03e311845f34ac4 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
@@ -727,8 +727,9 @@ public class ContextualSearchManager implements ContextualSearchManagementDelega
if ((selectionStartAdjust != 0 || selectionEndAdjust != 0)
&& mSelectionController.getSelectionType() == SelectionType.TAP) {
String originalSelection = mContext == null ? null : mContext.getInitialSelectedWord();
- if (originalSelection != null
- && originalSelection.equals(mSelectionController.getSelectedText())) {
+ String currentSelection = mSelectionController.getSelectedText();
+ if (currentSelection != null) currentSelection = currentSelection.trim();
+ if (originalSelection != null && originalSelection.trim().equals(currentSelection)) {
mSelectionController.adjustSelection(selectionStartAdjust, selectionEndAdjust);
mContext.onSelectionAdjusted(selectionStartAdjust, selectionEndAdjust);
}
« 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