Add support for Touch Bar typing suggestions
Reported by
litom...@gmail.com,
May 2 2017
|
|||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.1 Safari/603.1.30 Steps to reproduce the problem: 1. You need a MacBook Pro (with Multi-Touch Bar) 2. Make sure you have checked "Touch Bar typing suggestions" option in System Preference > Keyborad > Text 3. Typing on any text view, there is no typing suggestions on Touch Bar I created the same issue on Electron, but this could be Chromium's bug. [Add support for Touch Bar typing suggestions] https://github.com/electron/electron/issues/9349 What is the expected behavior? There are emoji button and typing suggestions on Touch Bar. What went wrong? Touch Bar typing suggestions doesn't work on Chromium Did this work before? No Chrome version: 60.0.3080.5 (Official Build) dev (64-bit) Channel: n/a OS Version: OS X 10.12.4 Flash Version:
,
May 2 2017
,
Jul 26 2017
,
Aug 3 2017
,
May 31 2018
,
Jun 9 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/177ab6469163b4ae7d28abdccd4f44e6e61d4769 commit 177ab6469163b4ae7d28abdccd4f44e6e61d4769 Author: Tessa Nijssen <tnijssen@google.com> Date: Sat Jun 09 00:54:50 2018 [Mac] Created Suggested Text Touch Bar When text is selected in a textfield, the touch bar displays options to replace the selected text. Clicking on one of the options will replace the selected text with the selected option. Currently, there are no functional unit tests for the suggested text touch bar. As functionality is fleshed out, unit tests will be created. A new folder (chrome/browser/ui/cocoa/touchbar) was created to house all files related to the Mac touch bar. The CreditCardAutofillTouchBarController files and the WebTextfieldTouchBarController files were moved to this new folder. Dependencies and header guards were updated to reflect this change. New files: - suggested_text_touch_bar_controller.h - suggested_text_touch_bar_controller.mm - suggested_text_touch_bar_controller_browsertest.mm Moved files: - credit_card_autofill_touch_bar_controller.h - credit_card_autofill_touch_bar_controller.mm - credit_card_autofill_touch_bar_controller_unittest.mm - web_textfield_touch_bar_controller.h - web_textfield_touch_bar_controller.mm BUILD files were updated to accomodate the change in location for the moved files and to include the new files. WebContentsImpl, WebContentsDelegate, and WebContentsObserver were modified so that the SuggestedTextTouchBarController can observe TextInputManager for a change in text selection. A feature flag SuggestedTextTouchBar was created and added to chrome://about so that the new touch bar is disabled by default and can be enabled via command line or chrome://flags with the flag #enable-suggested-text-touch-bar. This CL includes the following browser tests for SuggestedTextTouchBarController: - SetTextTest - TouchBarTest - TextSelectionChangedTest Bug: 717553 Change-Id: Icdd796c5d7ff6f67598b58c6c6c8c17a6a85d004 Reviewed-on: https://chromium-review.googlesource.com/1069495 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@{#565799} [modify] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/browser/about_flags.cc [modify] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/browser/flag_descriptions.cc [modify] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/browser/flag_descriptions.h [modify] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/browser/ui/BUILD.gn [modify] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/browser/ui/autofill/autofill_popup_controller_impl_mac.mm [modify] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm [rename] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/browser/ui/cocoa/touchbar/credit_card_autofill_touch_bar_controller.h [rename] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/browser/ui/cocoa/touchbar/credit_card_autofill_touch_bar_controller.mm [rename] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/browser/ui/cocoa/touchbar/credit_card_autofill_touch_bar_controller_unittest.mm [add] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.h [add] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.mm [add] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_browsertest.mm [rename] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/browser/ui/cocoa/touchbar/web_textfield_touch_bar_controller.h [rename] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/browser/ui/cocoa/touchbar/web_textfield_touch_bar_controller.mm [modify] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/common/chrome_features.cc [modify] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/common/chrome_features.h [modify] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/chrome/test/BUILD.gn [modify] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/content/browser/web_contents/web_contents_impl.cc [modify] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/content/browser/web_contents/web_contents_impl.h [modify] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/content/public/browser/web_contents_observer.h [modify] https://crrev.com/177ab6469163b4ae7d28abdccd4f44e6e61d4769/tools/metrics/histograms/enums.xml
,
Jun 11 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c28bf5aa8b20f86eae37481943fa327aeed6d5b1 commit c28bf5aa8b20f86eae37481943fa327aeed6d5b1 Author: Mark Pearson <mpearson@chromium.org> Date: Mon Jun 11 21:56:34 2018 Revert "[Mac] Created Suggested Text Touch Bar" This reverts commit 177ab6469163b4ae7d28abdccd4f44e6e61d4769. Reason for revert: [experimental revert] chromedriver_py_tests has been failing on two Mac bots since this change landed. It's the only plausible candidate on the blamelist. First failure on each of the two bots that failed. https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.11%20Tests/27182 https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.10%20Tests/32954 Four tests in this suite fail: ====================================================================== ERROR: testSendKeysToElement (__main__.ChromeDriverTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "../../chrome/test/chromedriver/test/run_py_tests.py", line 677, in testSendKeysToElement text.SendKeys(', there!') File "/b/s/w/ir/chrome/test/chromedriver/test/../client/webelement.py", line 59, in SendKeys self._Execute(Command.SEND_KEYS_TO_ELEMENT, {'value': typing}) File "/b/s/w/ir/chrome/test/chromedriver/test/../client/webelement.py", line 18, in _Execute return self._chromedriver.ExecuteCommand(command, params) File "/b/s/w/ir/chrome/test/chromedriver/test/../client/chromedriver.py", line 298, in ExecuteCommand response = self._ExecuteCommand(command, params) File "/b/s/w/ir/chrome/test/chromedriver/test/../client/chromedriver.py", line 291, in _ExecuteCommand raise _ExceptionForLegacyResponse(response) ChromeDriverException: chrome not reachable (Session info: chrome=69.0.3454.0) (Driver info: chromedriver=2.40.565811 (22b36989b1ba408a526d457fac93653895890b54),platform=Mac OS X 10.10.5 x86_64) ====================================================================== ERROR: testSendingTabKeyMovesToNextInputElement (__main__.ChromeDriverTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "../../chrome/test/chromedriver/test/run_py_tests.py", line 686, in testSendingTabKeyMovesToNextInputElement self._driver.SendKeys('snoopy') File "/b/s/w/ir/chrome/test/chromedriver/test/../client/chromedriver.py", line 574, in SendKeys self.ExecuteCommand(Command.SEND_KEYS_TO_ACTIVE_ELEMENT, {'value': typing}) File "/b/s/w/ir/chrome/test/chromedriver/test/../client/chromedriver.py", line 298, in ExecuteCommand response = self._ExecuteCommand(command, params) File "/b/s/w/ir/chrome/test/chromedriver/test/../client/chromedriver.py", line 291, in _ExecuteCommand raise _ExceptionForLegacyResponse(response) ChromeDriverException: chrome not reachable (Session info: chrome=69.0.3454.0) (Driver info: chromedriver=2.40.565811 (22b36989b1ba408a526d457fac93653895890b54),platform=Mac OS X 10.10.5 x86_64) ====================================================================== ERROR: testShadowDomSendKeys (__main__.ChromeDriverTest) Checks that chromedriver can call SendKeys on a shadow DOM element. ---------------------------------------------------------------------- Traceback (most recent call last): File "../../chrome/test/chromedriver/test/run_py_tests.py", line 1253, in testShadowDomSendKeys 'return document.querySelector("* /deep/ #olderTextBox").value;')) File "/b/s/w/ir/chrome/test/chromedriver/test/../client/chromedriver.py", line 322, in ExecuteScript Command.EXECUTE_SCRIPT, {'script': script, 'args': converted_args}) File "/b/s/w/ir/chrome/test/chromedriver/test/../client/chromedriver.py", line 298, in ExecuteCommand response = self._ExecuteCommand(command, params) File "/b/s/w/ir/chrome/test/chromedriver/test/../client/chromedriver.py", line 291, in _ExecuteCommand raise _ExceptionForLegacyResponse(response) ChromeDriverException: chrome not reachable (Session info: chrome=69.0.3454.0) (Driver info: chromedriver=2.40.565811 (22b36989b1ba408a526d457fac93653895890b54),platform=Mac OS X 10.10.5 x86_64) ====================================================================== ERROR: testSendKeysToElement (__main__.MobileEmulationCapabilityTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "../../chrome/test/chromedriver/test/run_py_tests.py", line 2256, in testSendKeysToElement text.SendKeys(', there!') File "/b/s/w/ir/chrome/test/chromedriver/test/../client/webelement.py", line 59, in SendKeys self._Execute(Command.SEND_KEYS_TO_ELEMENT, {'value': typing}) File "/b/s/w/ir/chrome/test/chromedriver/test/../client/webelement.py", line 18, in _Execute return self._chromedriver.ExecuteCommand(command, params) File "/b/s/w/ir/chrome/test/chromedriver/test/../client/chromedriver.py", line 298, in ExecuteCommand response = self._ExecuteCommand(command, params) File "/b/s/w/ir/chrome/test/chromedriver/test/../client/chromedriver.py", line 291, in _ExecuteCommand raise _ExceptionForLegacyResponse(response) ChromeDriverException: chrome not reachable (Session info: chrome=69.0.3454.0) (Driver info: chromedriver=2.40.565811 (22b36989b1ba408a526d457fac93653895890b54),platform=Mac OS X 10.10.5 x86_64) ---------------------------------------------------------------------- Ran 129 tests in 225.387s FAILED (errors=4) Original change's description: > [Mac] Created Suggested Text Touch Bar > > When text is selected in a textfield, the touch bar displays options > to replace the selected text. Clicking on one of the options will > replace the selected text with the selected option. > > Currently, there are no functional unit tests for the suggested text > touch bar. As functionality is fleshed out, unit tests will be > created. > > A new folder (chrome/browser/ui/cocoa/touchbar) was created to house all > files related to the Mac touch bar. The > CreditCardAutofillTouchBarController files and the > WebTextfieldTouchBarController files were moved to this new folder. > Dependencies and header guards were updated to reflect this change. > > New files: > - suggested_text_touch_bar_controller.h > - suggested_text_touch_bar_controller.mm > - suggested_text_touch_bar_controller_browsertest.mm > Moved files: > - credit_card_autofill_touch_bar_controller.h > - credit_card_autofill_touch_bar_controller.mm > - credit_card_autofill_touch_bar_controller_unittest.mm > - web_textfield_touch_bar_controller.h > - web_textfield_touch_bar_controller.mm > > BUILD files were updated to accomodate the change in location for the > moved files and to include the new files. > > WebContentsImpl, WebContentsDelegate, and WebContentsObserver were > modified so that the SuggestedTextTouchBarController can observe > TextInputManager for a change in text selection. > > A feature flag SuggestedTextTouchBar was created and added to > chrome://about so that the new touch bar is disabled by default and > can be enabled via command line or chrome://flags with the flag > #enable-suggested-text-touch-bar. > > This CL includes the following browser tests for > SuggestedTextTouchBarController: > - SetTextTest > - TouchBarTest > - TextSelectionChangedTest > > Bug: 717553 > Change-Id: Icdd796c5d7ff6f67598b58c6c6c8c17a6a85d004 > Reviewed-on: https://chromium-review.googlesource.com/1069495 > 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@{#565799} TBR=avi@chromium.org,spqchan@chromium.org,tnijssen@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 717553 Change-Id: I0e3c6cfd00dba3065bd74efea043f1137599460c Reviewed-on: https://chromium-review.googlesource.com/1095674 Reviewed-by: Mark Pearson <mpearson@chromium.org> Commit-Queue: Mark Pearson <mpearson@chromium.org> Cr-Commit-Position: refs/heads/master@{#566163} [modify] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/chrome/browser/about_flags.cc [modify] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/chrome/browser/flag_descriptions.cc [modify] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/chrome/browser/flag_descriptions.h [modify] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/chrome/browser/ui/BUILD.gn [modify] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/chrome/browser/ui/autofill/autofill_popup_controller_impl_mac.mm [rename] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/chrome/browser/ui/cocoa/autofill/credit_card_autofill_touch_bar_controller.h [rename] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/chrome/browser/ui/cocoa/autofill/credit_card_autofill_touch_bar_controller.mm [rename] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/chrome/browser/ui/cocoa/autofill/credit_card_autofill_touch_bar_controller_unittest.mm [modify] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm [delete] https://crrev.com/9a0f21fd543c5e41a2d3ef17aa7eaa5eb91eee06/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.h [delete] https://crrev.com/9a0f21fd543c5e41a2d3ef17aa7eaa5eb91eee06/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.mm [delete] https://crrev.com/9a0f21fd543c5e41a2d3ef17aa7eaa5eb91eee06/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_browsertest.mm [rename] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/chrome/browser/ui/cocoa/web_textfield_touch_bar_controller.h [rename] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/chrome/browser/ui/cocoa/web_textfield_touch_bar_controller.mm [modify] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/chrome/common/chrome_features.cc [modify] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/chrome/common/chrome_features.h [modify] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/chrome/test/BUILD.gn [modify] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/content/browser/web_contents/web_contents_impl.cc [modify] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/content/browser/web_contents/web_contents_impl.h [modify] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/content/public/browser/web_contents_observer.h [modify] https://crrev.com/c28bf5aa8b20f86eae37481943fa327aeed6d5b1/tools/metrics/histograms/enums.xml
,
Jun 12 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b0bedb93eb732486e3701f3de0d11a3164d9ea79 commit b0bedb93eb732486e3701f3de0d11a3164d9ea79 Author: Tessa Nijssen <tnijssen@google.com> Date: Tue Jun 12 19:59:12 2018 [Mac] Created Suggested Text Touch Bar When text is selected in a textfield, the touch bar displays options to replace the selected text. Clicking on one of the options will replace the selected text with the selected option. Currently, there are no functional unit tests for the suggested text touch bar. As functionality is fleshed out, unit tests will be created. A new folder (chrome/browser/ui/cocoa/touchbar) was created to house all files related to the Mac touch bar. The CreditCardAutofillTouchBarController files and the WebTextfieldTouchBarController files were moved to this new folder. Dependencies and header guards were updated to reflect this change. New files: - suggested_text_touch_bar_controller.h - suggested_text_touch_bar_controller.mm - suggested_text_touch_bar_controller_browsertest.mm Moved files: - credit_card_autofill_touch_bar_controller.h - credit_card_autofill_touch_bar_controller.mm - credit_card_autofill_touch_bar_controller_unittest.mm - web_textfield_touch_bar_controller.h - web_textfield_touch_bar_controller.mm BUILD files were updated to accomodate the change in location for the moved files and to include the new files. WebContentsImpl, WebContentsDelegate, and WebContentsObserver were modified so that the SuggestedTextTouchBarController can observe TextInputManager for a change in text selection. A feature flag SuggestedTextTouchBar was created and added to chrome://about so that the new touch bar is disabled by default and can be enabled via command line or chrome://flags with the flag #enable-suggested-text-touch-bar. This CL includes the following browser tests for SuggestedTextTouchBarController: - SetTextTest - TouchBarTest - TextSelectionChangedTest Bug: 717553 Change-Id: Iddba71339a3631a1405a37e461020345f921f817 Reviewed-on: https://chromium-review.googlesource.com/1096443 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@{#566539} [modify] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/browser/about_flags.cc [modify] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/browser/flag_descriptions.cc [modify] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/browser/flag_descriptions.h [modify] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/browser/ui/BUILD.gn [modify] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/browser/ui/autofill/autofill_popup_controller_impl_mac.mm [modify] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm [rename] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/browser/ui/cocoa/touchbar/credit_card_autofill_touch_bar_controller.h [rename] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/browser/ui/cocoa/touchbar/credit_card_autofill_touch_bar_controller.mm [rename] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/browser/ui/cocoa/touchbar/credit_card_autofill_touch_bar_controller_unittest.mm [add] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.h [add] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.mm [add] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_browsertest.mm [rename] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/browser/ui/cocoa/touchbar/web_textfield_touch_bar_controller.h [rename] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/browser/ui/cocoa/touchbar/web_textfield_touch_bar_controller.mm [modify] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/common/chrome_features.cc [modify] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/common/chrome_features.h [modify] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/chrome/test/BUILD.gn [modify] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/content/browser/web_contents/web_contents_impl.cc [modify] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/content/browser/web_contents/web_contents_impl.h [modify] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/content/public/browser/web_contents_observer.h [modify] https://crrev.com/b0bedb93eb732486e3701f3de0d11a3164d9ea79/tools/metrics/histograms/enums.xml
,
Jun 13 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/05e3dabf1e5482156dbdcba25c3490599f1591ad commit 05e3dabf1e5482156dbdcba25c3490599f1591ad Author: John Budorick <jbudorick@chromium.org> Date: Wed Jun 13 16:54:24 2018 Revert "[Mac] Created Suggested Text Touch Bar" This reverts commit b0bedb93eb732486e3701f3de0d11a3164d9ea79. Reason for revert: Seemingly causing interactive_ui_tests failures. Original change's description: > [Mac] Created Suggested Text Touch Bar > > When text is selected in a textfield, the touch bar displays options > to replace the selected text. Clicking on one of the options will > replace the selected text with the selected option. > > Currently, there are no functional unit tests for the suggested text > touch bar. As functionality is fleshed out, unit tests will be > created. > > A new folder (chrome/browser/ui/cocoa/touchbar) was created to house all > files related to the Mac touch bar. The > CreditCardAutofillTouchBarController files and the > WebTextfieldTouchBarController files were moved to this new folder. > Dependencies and header guards were updated to reflect this change. > > New files: > - suggested_text_touch_bar_controller.h > - suggested_text_touch_bar_controller.mm > - suggested_text_touch_bar_controller_browsertest.mm > Moved files: > - credit_card_autofill_touch_bar_controller.h > - credit_card_autofill_touch_bar_controller.mm > - credit_card_autofill_touch_bar_controller_unittest.mm > - web_textfield_touch_bar_controller.h > - web_textfield_touch_bar_controller.mm > > BUILD files were updated to accomodate the change in location for the > moved files and to include the new files. > > WebContentsImpl, WebContentsDelegate, and WebContentsObserver were > modified so that the SuggestedTextTouchBarController can observe > TextInputManager for a change in text selection. > > A feature flag SuggestedTextTouchBar was created and added to > chrome://about so that the new touch bar is disabled by default and > can be enabled via command line or chrome://flags with the flag > #enable-suggested-text-touch-bar. > > This CL includes the following browser tests for > SuggestedTextTouchBarController: > - SetTextTest > - TouchBarTest > - TextSelectionChangedTest > > Bug: 717553 > Change-Id: Iddba71339a3631a1405a37e461020345f921f817 > Reviewed-on: https://chromium-review.googlesource.com/1096443 > 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@{#566539} TBR=avi@chromium.org,spqchan@chromium.org,tnijssen@google.com Change-Id: I3e465dc39e486e8fa2a7ad4d8e4d4a03096a3ba0 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 717553 Reviewed-on: https://chromium-review.googlesource.com/1099117 Commit-Queue: John Budorick <jbudorick@chromium.org> Reviewed-by: John Budorick <jbudorick@chromium.org> Cr-Commit-Position: refs/heads/master@{#566876} [modify] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/chrome/browser/about_flags.cc [modify] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/chrome/browser/flag_descriptions.cc [modify] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/chrome/browser/flag_descriptions.h [modify] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/chrome/browser/ui/BUILD.gn [modify] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/chrome/browser/ui/autofill/autofill_popup_controller_impl_mac.mm [rename] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/chrome/browser/ui/cocoa/autofill/credit_card_autofill_touch_bar_controller.h [rename] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/chrome/browser/ui/cocoa/autofill/credit_card_autofill_touch_bar_controller.mm [rename] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/chrome/browser/ui/cocoa/autofill/credit_card_autofill_touch_bar_controller_unittest.mm [modify] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm [delete] https://crrev.com/bb67bf56b4b5d4cb0a32b8376eee5e740db220d3/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.h [delete] https://crrev.com/bb67bf56b4b5d4cb0a32b8376eee5e740db220d3/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.mm [delete] https://crrev.com/bb67bf56b4b5d4cb0a32b8376eee5e740db220d3/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_browsertest.mm [rename] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/chrome/browser/ui/cocoa/web_textfield_touch_bar_controller.h [rename] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/chrome/browser/ui/cocoa/web_textfield_touch_bar_controller.mm [modify] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/chrome/common/chrome_features.cc [modify] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/chrome/common/chrome_features.h [modify] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/chrome/test/BUILD.gn [modify] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/content/browser/web_contents/web_contents_impl.cc [modify] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/content/browser/web_contents/web_contents_impl.h [modify] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/content/public/browser/web_contents_observer.h [modify] https://crrev.com/05e3dabf1e5482156dbdcba25c3490599f1591ad/tools/metrics/histograms/enums.xml
,
Jun 25 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5 commit c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5 Author: Tessa Nijssen <tnijssen@google.com> Date: Mon Jun 25 20:28:08 2018 Reland [Mac] Created Suggested Text Touch Bar When text is selected in a textfield, the touch bar displays options to replace the selected text. Clicking on one of the options will replace the selected text with the selected option. Currently, there are no functional unit tests for the suggested text touch bar. As functionality is fleshed out, unit tests will be created. A new folder (chrome/browser/ui/cocoa/touchbar) was created to house all files related to the Mac touch bar. The CreditCardAutofillTouchBarController files and the WebTextfieldTouchBarController files were moved to this new folder. Dependencies and header guards were updated to reflect this change. New files: - suggested_text_touch_bar_controller.h - suggested_text_touch_bar_controller.mm - suggested_text_touch_bar_controller_browsertest.mm Moved files: - credit_card_autofill_touch_bar_controller.h - credit_card_autofill_touch_bar_controller.mm - credit_card_autofill_touch_bar_controller_unittest.mm - web_textfield_touch_bar_controller.h - web_textfield_touch_bar_controller.mm BUILD files were updated to accommodate the change in location for the moved files and to include the new files. RenderWidgetHostViewMac now informs its RenderWidgetHostDelegate (WebContentsImpl) when RenderWidgetHostViewMac::OnTextSelectionChanged() is called. WebContentsImpl then notifies its observers that the text selection changed. A feature flag SuggestedTextTouchBar was created and added to chrome://about so that the new touch bar is disabled by default and can be enabled via command line or chrome://flags with the flag This CL includes the following browser tests for SuggestedTextTouchBarController: - SetTextTest - TouchBarTest - TextSelectionChangedTest This is a reland of crrev/c/1096443 with the following addition: A check was added to see if the SuggestedTextTouchBar feature flag is enabled around the initialization of SuggestedTextTouchBarController and its WebContentsObserver. This way, the controller and observer are not initialized unless they are actually going to be used. Bug: 717553 Change-Id: Ib591a6791700f79f8f683ee3f6c629f00b612cb0 Reviewed-on: https://chromium-review.googlesource.com/1101306 Reviewed-by: Ehsan Karamad <ekaramad@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org> Reviewed-by: Sarah Chan <spqchan@chromium.org> Commit-Queue: Tessa Nijssen <tnijssen@google.com> Cr-Commit-Position: refs/heads/master@{#570158} [modify] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/browser/about_flags.cc [modify] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/browser/flag_descriptions.cc [modify] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/browser/flag_descriptions.h [modify] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/browser/ui/BUILD.gn [modify] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/browser/ui/autofill/autofill_popup_controller_impl_mac.mm [modify] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm [rename] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/browser/ui/cocoa/touchbar/credit_card_autofill_touch_bar_controller.h [rename] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/browser/ui/cocoa/touchbar/credit_card_autofill_touch_bar_controller.mm [rename] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/browser/ui/cocoa/touchbar/credit_card_autofill_touch_bar_controller_unittest.mm [add] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.h [add] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.mm [add] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_browsertest.mm [rename] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/browser/ui/cocoa/touchbar/web_textfield_touch_bar_controller.h [rename] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/browser/ui/cocoa/touchbar/web_textfield_touch_bar_controller.mm [modify] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/common/chrome_features.cc [modify] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/common/chrome_features.h [modify] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/chrome/test/BUILD.gn [modify] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/content/browser/renderer_host/render_widget_host_delegate.h [modify] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/content/browser/renderer_host/render_widget_host_view_mac.mm [modify] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/content/browser/web_contents/web_contents_impl.cc [modify] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/content/browser/web_contents/web_contents_impl.h [modify] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/content/public/browser/web_contents_observer.h [modify] https://crrev.com/c4b10123eaea5c53f3db3fa8f4e4108d9fcf87f5/tools/metrics/histograms/enums.xml
,
Jun 28 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0127f2ebbba4cdc5049f9742767138d6c48e5407 commit 0127f2ebbba4cdc5049f9742767138d6c48e5407 Author: Tessa Nijssen <tnijssen@google.com> Date: Thu Jun 28 18:43:15 2018 [Mac] Get Suggestions from Whole Text and Current Selection Currently, the SuggestedTextTouchBarController generates text suggestions based only text being selected and doesn't take any surrounding text into account. The goal is to generate text suggestions from all the text present in the textfield and the current cursor position, which results in behavior more similar to Safari's text suggestions. First, WebContents::DidChangeTextSelection() and WebContentsObserver::DidChangeTextSelection() were modified to pass in the whole text in the textfield and the current selection range instead of the selected text. The method requestSuggestionsForText: was modified to requestSuggestionsForText:inRange: so that it may receive the full text in the textfield along with the range of the current selection. The WebContentsTextObserver was edited to also observe when a webpage finishes loading. This way, the controller can check whether the cursor is in a textfield before the text selection changes. This is necessary for websites in which a textfield is autofocused. This currently does not account for text that may be in the autofocused textfield, which will be addressed in a later CL. Bug: 717553 Change-Id: I3d56d7e590ba11c9a6c1c2e55f5bf1bb1b398985 Reviewed-on: https://chromium-review.googlesource.com/1101962 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@{#571208} [modify] https://crrev.com/0127f2ebbba4cdc5049f9742767138d6c48e5407/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.h [modify] https://crrev.com/0127f2ebbba4cdc5049f9742767138d6c48e5407/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.mm [modify] https://crrev.com/0127f2ebbba4cdc5049f9742767138d6c48e5407/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_browsertest.mm [modify] https://crrev.com/0127f2ebbba4cdc5049f9742767138d6c48e5407/content/browser/renderer_host/render_widget_host_delegate.h [modify] https://crrev.com/0127f2ebbba4cdc5049f9742767138d6c48e5407/content/browser/renderer_host/render_widget_host_view_mac.mm [modify] https://crrev.com/0127f2ebbba4cdc5049f9742767138d6c48e5407/content/browser/web_contents/web_contents_impl.cc [modify] https://crrev.com/0127f2ebbba4cdc5049f9742767138d6c48e5407/content/browser/web_contents/web_contents_impl.h [modify] https://crrev.com/0127f2ebbba4cdc5049f9742767138d6c48e5407/content/public/browser/web_contents_observer.h
,
Jun 28 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/786ca1f973106684cd36eb74a285ebd96cae5793 commit 786ca1f973106684cd36eb74a285ebd96cae5793 Author: Yi Gu <yigu@chromium.org> Date: Thu Jun 28 21:39:28 2018 Revert "[Mac] Get Suggestions from Whole Text and Current Selection" This reverts commit 0127f2ebbba4cdc5049f9742767138d6c48e5407. Reason for revert: Failing test bot https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.13%20Tests%20%28dbg%29/3661 Original change's description: > [Mac] Get Suggestions from Whole Text and Current Selection > > Currently, the SuggestedTextTouchBarController generates text > suggestions based only text being selected and doesn't take any > surrounding text into account. The goal is to generate text > suggestions from all the text present in the textfield and the > current cursor position, which results in behavior more similar to > Safari's text suggestions. > > First, WebContents::DidChangeTextSelection() and > WebContentsObserver::DidChangeTextSelection() were modified to pass in > the whole text in the textfield and the current selection range > instead of the selected text. > > The method requestSuggestionsForText: was modified to > requestSuggestionsForText:inRange: so that it may receive the full > text in the textfield along with the range of the current selection. > > The WebContentsTextObserver was edited to also observe when a > webpage finishes loading. This way, the controller can check whether > the cursor is in a textfield before the text selection changes. This > is necessary for websites in which a textfield is autofocused. > This currently does not account for text that may be in the > autofocused textfield, which will be addressed in a later CL. > > Bug: 717553 > Change-Id: I3d56d7e590ba11c9a6c1c2e55f5bf1bb1b398985 > Reviewed-on: https://chromium-review.googlesource.com/1101962 > 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@{#571208} TBR=avi@chromium.org,spqchan@chromium.org,tnijssen@google.com Change-Id: Iab7f11ad32948d911bd23f27bbb5cf48721cff45 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 717553 Reviewed-on: https://chromium-review.googlesource.com/1119265 Reviewed-by: Yi Gu <yigu@chromium.org> Commit-Queue: Yi Gu <yigu@chromium.org> Cr-Commit-Position: refs/heads/master@{#571273} [modify] https://crrev.com/786ca1f973106684cd36eb74a285ebd96cae5793/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.h [modify] https://crrev.com/786ca1f973106684cd36eb74a285ebd96cae5793/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.mm [modify] https://crrev.com/786ca1f973106684cd36eb74a285ebd96cae5793/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_browsertest.mm [modify] https://crrev.com/786ca1f973106684cd36eb74a285ebd96cae5793/content/browser/renderer_host/render_widget_host_delegate.h [modify] https://crrev.com/786ca1f973106684cd36eb74a285ebd96cae5793/content/browser/renderer_host/render_widget_host_view_mac.mm [modify] https://crrev.com/786ca1f973106684cd36eb74a285ebd96cae5793/content/browser/web_contents/web_contents_impl.cc [modify] https://crrev.com/786ca1f973106684cd36eb74a285ebd96cae5793/content/browser/web_contents/web_contents_impl.h [modify] https://crrev.com/786ca1f973106684cd36eb74a285ebd96cae5793/content/public/browser/web_contents_observer.h
,
Jun 29 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/dbef474840afdf0e12809cc47e0166e17fc33978 commit dbef474840afdf0e12809cc47e0166e17fc33978 Author: Tessa Nijssen <tnijssen@google.com> Date: Fri Jun 29 21:02:08 2018 Reland [Mac] Get Suggestions from Whole Text and Current Selection Currently, the SuggestedTextTouchBarController generates text suggestions based only text being selected and doesn't take any surrounding text into account. The goal is to generate text suggestions from all the text present in the textfield and the current cursor position, which results in behavior more similar to Safari's text suggestions. First, WebContents::DidChangeTextSelection() and WebContentsObserver::DidChangeTextSelection() were modified to pass in the whole text in the textfield and the current selection range instead of the selected text. The method requestSuggestionsForText: was modified to requestSuggestionsForText:inRange: so that it may receive the full text in the textfield along with the range of the current selection. The WebContentsTextObserver was edited to also observe when a webpage finishes loading. This way, the controller can check whether the cursor is in a textfield before the text selection changes. This is necessary for websites in which a textfield is autofocused. This currently does not account for text that may be in the autofocused textfield, which will be addressed in a later CL. The browser tests for SuggestedTextTouchBarController were updated to reflect the new behavior. TouchBarTest now only checks if a touch bar is created based on whether or not a textfield is focused, as that is the only condition required for the creation of a touch bar. Text selection test now passes a range to -webContentsTextSelectionChanged: and tests that the range is stored properly afterwards. Unnecessary asserts were removed from both tests. The way that tests access the SuggestedTextTouchBarController was also modified to reduce the amount of memory used and make the code cleaner. Now, tests access one global controller rather than creating a new one for every test. Bug: 717553 Change-Id: Ia9a62a1b802976cbc76e2243d60d0a41cd1844cd Reviewed-on: https://chromium-review.googlesource.com/1119363 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@{#571624} [modify] https://crrev.com/dbef474840afdf0e12809cc47e0166e17fc33978/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.h [modify] https://crrev.com/dbef474840afdf0e12809cc47e0166e17fc33978/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.mm [modify] https://crrev.com/dbef474840afdf0e12809cc47e0166e17fc33978/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_browsertest.mm [modify] https://crrev.com/dbef474840afdf0e12809cc47e0166e17fc33978/content/browser/renderer_host/render_widget_host_delegate.h [modify] https://crrev.com/dbef474840afdf0e12809cc47e0166e17fc33978/content/browser/renderer_host/render_widget_host_view_mac.mm [modify] https://crrev.com/dbef474840afdf0e12809cc47e0166e17fc33978/content/browser/web_contents/web_contents_impl.cc [modify] https://crrev.com/dbef474840afdf0e12809cc47e0166e17fc33978/content/browser/web_contents/web_contents_impl.h [modify] https://crrev.com/dbef474840afdf0e12809cc47e0166e17fc33978/content/public/browser/web_contents_observer.h
,
Jul 9
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/147c8df597ce25c86e46a7a766229732bda10e63 commit 147c8df597ce25c86e46a7a766229732bda10e63 Author: Tessa Nijssen <tnijssen@google.com> Date: Mon Jul 09 17:57:40 2018 [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} [modify] https://crrev.com/147c8df597ce25c86e46a7a766229732bda10e63/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.h [modify] https://crrev.com/147c8df597ce25c86e46a7a766229732bda10e63/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.mm [add] https://crrev.com/147c8df597ce25c86e46a7a766229732bda10e63/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_unittest.mm [modify] https://crrev.com/147c8df597ce25c86e46a7a766229732bda10e63/chrome/test/BUILD.gn
,
Jul 9
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1fc231e853b71bca0bbe2597748052253841fff0 commit 1fc231e853b71bca0bbe2597748052253841fff0 Author: Philip Rogers <pdr@chromium.org> Date: Mon Jul 09 21:45:46 2018 Revert "[Mac] Replace Editing Word with Selected Suggestion from Touch Bar" This reverts commit 147c8df597ce25c86e46a7a766229732bda10e63. Reason for revert: Test failure, see crbug.com/861893 Original change's description: > [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} TBR=avi@chromium.org,spqchan@chromium.org,tnijssen@google.com Change-Id: I8e79b608aab37f7fda5e09f6fbd3d16c0d19a384 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 717553 Reviewed-on: https://chromium-review.googlesource.com/1130120 Reviewed-by: Philip Rogers <pdr@chromium.org> Commit-Queue: Philip Rogers <pdr@chromium.org> Cr-Commit-Position: refs/heads/master@{#573459} [modify] https://crrev.com/1fc231e853b71bca0bbe2597748052253841fff0/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.h [modify] https://crrev.com/1fc231e853b71bca0bbe2597748052253841fff0/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.mm [delete] https://crrev.com/5ce8880baa741c8e31cfd47ede17490128590488/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_unittest.mm [modify] https://crrev.com/1fc231e853b71bca0bbe2597748052253841fff0/chrome/test/BUILD.gn
,
Jul 13
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b91e80714f58d76d9ad55cfd9d78b8e37aad5d57 commit b91e80714f58d76d9ad55cfd9d78b8e37aad5d57 Author: Tessa Nijssen <tnijssen@google.com> Date: Fri Jul 13 18:53:49 2018 Reland [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. Some parameter types were changed to reduce the number of conversions from base::string16 to NSString and vice versa. Previously, WebContentsTextObserver::DidChangeTextSelection() took a base::string16 as a parameter. It would then convert that input to NSString and pass it to webContentsTextSelectionChanged:range: which would then call editingWordRangeFromText:cursorPosition: which would then convert the NSString back to a base::string16. The call to BreakIterator::Init() was moved out of a DCHECK because DCHECKs are stripped for release builds and the call to Init() should not be removed. Bug: 717553 Change-Id: I367093e13129609c7238bdb9125bbd69a3910f0c Reviewed-on: https://chromium-review.googlesource.com/1130232 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@{#575000} [modify] https://crrev.com/b91e80714f58d76d9ad55cfd9d78b8e37aad5d57/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.h [modify] https://crrev.com/b91e80714f58d76d9ad55cfd9d78b8e37aad5d57/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.mm [modify] https://crrev.com/b91e80714f58d76d9ad55cfd9d78b8e37aad5d57/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_browsertest.mm [add] https://crrev.com/b91e80714f58d76d9ad55cfd9d78b8e37aad5d57/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_unittest.mm [modify] https://crrev.com/b91e80714f58d76d9ad55cfd9d78b8e37aad5d57/chrome/test/BUILD.gn
,
Jul 20
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d1e2a7bcbc4d1eec42bfdfac1116c8aba2e58411 commit d1e2a7bcbc4d1eec42bfdfac1116c8aba2e58411 Author: Tessa Nijssen <tnijssen@google.com> Date: Fri Jul 20 20:42:09 2018 [Mac] Collapse NSCandidateListTouchBarItem if Text is Selected On Safari, when there is text selected and not just a cursor in text, the NSCandidateListTouchBarItem collapses. This change checks if the selection range has a non-zero length, and if it does, collapses the created NSCandidateListTouchBarItem. The text suggestions are still accessible by clicking on the collapsed NSTouchBarItem. A unit test, CollapsedCandidateListTest, was written to test that the NSTouchBarItem properly collapses according to the length of the selection range. Bug: 717553 Change-Id: I25671450f43b4ba14197f76e431f9212d5494187 Reviewed-on: https://chromium-review.googlesource.com/1144300 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@{#576975} [modify] https://crrev.com/d1e2a7bcbc4d1eec42bfdfac1116c8aba2e58411/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.mm [modify] https://crrev.com/d1e2a7bcbc4d1eec42bfdfac1116c8aba2e58411/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_unittest.mm
,
Jul 24
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8a2c888acc4d52b4d01f20ed2137ea35f08d6ba1 commit 8a2c888acc4d52b4d01f20ed2137ea35f08d6ba1 Author: Tessa Nijssen <tnijssen@google.com> Date: Tue Jul 24 20:18:47 2018 [Mac] Text Suggestion Selection Replaces Trailing Whitespace When the user selects a text suggestion from the SuggestedTextTouchBar, the string returned by AppKit API has the necessary trailing whitespace. Currently, when the current editing word is replaced, AppKit's whitespace is added alongside the existing trailing whitespace. This change includes whitespace after a word or the current cursor position into the editing word range. Then, when the editing word is replaced, or the suggestion's text is placed at the cursor, the existing trailing whitespace is also replaced with the suggestion's trailing whitespace. The EditingWordRangeTest in SuggestedTextTouchBarControllerUnitTests was split into multiple tests. A test case was added, WhitespaceEditingWordRangeTest, to test that editingWordRangeFromText:cursorPosition: properly calculates the editing word range as it moves through non-word characters. Existing test cases were modified to reflect the new behavior with regards to trailing whitespace characters. Bug: 717553 Change-Id: Ie0116fc6802ede203dd2adeb691789fa1e4719f3 Reviewed-on: https://chromium-review.googlesource.com/1147335 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@{#577658} [modify] https://crrev.com/8a2c888acc4d52b4d01f20ed2137ea35f08d6ba1/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.mm [modify] https://crrev.com/8a2c888acc4d52b4d01f20ed2137ea35f08d6ba1/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_unittest.mm
,
Aug 1
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3d248fc52fbaae7e7b37ed5f5b4dc545f31462a5 commit 3d248fc52fbaae7e7b37ed5f5b4dc545f31462a5 Author: Tessa Nijssen <tnijssen@google.com> Date: Wed Aug 01 17:38:08 2018 [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} [modify] https://crrev.com/3d248fc52fbaae7e7b37ed5f5b4dc545f31462a5/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.h [modify] https://crrev.com/3d248fc52fbaae7e7b37ed5f5b4dc545f31462a5/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.mm [modify] https://crrev.com/3d248fc52fbaae7e7b37ed5f5b4dc545f31462a5/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_browsertest.mm [modify] https://crrev.com/3d248fc52fbaae7e7b37ed5f5b4dc545f31462a5/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_unittest.mm
,
Aug 2
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9659ddbbb546c582f116a4c614db82e2de499d51 commit 9659ddbbb546c582f116a4c614db82e2de499d51 Author: Kinuko Yasuda <kinuko@chromium.org> Date: Thu Aug 02 03:56:38 2018 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} [modify] https://crrev.com/9659ddbbb546c582f116a4c614db82e2de499d51/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.h [modify] https://crrev.com/9659ddbbb546c582f116a4c614db82e2de499d51/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.mm [modify] https://crrev.com/9659ddbbb546c582f116a4c614db82e2de499d51/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_browsertest.mm [modify] https://crrev.com/9659ddbbb546c582f116a4c614db82e2de499d51/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_unittest.mm
,
Aug 3
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ca3673952c583172cf76d1937489c795d75dd5b7 commit ca3673952c583172cf76d1937489c795d75dd5b7 Author: Tessa Nijssen <tnijssen@google.com> Date: Fri Aug 03 21:38:43 2018 Reland [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. This CL is the same as http://crrev/c/1153728 with the following changes: - Browser tests for methods that are not restricted to MacOS 10.12.2+ were modified to also run on earlier versions of MacOS. The expected behavior for different MacOS versions is accounted for in the tests. - A call to UnfocusTextfield() was added to SetWebContentsTest to ensure that a later call to FocusTextfield() works as intended and focuses an editable element. Bug: 717553 Change-Id: Id061e392dd279e7a3cc9a34a023eb9bd97e52940 Reviewed-on: https://chromium-review.googlesource.com/1160929 Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Tessa Nijssen <tnijssen@google.com> Cr-Commit-Position: refs/heads/master@{#580658} [modify] https://crrev.com/ca3673952c583172cf76d1937489c795d75dd5b7/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.h [modify] https://crrev.com/ca3673952c583172cf76d1937489c795d75dd5b7/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller.mm [modify] https://crrev.com/ca3673952c583172cf76d1937489c795d75dd5b7/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_browsertest.mm [modify] https://crrev.com/ca3673952c583172cf76d1937489c795d75dd5b7/chrome/browser/ui/cocoa/touchbar/suggested_text_touch_bar_controller_unittest.mm
,
Aug 6
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e8805a4e7dfa1d4b5081f8b4d88d87088767d654 commit e8805a4e7dfa1d4b5081f8b4d88d87088767d654 Author: Tessa Nijssen <tnijssen@google.com> Date: Mon Aug 06 19:03:50 2018 Editor::ReplaceSelection() Sets Smart Replace to False Editor::ReplaceSelection() was modified so that |smart_replace| is false. No callers currently existed that used the version of ReplaceSelection() with |smart_replace| = true. Smart Replace may add whitespace before and/or after an inserted piece of text. The only current call to Editor::ReplaceSelection() needs |smart_replace| to be false because no extra whitespace is desired. A comment was added in editor.h to explain that Smart Replace is not used in Editor::ReplaceSelection(). A test was added, EditorTest.ReplaceSelection, which passes when |smart_replace| = false and fails when |smart_replace| = true. Bug: 717553 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng Change-Id: I1424e200780cd32900dac5b6f824f8d50c3f8dd5 Reviewed-on: https://chromium-review.googlesource.com/1150448 Commit-Queue: Tessa Nijssen <tnijssen@google.com> Reviewed-by: Peter Kasting <pkasting@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Sarah Chan <spqchan@chromium.org> Cr-Commit-Position: refs/heads/master@{#580940} [modify] https://crrev.com/e8805a4e7dfa1d4b5081f8b4d88d87088767d654/third_party/blink/renderer/core/editing/editor.cc [modify] https://crrev.com/e8805a4e7dfa1d4b5081f8b4d88d87088767d654/third_party/blink/renderer/core/editing/editor.h [modify] https://crrev.com/e8805a4e7dfa1d4b5081f8b4d88d87088767d654/third_party/blink/renderer/core/editing/editor_test.cc
,
Aug 6
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4db9799e71ca850457baf72bf0397c2525d4773b commit 4db9799e71ca850457baf72bf0397c2525d4773b Author: Tessa Nijssen <tnijssen@google.com> Date: Mon Aug 06 21:04:38 2018 [Mac] Rename SuggestedTextTouchBar => TextSuggestionsTouchBar The SuggestedTextTouchBarController was renamed to TextSuggestionsTouchBarController. Any instances of SuggestedTextTouchBarController were updated to the new name. The following were also changed: - File names were modified as follows: */{suggested_text => text_suggestions}_* - BUILD files were updated to reflect the new file names - Tests of the TouchBarController were renamed - Flags relating to the TouchBarController were renamed Bug: 717553 Change-Id: Ie2749ed0942362c7e89fd924441b4eac9397ce53 Reviewed-on: https://chromium-review.googlesource.com/1162895 Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Tessa Nijssen <tnijssen@google.com> Cr-Commit-Position: refs/heads/master@{#580985} [modify] https://crrev.com/4db9799e71ca850457baf72bf0397c2525d4773b/chrome/browser/about_flags.cc [modify] https://crrev.com/4db9799e71ca850457baf72bf0397c2525d4773b/chrome/browser/flag_descriptions.cc [modify] https://crrev.com/4db9799e71ca850457baf72bf0397c2525d4773b/chrome/browser/flag_descriptions.h [modify] https://crrev.com/4db9799e71ca850457baf72bf0397c2525d4773b/chrome/browser/ui/BUILD.gn [rename] https://crrev.com/4db9799e71ca850457baf72bf0397c2525d4773b/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.h [rename] https://crrev.com/4db9799e71ca850457baf72bf0397c2525d4773b/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm [rename] https://crrev.com/4db9799e71ca850457baf72bf0397c2525d4773b/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_browsertest.mm [rename] https://crrev.com/4db9799e71ca850457baf72bf0397c2525d4773b/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_unittest.mm [modify] https://crrev.com/4db9799e71ca850457baf72bf0397c2525d4773b/chrome/browser/ui/cocoa/touchbar/web_textfield_touch_bar_controller.h [modify] https://crrev.com/4db9799e71ca850457baf72bf0397c2525d4773b/chrome/browser/ui/cocoa/touchbar/web_textfield_touch_bar_controller.mm [modify] https://crrev.com/4db9799e71ca850457baf72bf0397c2525d4773b/chrome/common/chrome_features.cc [modify] https://crrev.com/4db9799e71ca850457baf72bf0397c2525d4773b/chrome/common/chrome_features.h [modify] https://crrev.com/4db9799e71ca850457baf72bf0397c2525d4773b/chrome/test/BUILD.gn [modify] https://crrev.com/4db9799e71ca850457baf72bf0397c2525d4773b/tools/metrics/histograms/enums.xml
,
Aug 8
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/bdaf1588f2b7235df87948abcdc398bcab88142e commit bdaf1588f2b7235df87948abcdc398bcab88142e Author: Tessa Nijssen <tnijssen@google.com> Date: Wed Aug 08 19:30:19 2018 [Mac] TextSuggestionsTouchBarController Ignore Replacement Selection When a user selects a suggestion, the editing word range is selected for replacement with the suggestion's text. Currently, that selection causes a call to WebContentsObserver::DidChangeTextSelection() which updates the TextSuggestionsTouchBarController's text selection to the editing word range. This change in text selection modifies the appearance of the touch bar which is undesired. The change in text selection for replacing the editing word should be ignored by the TextSuggestionsTouchBarController. A variable, |shouldIgnoreReplacementSelection_|, is set to YES when the TextSuggestionsTouchBarController modifies the current text selection to replace the editing word. When the that text selection update reaches TextSuggestionsTouchBarController, the selection will be ignored and |shouldIgnoreReplacementSelection_| will be reset to NO. This fixes the behavior where the touch bar appearance changes before showing suggestions post-replacement. A browser test was added, TextSuggestionsTouchBarControllerTest.IgnoreReplacementSelection, to test that a text selection is only ignored when necessary and that other selection updates are not ignored. Bug: 717553 Change-Id: Ib442d98b96e499acd73856399bcd89adf0f9c1d9 Reviewed-on: https://chromium-review.googlesource.com/1164167 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@{#581660} [modify] https://crrev.com/bdaf1588f2b7235df87948abcdc398bcab88142e/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.h [modify] https://crrev.com/bdaf1588f2b7235df87948abcdc398bcab88142e/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm [modify] https://crrev.com/bdaf1588f2b7235df87948abcdc398bcab88142e/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_browsertest.mm
,
Aug 8
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/57dc40388b745f3df6d521d50a34e4ae030839d3 commit 57dc40388b745f3df6d521d50a34e4ae030839d3 Author: Tessa Nijssen <tnijssen@google.com> Date: Wed Aug 08 20:54:38 2018 [Mac] Add Text Suggestions Touch Bar to Experimental UI Enabling the experimental UI flag, chrome://flags#upcoming-ui-features, will now enable the text suggestions touch bar. Bug: 717553 Change-Id: Ib78dc1298d548bd3548441667ab4f46e62f3b98a Reviewed-on: https://chromium-review.googlesource.com/1167800 Commit-Queue: Tessa Nijssen <tnijssen@google.com> Commit-Queue: Avi Drissman <avi@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Sarah Chan <spqchan@chromium.org> Cr-Commit-Position: refs/heads/master@{#581685} [modify] https://crrev.com/57dc40388b745f3df6d521d50a34e4ae030839d3/chrome/browser/ui/cocoa/touchbar/web_textfield_touch_bar_controller.mm
,
Aug 10
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1e3c17435eea13b5ba5d2794985655aa221091d1 commit 1e3c17435eea13b5ba5d2794985655aa221091d1 Author: Tessa Nijssen <tnijssen@google.com> Date: Fri Aug 10 16:48:43 2018 [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} [modify] https://crrev.com/1e3c17435eea13b5ba5d2794985655aa221091d1/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.h [modify] https://crrev.com/1e3c17435eea13b5ba5d2794985655aa221091d1/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm [modify] https://crrev.com/1e3c17435eea13b5ba5d2794985655aa221091d1/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_browsertest.mm [modify] https://crrev.com/1e3c17435eea13b5ba5d2794985655aa221091d1/content/browser/frame_host/render_widget_host_view_guest.cc [modify] https://crrev.com/1e3c17435eea13b5ba5d2794985655aa221091d1/content/browser/frame_host/render_widget_host_view_guest.h [modify] https://crrev.com/1e3c17435eea13b5ba5d2794985655aa221091d1/content/browser/renderer_host/render_widget_host_delegate.h [modify] https://crrev.com/1e3c17435eea13b5ba5d2794985655aa221091d1/content/browser/renderer_host/render_widget_host_view_base.cc [modify] https://crrev.com/1e3c17435eea13b5ba5d2794985655aa221091d1/content/browser/renderer_host/render_widget_host_view_base.h [modify] https://crrev.com/1e3c17435eea13b5ba5d2794985655aa221091d1/content/browser/renderer_host/render_widget_host_view_mac.mm [modify] https://crrev.com/1e3c17435eea13b5ba5d2794985655aa221091d1/content/browser/web_contents/web_contents_impl.cc [modify] https://crrev.com/1e3c17435eea13b5ba5d2794985655aa221091d1/content/browser/web_contents/web_contents_impl.h [modify] https://crrev.com/1e3c17435eea13b5ba5d2794985655aa221091d1/content/public/browser/render_widget_host_view.h [modify] https://crrev.com/1e3c17435eea13b5ba5d2794985655aa221091d1/content/public/browser/web_contents_observer.h
,
Aug 11
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c0a0f0be53c7c705076cac5dfc933dc85650e435 commit c0a0f0be53c7c705076cac5dfc933dc85650e435 Author: Peter Kasting <pkasting@chromium.org> Date: Sat Aug 11 02:05:40 2018 Revert "[Mac] Add Offset to TextSuggestionsTouchBarController Text Selection" This reverts commit 1e3c17435eea13b5ba5d2794985655aa221091d1. 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/1171704 Reviewed-by: Peter Kasting <pkasting@chromium.org> Commit-Queue: Peter Kasting <pkasting@chromium.org> Cr-Commit-Position: refs/heads/master@{#582423} [modify] https://crrev.com/c0a0f0be53c7c705076cac5dfc933dc85650e435/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.h [modify] https://crrev.com/c0a0f0be53c7c705076cac5dfc933dc85650e435/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm [modify] https://crrev.com/c0a0f0be53c7c705076cac5dfc933dc85650e435/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_browsertest.mm [modify] https://crrev.com/c0a0f0be53c7c705076cac5dfc933dc85650e435/content/browser/frame_host/render_widget_host_view_guest.cc [modify] https://crrev.com/c0a0f0be53c7c705076cac5dfc933dc85650e435/content/browser/frame_host/render_widget_host_view_guest.h [modify] https://crrev.com/c0a0f0be53c7c705076cac5dfc933dc85650e435/content/browser/renderer_host/render_widget_host_delegate.h [modify] https://crrev.com/c0a0f0be53c7c705076cac5dfc933dc85650e435/content/browser/renderer_host/render_widget_host_view_base.cc [modify] https://crrev.com/c0a0f0be53c7c705076cac5dfc933dc85650e435/content/browser/renderer_host/render_widget_host_view_base.h [modify] https://crrev.com/c0a0f0be53c7c705076cac5dfc933dc85650e435/content/browser/renderer_host/render_widget_host_view_mac.mm [modify] https://crrev.com/c0a0f0be53c7c705076cac5dfc933dc85650e435/content/browser/web_contents/web_contents_impl.cc [modify] https://crrev.com/c0a0f0be53c7c705076cac5dfc933dc85650e435/content/browser/web_contents/web_contents_impl.h [modify] https://crrev.com/c0a0f0be53c7c705076cac5dfc933dc85650e435/content/public/browser/render_widget_host_view.h [modify] https://crrev.com/c0a0f0be53c7c705076cac5dfc933dc85650e435/content/public/browser/web_contents_observer.h
,
Aug 13
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b4a66d53661192cf683d9f63b67fc3124f03b3be commit b4a66d53661192cf683d9f63b67fc3124f03b3be Author: Tessa Nijssen <tnijssen@google.com> Date: Mon Aug 13 22:40:39 2018 [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} [modify] https://crrev.com/b4a66d53661192cf683d9f63b67fc3124f03b3be/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.h [modify] https://crrev.com/b4a66d53661192cf683d9f63b67fc3124f03b3be/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm [modify] https://crrev.com/b4a66d53661192cf683d9f63b67fc3124f03b3be/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_browsertest.mm [modify] https://crrev.com/b4a66d53661192cf683d9f63b67fc3124f03b3be/content/browser/frame_host/render_widget_host_view_guest.cc [modify] https://crrev.com/b4a66d53661192cf683d9f63b67fc3124f03b3be/content/browser/frame_host/render_widget_host_view_guest.h [modify] https://crrev.com/b4a66d53661192cf683d9f63b67fc3124f03b3be/content/browser/renderer_host/render_widget_host_delegate.h [modify] https://crrev.com/b4a66d53661192cf683d9f63b67fc3124f03b3be/content/browser/renderer_host/render_widget_host_view_base.cc [modify] https://crrev.com/b4a66d53661192cf683d9f63b67fc3124f03b3be/content/browser/renderer_host/render_widget_host_view_base.h [modify] https://crrev.com/b4a66d53661192cf683d9f63b67fc3124f03b3be/content/browser/renderer_host/render_widget_host_view_mac.mm [modify] https://crrev.com/b4a66d53661192cf683d9f63b67fc3124f03b3be/content/browser/web_contents/web_contents_impl.cc [modify] https://crrev.com/b4a66d53661192cf683d9f63b67fc3124f03b3be/content/browser/web_contents/web_contents_impl.h [modify] https://crrev.com/b4a66d53661192cf683d9f63b67fc3124f03b3be/content/public/browser/render_widget_host_view.h [modify] https://crrev.com/b4a66d53661192cf683d9f63b67fc3124f03b3be/content/public/browser/web_contents_observer.h
,
Aug 14
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d5cb559a5882e481ed07a1e36b4de1a8a5786dc6 commit d5cb559a5882e481ed07a1e36b4de1a8a5786dc6 Author: Tessa Nijssen <tnijssen@google.com> Date: Tue Aug 14 17:50:19 2018 [Mac] Don't Display Text Suggestions Touch Bar without Suggestions If there are no suggestions, the touch bar will show an empty NSCandidateListTouchBarItem. Instead of showing that, the browser window touch bar should appear if there are no suggestions. TextSuggestionsTouchBarControllerTest.MakeTouchBar was modified to test that a text suggestions touch bar is not created if there are no suggestions. Bug: 717553 Change-Id: I2eb3286e5a96b97bb8d7737ddf6db352698804b8 Reviewed-on: https://chromium-review.googlesource.com/1173407 Reviewed-by: Sarah Chan <spqchan@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Tessa Nijssen <tnijssen@google.com> Cr-Commit-Position: refs/heads/master@{#582967} [modify] https://crrev.com/d5cb559a5882e481ed07a1e36b4de1a8a5786dc6/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm [modify] https://crrev.com/d5cb559a5882e481ed07a1e36b4de1a8a5786dc6/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_browsertest.mm
,
Aug 16
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/25ece65f0f4130b0d34236e8715ecff5beaa4a82 commit 25ece65f0f4130b0d34236e8715ecff5beaa4a82 Author: Tessa Nijssen <tnijssen@google.com> Date: Thu Aug 16 20:08:25 2018 [Mac] Reset Touch Bar Text Suggestions on Main Thread Previously, -requestSuggestions would asynchronously reset |suggestions_| on a thread separate from the main thread. This caused issues were -createCandidateListItem could try to read |suggestions_| while it was being reset, causing zombie dealloc crashes. Now, -requestSuggestions resets |suggestions_| on the main thread, so the previous crashes cannot happen. Bug: 717553 Change-Id: I016b054673fe8d2bb9bcb6c644c90b3c83eef311 Reviewed-on: https://chromium-review.googlesource.com/1175223 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@{#583786} [modify] https://crrev.com/25ece65f0f4130b0d34236e8715ecff5beaa4a82/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm
,
Aug 16
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8fd04b5fbba25e412874ff15c659c25fb9dcc12c commit 8fd04b5fbba25e412874ff15c659c25fb9dcc12c Author: Tessa Nijssen <tnijssen@google.com> Date: Thu Aug 16 21:12:00 2018 [Mac] Moved TextSuggestionsTouchBarController's Range Validity Check Previously, -updateTextSelection:range:offset: could receive an invalid range from WebContentsTextObserver::DidChangeTextSelection(). This invalid range would then cause a crash in -requestSuggestions. A check has been added to -updateTextSelection:range:offset: to make sure that a selection with an invalid range is not passed to -requestSuggestions. This should prevent future crashes. TextSuggestionsTouchBarControllerTest.InvalidRange tests that an invalid range does not crash the controller and is handled properly. Bug: 717553 Change-Id: I69f49cb1f1819e1d528837767dfb894d8652e84d Reviewed-on: https://chromium-review.googlesource.com/1178467 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@{#583815} [modify] https://crrev.com/8fd04b5fbba25e412874ff15c659c25fb9dcc12c/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm [modify] https://crrev.com/8fd04b5fbba25e412874ff15c659c25fb9dcc12c/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_browsertest.mm
,
Aug 16
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c11c823301228bc89ffa3fd73a3c58f147d82875 commit c11c823301228bc89ffa3fd73a3c58f147d82875 Author: Tessa Nijssen <tnijssen@google.com> Date: Thu Aug 16 23:43:43 2018 [Mac] Added Comments to TextSuggestionsTouchBarController Tests Some TextSuggestionsTouchBarController unit tests were missing comments. Comments were added where necessary. Bug: 717553 Change-Id: I5e41114a5618899bba61d4867d17634ab151fcfc Reviewed-on: https://chromium-review.googlesource.com/1178575 Reviewed-by: Sarah Chan <spqchan@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/master@{#583886} [modify] https://crrev.com/c11c823301228bc89ffa3fd73a3c58f147d82875/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm [modify] https://crrev.com/c11c823301228bc89ffa3fd73a3c58f147d82875/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_unittest.mm
,
Aug 17
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/af006e4fcb3f80d6881039306b7fcd429d2275fb commit af006e4fcb3f80d6881039306b7fcd429d2275fb Author: Kentaro Hara <haraken@chromium.org> Date: Fri Aug 17 03:50:51 2018 Revert "[Mac] Moved TextSuggestionsTouchBarController's Range Validity Check" This reverts commit 8fd04b5fbba25e412874ff15c659c25fb9dcc12c. Reason for revert: TextSuggestionsTouchBarControllerTest.InvalidRange started failing https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.11%20Tests/28606 Original change's description: > [Mac] Moved TextSuggestionsTouchBarController's Range Validity Check > > Previously, -updateTextSelection:range:offset: could receive an invalid > range from WebContentsTextObserver::DidChangeTextSelection(). This > invalid range would then cause a crash in -requestSuggestions. > > A check has been added to -updateTextSelection:range:offset: to make > sure that a selection with an invalid range is not passed to > -requestSuggestions. This should prevent future crashes. > > TextSuggestionsTouchBarControllerTest.InvalidRange tests that an > invalid range does not crash the controller and is handled > properly. > > Bug: 717553 > Change-Id: I69f49cb1f1819e1d528837767dfb894d8652e84d > Reviewed-on: https://chromium-review.googlesource.com/1178467 > 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@{#583815} TBR=avi@chromium.org,spqchan@chromium.org,tnijssen@google.com Change-Id: I7735c373052037bb377c1beac79d7b1132f3bc86 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 717553 Reviewed-on: https://chromium-review.googlesource.com/1179382 Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#583954} [modify] https://crrev.com/af006e4fcb3f80d6881039306b7fcd429d2275fb/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm [modify] https://crrev.com/af006e4fcb3f80d6881039306b7fcd429d2275fb/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_browsertest.mm
,
Aug 17
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f9b447aa9ab8a6b24877f653699d0fb0fcfa2c5a commit f9b447aa9ab8a6b24877f653699d0fb0fcfa2c5a Author: Tessa Nijssen <tnijssen@google.com> Date: Fri Aug 17 18:27:09 2018 [Mac] Moved TextSuggestionsTouchBarController's Range Validity Check This is a reland of http://crrev/c/1178467. TextSuggestionsTouchBarControllerTest.InvalidRange was modified so that it sets the controller's text and range before calling updateTextSelection:range:offset:. Previously, -updateTextSelection:range:offset: could receive an invalid range from WebContentsTextObserver::DidChangeTextSelection(). This invalid range would then cause a crash in -requestSuggestions. A check has been added to -updateTextSelection:range:offset: to make sure that a selection with an invalid range is not passed to -requestSuggestions. This should prevent future crashes. TextSuggestionsTouchBarControllerTest.InvalidRange tests that an invalid range does not crash the controller and is handled properly. Bug: 717553 Change-Id: I579cac326c3de86321286d4981c05e15f844021b Reviewed-on: https://chromium-review.googlesource.com/1180068 Reviewed-by: Sarah Chan <spqchan@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Tessa Nijssen <tnijssen@google.com> Cr-Commit-Position: refs/heads/master@{#584131} [modify] https://crrev.com/f9b447aa9ab8a6b24877f653699d0fb0fcfa2c5a/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm [modify] https://crrev.com/f9b447aa9ab8a6b24877f653699d0fb0fcfa2c5a/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_browsertest.mm
,
Aug 17
Back to you :)
,
Sep 12
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7a0622c6f1c0c0e277b9cbead35b7d80885cef43 commit 7a0622c6f1c0c0e277b9cbead35b7d80885cef43 Author: spqchan <spqchan@chromium.org> Date: Wed Sep 12 14:23:03 2018 [Mac] Text Suggestions Touch Bar Native Behavior Modify the text suggestions touch bar behavior so that it replicates MacOS. Instead of generating suggestions for and replacing an entire word, the touch bar will do it from the beginning of the word to the cursor. The touch bar will also not replace the trailing whitespace. Bug: 717553 Change-Id: Ied22203a6a9f321a8a17228f39471bb7ff3a847e Reviewed-on: https://chromium-review.googlesource.com/1212269 Commit-Queue: Sarah Chan <spqchan@chromium.org> Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org> Cr-Commit-Position: refs/heads/master@{#590669} [modify] https://crrev.com/7a0622c6f1c0c0e277b9cbead35b7d80885cef43/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm [modify] https://crrev.com/7a0622c6f1c0c0e277b9cbead35b7d80885cef43/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_browsertest.mm [modify] https://crrev.com/7a0622c6f1c0c0e277b9cbead35b7d80885cef43/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_unittest.mm
,
Sep 14
Merge request for CL in #36. Change is minor (most of it is updating a value in tests) and has been tested. It is also low risk
,
Sep 14
,
Sep 14
This bug requires manual review: Reverts referenced in bugdroid comments after merge request. Please contact the milestone owner if you have questions. Owners: benmason@(Android), kariahda@(iOS), geohsu@(ChromeOS), abdulsyed@(Desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Sep 14
approving merge for M70. branch:3538
,
Sep 18
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3889ba76e353645361383889684020567b2d8fff commit 3889ba76e353645361383889684020567b2d8fff Author: spqchan <spqchan@chromium.org> Date: Tue Sep 18 04:09:57 2018 [Mac] Text Suggestions Touch Bar Native Behavior Modify the text suggestions touch bar behavior so that it replicates MacOS. Instead of generating suggestions for and replacing an entire word, the touch bar will do it from the beginning of the word to the cursor. The touch bar will also not replace the trailing whitespace. (cherry picked from commit 7a0622c6f1c0c0e277b9cbead35b7d80885cef43) Bug: 717553 Change-Id: Ied22203a6a9f321a8a17228f39471bb7ff3a847e Reviewed-on: https://chromium-review.googlesource.com/1212269 Commit-Queue: Sarah Chan <spqchan@chromium.org> Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#590669} Reviewed-on: https://chromium-review.googlesource.com/1229701 Reviewed-by: Sarah Chan <spqchan@chromium.org> Cr-Commit-Position: refs/branch-heads/3538@{#471} Cr-Branched-From: 79f7c91a2b2a2932cd447fa6f865cb6662fa8fa6-refs/heads/master@{#587811} [modify] https://crrev.com/3889ba76e353645361383889684020567b2d8fff/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm [modify] https://crrev.com/3889ba76e353645361383889684020567b2d8fff/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_browsertest.mm [modify] https://crrev.com/3889ba76e353645361383889684020567b2d8fff/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_unittest.mm
,
Oct 1
,
Oct 1
I believe this is currently awaiting launch approval.
,
Oct 5
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ad7c191591846d2138feeaa27d29db322a4cd0fe commit ad7c191591846d2138feeaa27d29db322a4cd0fe Author: Sidney San Martín <sdy@chromium.org> Date: Fri Oct 05 23:44:11 2018 Fix bugs and improve perf in Touch Bar text suggestions. - The old implementation recreated the Touch Bar on each keystroke (including when hidden, I believe), which burns a significant amount of power while typing. This new implementation updates the existing candidate list, if it exists and isn't collapsed. - Removes a bunch of support code for a behavior that was disabled in r590669. It moves the remaining code into RWHV itself instead of a dedicated controller class, which I have mixed feelings about, but ultimately picked because after the support code was removed, most of what was left was plumbing between RWHV and TextSuggestionsTouchBarController. - [Bigish change] Moves text suggestions out of the window and into the RWHV, so that hiding and showing as focus and web contents change is left to AppKit and the responder chain. - Fixes small lifecyle-ish bugs around when use this kind of Touch Bar — now it's tied to the RWHV's input type instead of using a special WebContentsTextObserver. Bug: 717553, 881545 Change-Id: I8e1eff6da7918f92cfdb47465196d5841a88a7e4 Reviewed-on: https://chromium-review.googlesource.com/c/1212004 Commit-Queue: Sidney San Martín <sdy@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/master@{#597371} [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/base/mac/sdk_forward_declarations.h [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/chrome/browser/ui/BUILD.gn [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/chrome/browser/ui/cocoa/touchbar/browser_window_touch_bar_controller.mm [delete] https://crrev.com/e149b499781e45dad92c3a21818d6520185e52dc/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.h [delete] https://crrev.com/e149b499781e45dad92c3a21818d6520185e52dc/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm [delete] https://crrev.com/e149b499781e45dad92c3a21818d6520185e52dc/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_browsertest.mm [delete] https://crrev.com/e149b499781e45dad92c3a21818d6520185e52dc/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_unittest.mm [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/chrome/browser/ui/cocoa/touchbar/web_textfield_touch_bar_controller.h [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/chrome/browser/ui/cocoa/touchbar/web_textfield_touch_bar_controller.mm [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/chrome/browser/ui/passwords/password_generation_popup_controller_impl.cc [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/chrome/common/chrome_features.cc [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/chrome/common/chrome_features.h [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/chrome/test/BUILD.gn [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/content/browser/frame_host/render_widget_host_view_guest.cc [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/content/browser/frame_host/render_widget_host_view_guest.h [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/content/browser/renderer_host/render_widget_host_delegate.h [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/content/browser/renderer_host/render_widget_host_view_base.cc [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/content/browser/renderer_host/render_widget_host_view_base.h [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/content/browser/renderer_host/render_widget_host_view_cocoa.h [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/content/browser/renderer_host/render_widget_host_view_cocoa.mm [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/content/browser/renderer_host/render_widget_host_view_mac.mm [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/content/browser/web_contents/web_contents_impl.cc [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/content/browser/web_contents/web_contents_impl.h [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/content/public/browser/render_widget_host_view.h [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/content/public/browser/web_contents_observer.h [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/content/public/common/content_features.cc [modify] https://crrev.com/ad7c191591846d2138feeaa27d29db322a4cd0fe/content/public/common/content_features.h
,
Oct 8
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6068cf6b0b7348f09085a3256588f831653b4a52 commit 6068cf6b0b7348f09085a3256588f831653b4a52 Author: Avi Drissman <avi@chromium.org> Date: Mon Oct 08 19:52:36 2018 Revert "Fix bugs and improve perf in Touch Bar text suggestions." This reverts commit ad7c191591846d2138feeaa27d29db322a4cd0fe. Reason for revert: Causes crashes (893038, 893222). Original change's description: > Fix bugs and improve perf in Touch Bar text suggestions. > > - The old implementation recreated the Touch Bar on each keystroke (including > when hidden, I believe), which burns a significant amount of power while > typing. This new implementation updates the existing candidate list, if it > exists and isn't collapsed. > > - Removes a bunch of support code for a behavior that was disabled in r590669. > It moves the remaining code into RWHV itself instead of a dedicated > controller class, which I have mixed feelings about, but ultimately picked > because after the support code was removed, most of what was left was > plumbing between RWHV and TextSuggestionsTouchBarController. > > - [Bigish change] Moves text suggestions out of the window and into the RWHV, > so that hiding and showing as focus and web contents change is left to AppKit > and the responder chain. > > - Fixes small lifecyle-ish bugs around when use this kind of Touch Bar — now > it's tied to the RWHV's input type instead of using a special > WebContentsTextObserver. > > Bug: 717553, 881545 > Change-Id: I8e1eff6da7918f92cfdb47465196d5841a88a7e4 > Reviewed-on: https://chromium-review.googlesource.com/c/1212004 > Commit-Queue: Sidney San Martín <sdy@chromium.org> > Reviewed-by: Avi Drissman <avi@chromium.org> > Cr-Commit-Position: refs/heads/master@{#597371} TBR=avi@chromium.org,sdy@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 717553, 881545 , 893222, 893038 Change-Id: Ia35f365b4cd46b98a7ffe0181fbf656fc4f9e672 Reviewed-on: https://chromium-review.googlesource.com/c/1269077 Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/master@{#597652} [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/base/mac/sdk_forward_declarations.h [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/chrome/browser/ui/BUILD.gn [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/chrome/browser/ui/cocoa/touchbar/browser_window_touch_bar_controller.mm [add] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.h [add] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm [add] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_browsertest.mm [add] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_unittest.mm [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/chrome/browser/ui/cocoa/touchbar/web_textfield_touch_bar_controller.h [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/chrome/browser/ui/cocoa/touchbar/web_textfield_touch_bar_controller.mm [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/chrome/browser/ui/passwords/password_generation_popup_controller_impl.cc [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/chrome/common/chrome_features.cc [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/chrome/common/chrome_features.h [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/chrome/test/BUILD.gn [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/content/browser/frame_host/render_widget_host_view_guest.cc [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/content/browser/frame_host/render_widget_host_view_guest.h [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/content/browser/renderer_host/render_widget_host_delegate.h [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/content/browser/renderer_host/render_widget_host_view_base.cc [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/content/browser/renderer_host/render_widget_host_view_base.h [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/content/browser/renderer_host/render_widget_host_view_cocoa.h [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/content/browser/renderer_host/render_widget_host_view_cocoa.mm [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/content/browser/renderer_host/render_widget_host_view_mac.mm [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/content/browser/web_contents/web_contents_impl.cc [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/content/browser/web_contents/web_contents_impl.h [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/content/public/browser/render_widget_host_view.h [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/content/public/browser/web_contents_observer.h [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/content/public/common/content_features.cc [modify] https://crrev.com/6068cf6b0b7348f09085a3256588f831653b4a52/content/public/common/content_features.h
,
Oct 30
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/28b39c180ef84b7d7763eabae317e35555dfd1b8 commit 28b39c180ef84b7d7763eabae317e35555dfd1b8 Author: Sidney San Martín <sdy@chromium.org> Date: Tue Oct 30 02:17:39 2018 Reland set of Touch Bar text suggestions perf improvements and bug fixes. This change is similar to the original (below) with the following additions: - Skip requesting suggestions (and clear the candidate list) if the selection range is invalid. This caused crashes in the field: https://crbug.com/893038. - Skip requesting suggestions if the candidate list is collapsed. - Request suggestions immediately when the candidate list is shown. This relands commit d7c191591846d2138feeaa27d29db322a4cd0fe. Original change's description: > Fix bugs and improve perf in Touch Bar text suggestions. > > - The old implementation recreated the Touch Bar on each keystroke (including > when hidden, I believe), which burns a significant amount of power while > typing. This new implementation updates the existing candidate list, if it > exists and isn't collapsed. > > - Removes a bunch of support code for a behavior that was disabled in r590669. > It moves the remaining code into RWHV itself instead of a dedicated > controller class, which I have mixed feelings about, but ultimately picked > because after the support code was removed, most of what was left was > plumbing between RWHV and TextSuggestionsTouchBarController. > > - [Bigish change] Moves text suggestions out of the window and into the RWHV, > so that hiding and showing as focus and web contents change is left to AppKit > and the responder chain. > > - Fixes small lifecyle-ish bugs around when use this kind of Touch Bar — now > it's tied to the RWHV's input type instead of using a special > WebContentsTextObserver. > > Bug: 717553, 881545 > Change-Id: I8e1eff6da7918f92cfdb47465196d5841a88a7e4 > Reviewed-on: https://chromium-review.googlesource.com/c/1212004 > Commit-Queue: Sidney San Martín <sdy@chromium.org> > Reviewed-by: Avi Drissman <avi@chromium.org> > Cr-Commit-Position: refs/heads/master@{#597371} Bug: 717553, 881545 , 893222, 893038 Change-Id: I2f8405f9784514462c2bfe8a754d3ca174f47d27 Reviewed-on: https://chromium-review.googlesource.com/c/1299664 Commit-Queue: Sidney San Martín <sdy@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/master@{#603741} [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/base/mac/sdk_forward_declarations.h [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/chrome/browser/ui/BUILD.gn [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/chrome/browser/ui/cocoa/touchbar/browser_window_touch_bar_controller.mm [delete] https://crrev.com/d0570c8fff4e53006b424afa7def1befdb0a55fe/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.h [delete] https://crrev.com/d0570c8fff4e53006b424afa7def1befdb0a55fe/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm [delete] https://crrev.com/d0570c8fff4e53006b424afa7def1befdb0a55fe/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_browsertest.mm [delete] https://crrev.com/d0570c8fff4e53006b424afa7def1befdb0a55fe/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_unittest.mm [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/chrome/browser/ui/cocoa/touchbar/web_textfield_touch_bar_controller.h [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/chrome/browser/ui/cocoa/touchbar/web_textfield_touch_bar_controller.mm [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/chrome/browser/ui/passwords/password_generation_popup_controller_impl.cc [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/chrome/common/chrome_features.cc [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/chrome/common/chrome_features.h [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/chrome/test/BUILD.gn [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/content/browser/frame_host/render_widget_host_view_guest.cc [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/content/browser/frame_host/render_widget_host_view_guest.h [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/content/browser/renderer_host/render_widget_host_delegate.h [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/content/browser/renderer_host/render_widget_host_view_base.cc [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/content/browser/renderer_host/render_widget_host_view_base.h [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/content/browser/renderer_host/render_widget_host_view_cocoa.h [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/content/browser/renderer_host/render_widget_host_view_cocoa.mm [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/content/browser/renderer_host/render_widget_host_view_mac.mm [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/content/browser/web_contents/web_contents_impl.cc [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/content/browser/web_contents/web_contents_impl.h [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/content/public/browser/render_widget_host_view.h [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/content/public/browser/web_contents_observer.h [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/content/public/common/content_features.cc [modify] https://crrev.com/28b39c180ef84b7d7763eabae317e35555dfd1b8/content/public/common/content_features.h
,
Oct 30
I've been testing this out (I think 😅), enabling it through the flag. But it's unfortunately not working for Google docs 😬 and some other places which I can try to list if needed too. I suppose thid problem has to do with these fields being special ... ? Anyways, it'd be awesome if the suggestions could work there too 😁
,
Nov 23
*** UI Mass triage *** adding labels for expert review. Tried Canary #72.0.3618.0 on MacBook Pro (touchbar) and enabled the Touch Bar typing suggestions" option in System Preference > Keyboard > Text navigated to google.com - and tried to enter some text - showing suggestions / emoji |
|||||||||||||
►
Sign in to add a comment |
|||||||||||||
Comment 1 by meh...@chromium.org
, May 2 2017Components: UI>Browser>Touchbar