Chromium Code Reviews| 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 8099d1beabc9bfdcd8c86cd79430628b08d24ae0..3ab00d15a501aa109620f483d4ba85c9c11e7fdf 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 |
| @@ -653,18 +653,24 @@ public class ContextualSearchManager extends ContextualSearchObservable |
| * @param searchTerm The term to use in our subsequent search. |
| * @param displayText The text to display in our UX. |
| * @param alternateTerm The alternate term to display on the results page. |
| + * @param selectionStartAdjust The start offset adjustment of the selection to use to highlight |
| + * the search term. |
| + * @param selectionEndAdjust The end offset adjustment of the selection to use to highlight |
| + * the search term. |
| */ |
| @CalledByNative |
| public void onSearchTermResolutionResponse(boolean isNetworkUnavailable, int responseCode, |
| final String searchTerm, final String displayText, final String alternateTerm, |
| - boolean doPreventPreload) { |
| + boolean doPreventPreload, int selectionStartAdjust, int selectionEndAdjust) { |
| mNetworkCommunicator.handleSearchTermResolutionResponse(isNetworkUnavailable, responseCode, |
| - searchTerm, displayText, alternateTerm, doPreventPreload); |
| + searchTerm, displayText, alternateTerm, doPreventPreload, selectionStartAdjust, |
| + selectionEndAdjust); |
| } |
| @Override |
| public void handleSearchTermResolutionResponse(boolean isNetworkUnavailable, int responseCode, |
| - String searchTerm, String displayText, String alternateTerm, boolean doPreventPreload) { |
| + String searchTerm, String displayText, String alternateTerm, boolean doPreventPreload, |
| + int selectionStartAdjust, int selectionEndAdjust) { |
| if (!mSearchPanelDelegate.isShowing()) return; |
| // Show an appropriate message for what to search for. |
| @@ -707,6 +713,10 @@ public class ContextualSearchManager extends ContextualSearchObservable |
| mPolicy.logSearchTermResolutionDetails(searchTerm, |
| mNetworkCommunicator.getBasePageUrl()); |
| } |
| + |
| + if (selectionStartAdjust != 0 || selectionEndAdjust != 0) { |
| + mSelectionController.adjustSelection(selectionStartAdjust, selectionEndAdjust); |
|
pedro (no code reviews)
2015/06/25 01:30:28
Nit: Call it expandSelection() instead?
aurimas (slooooooooow)
2015/07/01 00:45:38
Done
|
| + } |
| } |
| /** |