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

Issue 11414303: Make Google Search autocomplete provider cursor aware. (Closed)

Created:
8 years ago by Bart N.
Modified:
8 years ago
CC:
chromium-reviews, dbeam+watch-options_chromium.org, Aaron Boodman, James Su, chromium-apps-reviews_chromium.org, H Fung
Visibility:
Public.

Description

Make Google Search autocomplete provider cursor aware. Specifically: (1) Introduce a new AutocompleteInput field, cursor_position. (2) Change AutocompleteController::Start() interface to take const AutocompleteInput& input (3) Introduce a new Google specific replacement, {google:cursorPosition} and update the corresponding search provider template (4) Refactor all existing callers of AC::Start() to take AI param instead BUG=29999 TEST=AutocompleteInputTest.InputTypeWithCursorPosition,TemplateURLTest.ReplaceCursorPosition Also tested a local chrome build by sending various queries, e.g. "it|pasta recipes" (| indicates cursor position). Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=173131

Patch Set 1 #

Patch Set 2 : #

Total comments: 27

Patch Set 3 : Addressed comments. #

Total comments: 14

Patch Set 4 : Addressed last round of comments. #

Patch Set 5 : Added missing comment to AutocompleteInput's ctor. #

Patch Set 6 : Addressed comments (DCHECKs). #

Patch Set 7 : Added a workaround around one corner case. #

Patch Set 8 : #

