commit | 147c8df597ce25c86e46a7a766229732bda10e63 | [log] [tgz] |
---|---|---|
author | Tessa Nijssen <tnijssen@google.com> | Mon Jul 09 17:57:40 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Mon Jul 09 17:57:40 2018 |
tree | ad4f2a9ccda8fdcc7b3474659774ac4e12ff86fd | |
parent | 0bd5cafd46685177663ed991f974e7edc072df73 [diff] |
[Mac] Replace Editing Word with Selected Suggestion from Touch Bar WebContents::Replace() replaces the current text selection with a given string. Currently, SuggestedTextTouchBarController replaces the current user selection when a suggestion is chosen from the touch bar. SuggestedTextTouchBarController now calculates a range that encompasses the word in which the cursor resides. If the cursor is not in or at the end of a word, the range representing the editing word starts at the cursor position and has length 0. When a suggestion is chosen from the touch bar, the selection within the textfield is modified to encompass the word currently being edited (which may be only a cursor position) and then WebContents::Replace() is called to replace the selection. A unit test was written to test that editingWordFromText:cursorPosition: properly calculates the range encompassing the current editing word for various combinations of word and non-word characters. Bug: 717553 Change-Id: I4fe1fbaf2e19f8b33177e07789dca3a30bb7d88e Reviewed-on: https://chromium-review.googlesource.com/1123226 Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Sarah Chan <spqchan@chromium.org> Commit-Queue: Tessa Nijssen <tnijssen@google.com> Cr-Commit-Position: refs/heads/master@{#573362}
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 .