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

Issue 7314018: Don't autocomplete searches of >1 word if they've only been visited once and the user has not yet... (Closed)

Created:
9 years, 5 months ago by Peter Kasting
Modified:
9 years, 5 months ago
Reviewers:
sky
CC:
chromium-reviews, brettw-cc_chromium.org
Visibility:
Public.

Description

Don't autocomplete searches of >1 word if they've only been visited once and the user has not yet typed more than one word. Subtleties: * To avoid "crowding out" issues where penalized multiword searches prevent us finding better earlier searches, this gets kMaxMatches * 5 history matches per search provider before trimming to the final list. * To avoid penalized searches preventing completion of prior searches, or sudden changes of autocompletion when going from one to two words typed, this changes the relevance uniquifying algorithm to first do a stable_sort(). One consequence of this is that we'll now be willing to modify the order of results from history, so e.g. we'll now complete "go" -> "goog" even with a newer history result "google.com" (penalized, looks like URL). This change also adds AutocompleteResult::kLowestDefaultScore since a lot of files want to do something different for "possibly default" matches versus "guaranteed not to be default". It also refactors search_provider_unittest.cc so I can add a lot of tests without so much boilerplate code. BUG=79487 TEST=Search for "ghi jkl". Now type that again and notice that it doesn't autocomplete until after "j". Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=92778

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+414 lines, -249 lines) Patch
M chrome/browser/autocomplete/autocomplete.h View 1 2 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/autocomplete/history_quick_provider.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/autocomplete/history_quick_provider.cc View 1 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/autocomplete/history_quick_provider_unittest.cc View 1 1 chunk +26 lines, -20 lines 0 comments Download
M chrome/browser/autocomplete/search_provider.h View 1 3 chunks +17 lines, -5 lines 0 comments Download
M chrome/browser/autocomplete/search_provider.cc View 1 7 chunks +132 lines, -54 lines 0 comments Download
M chrome/browser/autocomplete/search_provider_unittest.cc View 1 17 chunks +210 lines, -145 lines 0 comments Download
M chrome/browser/autocomplete/shortcuts_provider.cc View 1 1 chunk +5 lines, -4 lines 1 comment Download
M chrome/browser/history/history_types.h View 1 2 chunks +6 lines, -13 lines 0 comments Download
M chrome/browser/history/url_database.cc View 1 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Peter Kasting
9 years, 5 months ago (2011-07-07 01:23:47 UTC) #1
sky
One down side of this approach is that if you type in a bunch of ...
9 years, 5 months ago (2011-07-07 02:49:15 UTC) #2
Peter Kasting
On 2011/07/07 02:49:15, sky wrote: > One down side of this approach is that if ...
9 years, 5 months ago (2011-07-12 20:42:03 UTC) #3
sky
On Tue, Jul 12, 2011 at 1:42 PM, <pkasting@chromium.org> wrote: > On 2011/07/07 02:49:15, sky ...
9 years, 5 months ago (2011-07-12 20:52:25 UTC) #4
Peter Kasting
On 2011/07/12 20:52:25, sky wrote: > Seems like if you have less than one word ...
9 years, 5 months ago (2011-07-12 20:56:54 UTC) #5
Peter Kasting
Take another look.
9 years, 5 months ago (2011-07-15 22:42:41 UTC) #6
sky
9 years, 5 months ago (2011-07-15 23:01:33 UTC) #7
LGTM

http://codereview.chromium.org/7314018/diff/9001/chrome/browser/autocomplete/...
File chrome/browser/autocomplete/shortcuts_provider.cc (right):

http://codereview.chromium.org/7314018/diff/9001/chrome/browser/autocomplete/...
chrome/browser/autocomplete/shortcuts_provider.cc:79:
(AutocompleteResult::kLowestDefaultScore - 1) & ~3;
Wow, that's obscure (the & ~3)

Powered by Google App Engine
This is Rietveld 408576698