[TTS] Access the Context and Selection using common WebView code |
|||
Issue descriptionWe have duplication of code that accesses surrounding text and expands the selection between Smart Select and Contextual Search. Since Smart Select needs to be supported in WebView it makes sense for Contextual Search to switch to using the Smart Select mechanisms. Related to issue 756241.
,
Oct 2 2017
> I am considering ... will that affect this issue? This issue is a long-term refactoring task so don't worry about your changes impacting it!
,
Oct 12 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/708197db129edcea4501ba1d62bdc16f8e4bb660 commit 708197db129edcea4501ba1d62bdc16f8e4bb660 Author: Donn Denman <donnd@google.com> Date: Thu Oct 12 21:28:57 2017 [TTS] Fix a race with Smart Selection. Introduces a fix for issue 773330 where gathering surrounding text on the page is requested multiple times but only a single call is supported. Disables the gathering of surrounding text for longpress when Smart Selection is active. Instead we send just the current selection to icing for the assistant to use. Also fix a logic error in whether surrounding text can be sent to icing or not. BUG= 773330 , 770502 Change-Id: I752271efecb27d931d3fc25d46a4d66ad9649875 Reviewed-on: https://chromium-review.googlesource.com/714378 Reviewed-by: Ted Choc <tedchoc@chromium.org> Reviewed-by: Theresa <twellington@chromium.org> Commit-Queue: Donn Denman <donnd@chromium.org> Cr-Commit-Position: refs/heads/master@{#508480} [modify] https://crrev.com/708197db129edcea4501ba1d62bdc16f8e4bb660/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchContext.java [modify] https://crrev.com/708197db129edcea4501ba1d62bdc16f8e4bb660/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java [modify] https://crrev.com/708197db129edcea4501ba1d62bdc16f8e4bb660/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchPolicy.java [modify] https://crrev.com/708197db129edcea4501ba1d62bdc16f8e4bb660/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java [modify] https://crrev.com/708197db129edcea4501ba1d62bdc16f8e4bb660/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java
,
Oct 12 2017
I'm thinking that if we used Mojo for communication from Blink to the embedder we wouldn't have the race condition that required the workaround done in #3 whose impact is "the Google Assistant might be affected in a minor way -- instead of getting about 400 chars of context from the page it will just get the selection, along with the regular data. The regular data includes page title and URL -- the URL should allow attachment of entities similar to what was done with the full surrounding text."
,
Oct 12 2017
Pedro, what do you think about using Mojo for communication from Blink to the embedder so we wouldn't have the race condition?
,
Oct 12 2017
The plan is for Smart Selection to not use the surrounding text IPC. Eventually the surrounding text will be passed as a parameter to showSelectionMenu() which will remove the need to do a round trip to Blink (see crbug.com/774296). This should fix the race condition since only Contextual Search will be using the request surrounding text IPC. |
|||
►
Sign in to add a comment |
|||
Comment 1 by ctzsm@chromium.org
, Oct 1 2017