commit | b4a66d53661192cf683d9f63b67fc3124f03b3be | [log] [tgz] |
---|---|---|
author | Tessa Nijssen <tnijssen@google.com> | Mon Aug 13 22:40:39 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Mon Aug 13 22:40:39 2018 |
tree | 79c19cdb2befccf1e6f9e4c34952b62b34a442a6 | |
parent | 65c769e79f72e86d9d5db43255326b50ac34624f [diff] |
[Mac] Add Offset to TextSuggestionsTouchBarController Text Selection This is a reland of http://crrev/c/1169597 with @available checks added to TextSuggestionsTouchBarControllerTest.Offset in browser tests. 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: I83f7b3f381086118212106dff3b0b34ed8be2237 Reviewed-on: https://chromium-review.googlesource.com/1173052 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@{#582726}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .