-
Peter Kasting authored
This reverts commit 1e3c1743. Reason for revert: Breaks Mac tests, see e.g. https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8938549477492727648/+/steps/browser_tests_on__none__GPU_on_Mac_on_Mac-10.11/0/logs/TextSuggestionsTouchBarControllerTest.Offset/0 Original change's description: > [Mac] Add Offset to TextSuggestionsTouchBarController Text Selection > > When the text surrounding the current selection gets too long, only > part of it is received by TextSuggestionsTouchBarController. The > location of the received text within the total block of text is > denoted by an offset. Previously, TextSuggestionsTouchBarController > did not take this offset into account, causing crashes when the > selection range was past the end of the received text. > > The offset is passed along with the text and selection range. The > selection range within the received text is calculated using the > offset and received selection range. The editing word range is stored > both as the range within the received text and the range within the > total text for checking when to ignore text selection updates. > > RenderWidgetHostView::GetOffsetForSurroundingText() was added to > retrieve the offset on WebContents update. > > Browser tests were modified to account for the new offset parameter. A > new browser test, TextSuggestionsTouchBarController.Offset, was added > to test that the controller properly handles offsets. > > Bug: 717553 > Change-Id: I6dce1405fd5c115ca6ddfdbe4157faf75ccc3a6c > Reviewed-on: https://chromium-review.googlesource.com/1169597 > Commit-Queue: Tessa Nijssen <tnijssen@google.com> > Reviewed-by: Avi Drissman <avi@chromium.org> > Reviewed-by: Sarah Chan <spqchan@chromium.org> > Cr-Commit-Position: refs/heads/master@{#582205} TBR=avi@chromium.org,spqchan@chromium.org,tnijssen@google.com Change-Id: If0acdd0494b5270c4b4e221e16b8e901ce2cacc3 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 717553 Reviewed-on: https://chromium-review.googlesource.com/1171704Reviewed-by:
Peter Kasting <pkasting@chromium.org> Commit-Queue: Peter Kasting <pkasting@chromium.org> Cr-Commit-Position: refs/heads/master@{#582423}
c0a0f0be