Patch Set 9 : #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+327 lines, -159 lines) Patch
M chrome/browser/autocomplete/autocomplete_browsertest.cc View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_classifier.cc View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_controller.h View 1 chunk +3 lines, -26 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_controller.cc View 2 chunks +7 lines, -13 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_input.h View 1 2 3 4 4 chunks +38 lines, -4 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_input.cc View 1 2 3 4 5 4 chunks +41 lines, -12 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_input_unittest.cc View 1 2 3 4 5 4 chunks +43 lines, -8 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_provider_unittest.cc View 1 2 2 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_result_unittest.cc View 4 chunks +8 lines, -8 lines 0 comments Download
M chrome/browser/autocomplete/bookmark_provider_unittest.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/autocomplete/builtin_provider_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/autocomplete/contact_provider_chromeos_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -4 lines 0 comments Download
M chrome/browser/autocomplete/extension_app_provider_unittest.cc View 3 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/autocomplete/history_contents_provider_unittest.cc View 7 chunks +23 lines, -18 lines 0 comments Download
M chrome/browser/autocomplete/history_provider.cc View 1 2 1 chunk +7 lines, -1 line 0 comments Download
M chrome/browser/autocomplete/history_quick_provider_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
chrome/browser/autocomplete/history_url_provider_unittest.cc View 5 chunks +11 lines, -9 lines 0 comments Download
M chrome/browser/autocomplete/keyword_provider_unittest.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/autocomplete/search_provider.cc View 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/autocomplete/search_provider_unittest.cc View 1 2 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/autocomplete/shortcuts_provider_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/omnibox/omnibox_apitest.cc View 1 2 3 4 5 6 7 5 chunks +14 lines, -10 lines 0 comments Download
M chrome/browser/search_engines/prepopulated_engines.json View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/search_engines/template_url.h View 1 2 3 2 chunks +6 lines, -0 lines 2 comments Download
M chrome/browser/search_engines/template_url.cc View 1 2 3 4 5 5 chunks +13 lines, -2 lines 0 comments Download
M chrome/browser/search_engines/template_url_unittest.cc View 1 2 3 4 5 1 chunk +36 lines, -0 lines 0 comments Download
M chrome/browser/ui/app_list/search_builder.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/omnibox/omnibox_edit_model.cc View 1 2 3 4 5 6 7 1 chunk +22 lines, -3 lines 2 comments Download
M chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc View 1 chunk +8 lines, -6 lines 0 comments Download
M chrome/browser/ui/webui/options/home_page_overlay_handler.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/options/startup_pages_handler.cc View 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 56 (0 generated)
Bart N.
This is ready for review. Please, don't get set back by the big number of ...
8 years ago (2012-12-04 01:33:03 UTC) #1
Bart N.
Mark - I forgot to mention - I'm planning to update omnibox debug console to ...
8 years ago (2012-12-04 01:37:52 UTC) #2
Peter Kasting
I'm not going to get to this until Wednesday.
8 years ago (2012-12-04 03:33:26 UTC) #3
Bart N.
On 2012/12/04 03:33:26, Peter Kasting wrote: > I'm not going to get to this until ...
8 years ago (2012-12-04 17:55:26 UTC) #4
Peter Kasting
https://codereview.chromium.org/11414303/diff/13002/chrome/browser/autocomplete/autocomplete_browsertest.cc File chrome/browser/autocomplete/autocomplete_browsertest.cc (right): https://codereview.chromium.org/11414303/diff/13002/chrome/browser/autocomplete/autocomplete_browsertest.cc#newcode124 chrome/browser/autocomplete/autocomplete_browsertest.cc:124: AutocompleteInput(ASCIIToUTF16("chrome"), string16::npos, string16(), Nit: You can save a line ...
8 years ago (2012-12-05 20:49:38 UTC) #5
Bart N.
Done all, PTAL. https://codereview.chromium.org/11414303/diff/13002/chrome/browser/autocomplete/autocomplete_browsertest.cc File chrome/browser/autocomplete/autocomplete_browsertest.cc (right): https://codereview.chromium.org/11414303/diff/13002/chrome/browser/autocomplete/autocomplete_browsertest.cc#newcode124 chrome/browser/autocomplete/autocomplete_browsertest.cc:124: AutocompleteInput(ASCIIToUTF16("chrome"), string16::npos, string16(), On 2012/12/05 20:49:38, ...
8 years ago (2012-12-06 21:43:32 UTC) #6
Peter Kasting
https://codereview.chromium.org/11414303/diff/13002/chrome/browser/ui/omnibox/omnibox_edit_model.h File chrome/browser/ui/omnibox/omnibox_edit_model.h (right): https://codereview.chromium.org/11414303/diff/13002/chrome/browser/ui/omnibox/omnibox_edit_model.h#newcode423 chrome/browser/ui/omnibox/omnibox_edit_model.h:423: size_t cursor_position_; On 2012/12/06 21:43:32, Bart N. wrote: > ...
8 years ago (2012-12-06 22:16:35 UTC) #7
Bart N.
On 2012/12/06 22:16:35, Peter Kasting wrote: > https://codereview.chromium.org/11414303/diff/13002/chrome/browser/ui/omnibox/omnibox_edit_model.h > File chrome/browser/ui/omnibox/omnibox_edit_model.h (right): > > https://codereview.chromium.org/11414303/diff/13002/chrome/browser/ui/omnibox/omnibox_edit_model.h#newcode423 ...
8 years ago (2012-12-06 22:24:26 UTC) #8
Peter Kasting
On 2012/12/06 22:24:26, Bart N. wrote: > > On 2012/12/06 21:43:32, Bart N. wrote: > ...
8 years ago (2012-12-06 22:26:23 UTC) #9
Bart N.
On 2012/12/06 22:26:23, Peter Kasting wrote: > On 2012/12/06 22:24:26, Bart N. wrote: > > ...
8 years ago (2012-12-06 22:39:40 UTC) #10
Peter Kasting
On 2012/12/06 22:39:40, Bart N. wrote: > Now as you pointed this out - I ...
8 years ago (2012-12-06 22:52:25 UTC) #11
Bart N.
On 2012/12/06 22:52:25, Peter Kasting wrote: > On 2012/12/06 22:39:40, Bart N. wrote: > > ...
8 years ago (2012-12-06 23:10:31 UTC) #12
Peter Kasting
On 2012/12/06 23:10:31, Bart N. wrote: > Ah, that would explain it. However, I'm testing ...
8 years ago (2012-12-07 00:03:29 UTC) #13
Bart N.
I finally got around looking at this more closely and the problem is no existent ...
8 years ago (2012-12-07 17:49:22 UTC) #14
Bart N.
On 2012/12/07 17:49:22, Bart N. wrote: > I finally got around looking at this more ...
8 years ago (2012-12-11 17:50:59 UTC) #15
Peter Kasting
LGTM https://codereview.chromium.org/11414303/diff/22001/chrome/browser/autocomplete/autocomplete_input.cc File chrome/browser/autocomplete/autocomplete_input.cc (right): https://codereview.chromium.org/11414303/diff/22001/chrome/browser/autocomplete/autocomplete_input.cc#newcode21 chrome/browser/autocomplete/autocomplete_input.cc:21: if (num_leading_chars_removed == 0 || *cursor_position == string16::npos) ...
8 years ago (2012-12-11 19:27:01 UTC) #16
Mark P
lgtm This is an exciting change! Thank you for doing it. https://codereview.chromium.org/11414303/diff/22001/chrome/browser/autocomplete/autocomplete_input.h File chrome/browser/autocomplete/autocomplete_input.h (right): ...
8 years ago (2012-12-11 21:23:20 UTC) #17
Bart N.
Thanks for the review. I've merged and resolved a few conflicts (including the data version ...
8 years ago (2012-12-11 21:47:47 UTC) #18
Bart N.
Ooopps. I haven't noticed Mark's comments before I replied to Peter's feedback. Replying in a ...
8 years ago (2012-12-11 21:54:02 UTC) #19
Bart N.
On 2012/12/11 21:23:20, Mark P wrote: > lgtm > > This is an exciting change! ...
8 years ago (2012-12-11 22:03:05 UTC) #20
Bart N.
https://codereview.chromium.org/11414303/diff/22001/chrome/browser/autocomplete/autocomplete_input.h File chrome/browser/autocomplete/autocomplete_input.h (right): https://codereview.chromium.org/11414303/diff/22001/chrome/browser/autocomplete/autocomplete_input.h#newcode54 chrome/browser/autocomplete/autocomplete_input.h:54: // On 2012/12/11 21:23:20, Mark P wrote: > Please ...
8 years ago (2012-12-11 22:03:16 UTC) #21
Peter Kasting
https://codereview.chromium.org/11414303/diff/22001/chrome/browser/autocomplete/autocomplete_input.cc File chrome/browser/autocomplete/autocomplete_input.cc (right): https://codereview.chromium.org/11414303/diff/22001/chrome/browser/autocomplete/autocomplete_input.cc#newcode54 chrome/browser/autocomplete/autocomplete_input.cc:54: if (cursor_position != string16::npos && cursor_position >= text.length()) { ...
8 years ago (2012-12-11 22:15:50 UTC) #22
Bart N.
https://codereview.chromium.org/11414303/diff/22001/chrome/browser/autocomplete/autocomplete_input.cc File chrome/browser/autocomplete/autocomplete_input.cc (right): https://codereview.chromium.org/11414303/diff/22001/chrome/browser/autocomplete/autocomplete_input.cc#newcode54 chrome/browser/autocomplete/autocomplete_input.cc:54: if (cursor_position != string16::npos && cursor_position >= text.length()) { ...
8 years ago (2012-12-11 22:34:15 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartn@chromium.org/11414303/43001
8 years ago (2012-12-11 23:33:33 UTC) #24
commit-bot: I haz the power
Presubmit check for 11414303-43001 failed and returned exit status 1. Running presubmit commit checks ...
8 years ago (2012-12-11 23:33:45 UTC) #25
Bart N.
Matt, can you stamp api/omnibox change, please?
8 years ago (2012-12-11 23:59:07 UTC) #26
Matt Perry
chrome/browser/extensions/api/omnibox/omnibox_apitest.cc LGTM
8 years ago (2012-12-12 00:06:21 UTC) #27
Peter Kasting
https://codereview.chromium.org/11414303/diff/22001/chrome/browser/autocomplete/autocomplete_input.cc File chrome/browser/autocomplete/autocomplete_input.cc (right): https://codereview.chromium.org/11414303/diff/22001/chrome/browser/autocomplete/autocomplete_input.cc#newcode54 chrome/browser/autocomplete/autocomplete_input.cc:54: if (cursor_position != string16::npos && cursor_position >= text.length()) { ...
8 years ago (2012-12-12 00:24:11 UTC) #28
Bart N.
I'll ping back this thread when I make the changes you asked for. https://codereview.chromium.org/11414303/diff/22001/chrome/browser/autocomplete/autocomplete_input.cc File ...
8 years ago (2012-12-12 02:16:35 UTC) #29
Peter Kasting
On 2012/12/12 02:16:35, Bart N. wrote: > Are Canary/Dev/Beta channel binaries built with DCHECK on? ...
8 years ago (2012-12-12 02:37:38 UTC) #30
Bart N.
On 2012/12/12 02:37:38, Peter Kasting wrote: > On 2012/12/12 02:16:35, Bart N. wrote: > > ...
8 years ago (2012-12-12 02:41:01 UTC) #31
Peter Kasting
Almost all our testing happens in release mode. We get plenty of testing there :)
8 years ago (2012-12-12 02:43:11 UTC) #32
Bart N.
I've added the DCHECKs.
8 years ago (2012-12-12 17:35:02 UTC) #33
Bart N.
On 2012/12/12 17:35:02, Bart N. wrote: > I've added the DCHECKs. Quick update. After adding ...
8 years ago (2012-12-12 21:03:28 UTC) #34
Bart N.
On 2012/12/12 21:03:28, Bart N. wrote: > On 2012/12/12 17:35:02, Bart N. wrote: > > ...
8 years ago (2012-12-12 21:10:25 UTC) #35
Mark P
On Wed, Dec 12, 2012 at 1:03 PM, <bartn@chromium.org> wrote: > Quick update. After adding ...
8 years ago (2012-12-12 21:17:23 UTC) #36
Bart N.
> (b) For inlineable suggestions, GetSelectionBound returns selection for the > completed text. This is ...
8 years ago (2012-12-12 21:18:36 UTC) #37
Bart N.
On 2012/12/12 21:17:23, Mark P wrote: > On Wed, Dec 12, 2012 at 1:03 PM, ...
8 years ago (2012-12-12 21:21:37 UTC) #38
Bart N.
On 2012/12/12 21:18:36, Bart N. wrote: > > (b) For inlineable suggestions, GetSelectionBound returns selection ...
8 years ago (2012-12-12 21:25:48 UTC) #39
Bart N.
Status Update: The invariant put in DCHECK is not true in case where user has ...
8 years ago (2012-12-13 00:53:04 UTC) #40
Bart N.
> We haven't decided yet what would be the best fix and are considering a ...
8 years ago (2012-12-13 18:25:32 UTC) #41
Bart N.
On 2012/12/13 18:25:32, Bart N. wrote: > > We haven't decided yet what would be ...
8 years ago (2012-12-13 18:26:20 UTC) #42
Mark P
As I said earlier today, please feel free to land this whenever. LGTM
8 years ago (2012-12-14 01:25:34 UTC) #43
Bart N.
On 2012/12/14 01:25:34, Mark P wrote: > As I said earlier today, please feel free ...
8 years ago (2012-12-14 02:29:34 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartn@chromium.org/11414303/57005
8 years ago (2012-12-14 02:31:01 UTC) #45
Bart N.
On 2012/12/14 02:31:01, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
8 years ago (2012-12-14 03:10:25 UTC) #46
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
8 years ago (2012-12-14 03:24:46 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartn@chromium.org/11414303/66006
8 years ago (2012-12-14 03:25:55 UTC) #48
commit-bot: I haz the power
Change committed as 173131
8 years ago (2012-12-14 09:57:18 UTC) #49
Peter Kasting
You said "when editing selection is always empty". But what if I actually select something? ...
8 years ago (2012-12-18 03:01:01 UTC) #50
Bart N.
On 2012/12/18 03:01:01, Peter Kasting wrote: > You said "when editing selection is always empty". ...
8 years ago (2012-12-18 23:44:08 UTC) #51
Bart N.
The fixes are in https://codereview.chromium.org/11636005. https://chromiumcodereview.appspot.com/11414303/diff/66006/chrome/browser/search_engines/template_url.h File chrome/browser/search_engines/template_url.h (right): https://chromiumcodereview.appspot.com/11414303/diff/66006/chrome/browser/search_engines/template_url.h#newcode76 chrome/browser/search_engines/template_url.h:76: // last character. On ...
8 years ago (2012-12-18 23:47:39 UTC) #52
Peter Kasting
On 2012/12/18 23:44:08, Bart N. wrote: > Moving cursor and changing selection does not run ...
8 years ago (2012-12-18 23:50:18 UTC) #53
Bart N.
On 2012/12/18 23:50:18, Peter Kasting wrote: > On 2012/12/18 23:44:08, Bart N. wrote: > > ...
8 years ago (2012-12-19 00:02:51 UTC) #54
Peter Kasting
On 2012/12/19 00:02:51, Bart N. wrote: > I omitted the highlighted inline case since I ...
8 years ago (2012-12-19 00:05:31 UTC) #55
Bart N.
8 years ago (2012-12-19 00:20:36 UTC) #56
Message was sent while issue was closed.
On 2012/12/19 00:05:31, Peter Kasting wrote:
> On 2012/12/19 00:02:51, Bart N. wrote:
> > I omitted the highlighted inline case since I worked around it already in
this
> > CL (and opened 2 bugs). I was discussing other corner cases which might
> possibly
> > affect the behavior.
> 
> OK.  I'm just still confused how you'd actually still see an inline
> autocompletion at the time you called Start().
You can see it if you hit "Ctrl", because it is not cleared in
OmniboxEditModel::OnControlKeyChanged.
> 
> > > However, you can run with an arbitrary selection as follows:
> > > * Don't have Instant Extended on.
> > > * Ensure the dropdown is closed.
> > Is it possible to close it once it's open? I'm having trouble executing this
> > step :)
> 
> Hit escape, or switch tabs and switch back, or just don't type anything
Hitting escape removes all text from Omnibox for me :( anyway, this is not
really important - I trust you.
> different in the omnibox to begin with (you can just select some of the
> permanent text).

Powered by Google App Engine
This is Rietveld 408576698