Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Issue 2703473002: [TTS] Extract tapped text before showing UI. (Closed)

Created:
3 years, 10 months ago by Donn Denman
Modified:
3 years, 7 months ago
Reviewers:
Ted C, Theresa
CC:
chromium-reviews, twellington+watch_chromium.org, donnd+watch_chromium.org, agrieve+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[TTS] Extract tapped text before showing UI. Reworks Tap gesture recognition and processing to use a new Internal State Controller. This controller drives the ContextualSearchManager through its sequence of state transitions. Now the manager is just a library of operations, and the overall flow of control is handled exclusively by the new state controller. Now text is extracted before showing any UI. This is needed so we can apply ML to decide when to show the UI. The Java Context now tracks a small section of content of the Context around the Selection. Context now has a hack to figure out how the content changed when a word is selected with SelectWordAroundCaret. This should be fixed soon by adding an ACK to SelectWordAroundCaret. Stopped using the GestureStateListener#onSingleTap override so we should be able to remove that method from the interface in a future CL. The SelectionController no longer needs to have a delay for a possible invalid tap because there's a state that waits for a possible tap nearby a previous tap. BUG=692824 Review-Url: https://codereview.chromium.org/2703473002 Cr-Commit-Position: refs/heads/master@{#467522} Committed: https://chromium.googlesource.com/chromium/src/+/e78147e28cc531df52ba73e0efe49d0401d28f6b

Patch Set 1 #

Patch Set 2 : Added a Java context. Builds but has issues with disposing of the context. #

Patch Set 3 : Works by matching the selection in the icing text. Does not expand the selection correctly. #

Patch Set 4 : Added State management. #

Patch Set 5 : Minor update. #

Total comments: 16

Patch Set 6 : Renamed classes and addressed Theresa's initial quick-review. #

Patch Set 7 : Enhanced dependency injection for CSM, for archiving. #

