commit | 9659ddbbb546c582f116a4c614db82e2de499d51 | [log] [tgz] |
---|---|---|
author | Kinuko Yasuda <kinuko@chromium.org> | Thu Aug 02 03:56:38 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Aug 02 03:56:38 2018 |
tree | 46cb2882945475a012ce69757b77095f8effb4d4 | |
parent | 8f2328199e5b55b8ea34e18f07556c769908f5e9 [diff] |
Revert "[Mac] Re-Generate Text Suggestions on WebContents Update" This reverts commit 3d248fc52fbaae7e7b37ed5f5b4dc545f31462a5. Reason for revert: SuggestedTextTouchBarControllerBrowserTest constantly failing after this. https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.11%20Tests/28381 https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.11%20Tests/28382 https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.12%20Tests/14729 https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.12%20Tests/14730 Original change's description: > [Mac] Re-Generate Text Suggestions on WebContents Update > > Previously, each tab had its own SuggestedTextTouchBarController. Now, > because of http://crrev/c/1151613, there is only one > SuggestedTextTouchBarController per window. Because the controller does > not maintain the state of each tab, as a user switches tabs, the > controller needs to update its state to match the tab. When the > controller's WebContents change, new suggestions should be generated > for the selected text in the current tab. > > The methods -webContentsTextSelectionChanged:range: and > -webContentsFinishedLoading were combined into a singular method, > -updateTextSelection:range:, because they had very similar > functionality. > > The parameters for -requestSuggestionsForText:inRange: were removed > because they were always |text_| and |selectionRange_|. > > A new method was created, -webContentsChanged, to get a tab's current > text and selected range and then call -updateTextSelection:range: with > the proper parameters. > > When the controller gets a new pointer to a WebContents, the pointer > may be null. To avoid calling WebContents::IsFocusedElementEditable() > on a null pointer, a method -isTextfieldFocused was created to check > that |webContents_| is not a null pointer and that an editable element > is focused. > > A new SuggestedTextTouchBarControllerBrowserTest was written, > SetWebContentsTest, to test that the SuggestedTextTouchBarController > properly updates its current text selection based on the new > WebContents. > > Bug: 717553 > Change-Id: I356a548bbdf33b51484fd7c55a1aa5ea37be4bae > Reviewed-on: https://chromium-review.googlesource.com/1153728 > 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@{#579851} TBR=avi@chromium.org,spqchan@chromium.org,tnijssen@google.com Change-Id: I043f5352f43f9ee5eaeff6c7f5a0a9c64b067d26 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 717553 Reviewed-on: https://chromium-review.googlesource.com/1159902 Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Commit-Queue: Kinuko Yasuda <kinuko@chromium.org> Cr-Commit-Position: refs/heads/master@{#580052}
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 .