Patch Set 8 : Removed the refactoring for dependency injection of CSM for better testing (see CL 2786313005 for a… #

Patch Set 9 : Merged invalid-tap-delay into the state controller. #

Total comments: 13

Patch Set 10 : Addressed Theresa's comments by making an anonymous instance implement the state controller interfa… #

Patch Set 11 : Fixed invalid-tap handling, made more robust, updated initially failing tests. #

Patch Set 12 : Minor fixes to Retap, empty-surrounding-text issue. #

Patch Set 13 : Reworked icing notification, lots of cleanup, and a rebase. #

Total comments: 59

Patch Set 14 : Updated comments in response to Theresa's review today. #

Patch Set 15 : Added some tests, fixed some tests, added DCHECKS to native context, rebased. #

Total comments: 10

Patch Set 16 : Moved handleHideContextualSearch into hideContextualSearchUI, and updated comments in response to T… #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1375 lines, -391 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchContext.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +172 lines, -24 lines 0 comments Download
A chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateController.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +327 lines, -0 lines 0 comments Download
A chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateHandler.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +63 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 42 chunks +317 lines, -202 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionController.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 15 chunks +49 lines, -104 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionHandler.java View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +10 lines, -0 lines 0 comments Download
M chrome/android/java_sources.gni View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +4 lines, -0 lines 0 comments Download
A chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateControllerWrapper.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +77 lines, -0 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +68 lines, -5 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTapEventTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 10 chunks +64 lines, -20 lines 0 comments Download
A chrome/android/junit/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +190 lines, -0 lines 0 comments Download
M chrome/browser/android/contextualsearch/contextual_search_context.h View 1 2 3 4 chunks +7 lines, -7 lines 0 comments Download
M chrome/browser/android/contextualsearch/contextual_search_context.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +13 lines, -10 lines 0 comments Download
M chrome/browser/android/contextualsearch/contextual_search_delegate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +9 lines, -13 lines 0 comments Download
M chrome/browser/android/contextualsearch/contextual_search_delegate_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +4 lines, -5 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 40 (21 generated)
Donn Denman
Theresa, please take a quick look sometime soon. This isn't ready for a real review ...
3 years, 9 months ago (2017-03-24 05:42:07 UTC) #2
Theresa
https://codereview.chromium.org/2703473002/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java File chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java (right): https://codereview.chromium.org/2703473002/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java#newcode72 chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java:72: ContextualSearchStateControlled, SelectionClient { There are a lot of interfaces ...
3 years, 8 months ago (2017-03-28 15:52:55 UTC) #3
Donn Denman
Renamed several classes based on your great feedback: State --> InternalState CSStateController --> CSInternalStateController CSStateControlled ...
3 years, 8 months ago (2017-03-29 18:56:52 UTC) #4
Donn Denman
Theresa, this is ready for quick-look #2 sometime next week. Thanks!
3 years, 8 months ago (2017-03-31 23:16:52 UTC) #7
chromium-reviews
Theresa, the most recent patch that I uploaded might not be very functional, so don't ...
3 years, 8 months ago (2017-04-01 18:50:55 UTC) #8
Theresa
https://codereview.chromium.org/2703473002/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateController.java File chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateController.java (right): https://codereview.chromium.org/2703473002/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateController.java#newcode117 chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateController.java:117: // does not yet have an ACK so we ...
3 years, 8 months ago (2017-04-05 20:58:30 UTC) #9
Donn Denman
Theresa, your comments about new public methods in the manager raised an important issue and ...
3 years, 8 months ago (2017-04-14 02:22:11 UTC) #11
Donn Denman
Theresa, this is ready for an in-depth review with a few caveats: 1) The ContextualSearchTapEventTest.java ...
3 years, 8 months ago (2017-04-21 17:53:24 UTC) #16
Theresa
https://codereview.chromium.org/2703473002/diff/240001/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java File chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java (right): https://codereview.chromium.org/2703473002/diff/240001/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java#newcode554 chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java:554: requestUpdate(); Is this fixing a pre-existing bug? https://codereview.chromium.org/2703473002/diff/240001/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchContext.java File ...
3 years, 8 months ago (2017-04-25 17:30:42 UTC) #18
Donn Denman
Thanks so much for the review Theresa! I'll bet it was one of the more ...
3 years, 8 months ago (2017-04-25 22:35:38 UTC) #19
Donn Denman
Theresa, PTAL. Here's some notes about today's changes (below). https://codereview.chromium.org/2703473002/diff/280001/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateHandler.java File chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateHandler.java (right): https://codereview.chromium.org/2703473002/diff/280001/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateHandler.java#newcode16 chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateHandler.java:16: ...
3 years, 8 months ago (2017-04-26 03:43:55 UTC) #20
Donn Denman
Theresa, PTAL. Thanks so much!
3 years, 8 months ago (2017-04-26 13:33:19 UTC) #25
Theresa
https://codereview.chromium.org/2703473002/diff/240001/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchContext.java File chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchContext.java (right): https://codereview.chromium.org/2703473002/diff/240001/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchContext.java#newcode165 chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchContext.java:165: * TODO(donnd): This method of finding the adjustment to ...
3 years, 7 months ago (2017-04-26 18:01:15 UTC) #26
Donn Denman
Theresa, PTAL. Thanks for the review! https://codereview.chromium.org/2703473002/diff/240001/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchContext.java File chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchContext.java (right): https://codereview.chromium.org/2703473002/diff/240001/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchContext.java#newcode165 chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchContext.java:165: * TODO(donnd): This ...
3 years, 7 months ago (2017-04-26 20:28:17 UTC) #27
Theresa
lgtm
3 years, 7 months ago (2017-04-26 20:35:44 UTC) #30
Donn Denman
Ted, PTAL at ChromeActivity. Thanks everyone!
3 years, 7 months ago (2017-04-26 20:38:26 UTC) #32
Ted C
On 2017/04/26 20:38:26, Donn Denman wrote: > Ted, PTAL at ChromeActivity. > > Thanks everyone! ...
3 years, 7 months ago (2017-04-26 23:54:22 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2703473002/300001
3 years, 7 months ago (2017-04-26 23:56:49 UTC) #37
commit-bot: I haz the power
3 years, 7 months ago (2017-04-27 00:05:45 UTC) #40
Message was sent while issue was closed.
Committed patchset #16 (id:300001) as
https://chromium.googlesource.com/chromium/src/+/e78147e28cc531df52ba73e0efe4...

Powered by Google App Engine
This is Rietveld 408576698