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

Issue 1411543011: Omnibox: Make Keyword Provide More Generous with Matching (Closed)

Created:
5 years, 1 month ago by Mark P
Modified:
5 years, 1 month ago
Reviewers:
Peter Kasting
CC:
chromium-reviews, extensions-reviews_chromium.org, droger+watchlist_chromium.org, blundell+watchlist_chromium.org, sdefresne+watchlist_chromium.org, chromium-apps-reviews_chromium.org, James Su
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Omnibox: Make Keyword Provide More Generous with Matching Adds fields to TemplateURLService to keep a map from keyword's domain to a TemplateURL so that users don't have to type the beginning of the keyword in order to match the keyword. Also adds a notion of "effective keyword length" that allows us to decide that it's okay if the user doesn't type the full keyword but instead types the important part of it. e.g., this allows ignoring .com in keywords. Adds an omnibox field trial that controls both of these behaviors. The field trial also has a parameter to control the score of "nearly complete" matches. BUG=488901 Committed: https://crrev.com/6456fb606e045e77b4efa9e8058dcd86209d992a Cr-Commit-Position: refs/heads/master@{#359505}

Patch Set 1 #

Patch Set 2 : minor cleanup #

Total comments: 1

Patch Set 3 : == -> >= #

Total comments: 82

Patch Set 4 : fix several bugs #

Patch Set 5 : almost all of peter's comments #

Total comments: 27

Patch Set 6 : all peter's comments (except one), including previously-promised refactoring, and additional unit t… #

Total comments: 20

Patch Set 7 : peter's latest batch of comments #

Total comments: 2

Patch Set 8 : peter's comments #

Total comments: 4

Patch Set 9 : auto #

Patch Set 10 : refactoring insert vs [] #

Patch Set 11 : parens #

Patch Set 12 : finish converting AddToMap() calls #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+617 lines, -210 lines) Patch
M chrome/browser/autocomplete/keyword_extensions_delegate_impl.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/omnibox/browser/keyword_provider.h View 1 2 3 4 2 chunks +6 lines, -4 lines 0 comments Download
M components/omnibox/browser/keyword_provider.cc View 1 2 3 4 5 9 chunks +59 lines, -34 lines 0 comments Download
M components/omnibox/browser/keyword_provider_unittest.cc View 1 2 3 4 5 6 13 chunks +151 lines, -5 lines 0 comments Download
M components/omnibox/browser/omnibox_field_trial.h View 1 2 3 4 5 2 chunks +25 lines, -0 lines 0 comments Download
M components/omnibox/browser/omnibox_field_trial.cc View 1 2 3 4 2 chunks +35 lines, -0 lines 0 comments Download
M components/omnibox/browser/search_provider.h View 1 2 3 4 5 2 chunks +9 lines, -6 lines 0 comments Download
M components/omnibox/browser/search_provider.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +73 lines, -75 lines 0 comments Download
M components/search_engines/DEPS View 1 chunk +2 lines, -0 lines 0 comments Download
M components/search_engines/template_url_service.h View 1 2 3 4 5 6 7 8 9 6 chunks +88 lines, -13 lines 0 comments Download
M components/search_engines/template_url_service.cc View 1 2 3 4 5 6 7 8 9 10 11 15 chunks +167 lines, -71 lines 2 comments Download

Messages

Total messages: 29 (7 generated)
Mark P
Hi Peter, I think this is code-complete. I haven't yet tested it. Nonetheless, I think ...
5 years, 1 month ago (2015-11-06 23:30:34 UTC) #3
Mark P
For the record, I have tested this code interactively. It works correctly (after I fixed ...
5 years, 1 month ago (2015-11-09 20:25:09 UTC) #4
Peter Kasting
The actual functionality here is relatively simple, so almost all my comments are more about ...
5 years, 1 month ago (2015-11-09 23:11:16 UTC) #5
Mark P
On Mon, Nov 9, 2015 at 3:11 PM, <pkasting@chromium.org> wrote: > > > https://codereview.chromium.org/1411543011/diff/40001/components/search_engines/template_url_service.cc#newcode178 > ...
5 years, 1 month ago (2015-11-10 21:49:49 UTC) #6
Peter Kasting
On Tue, Nov 10, 2015 at 1:49 PM, Mark Pearson <mpearson@chromium.org> wrote: > On Mon, ...
5 years, 1 month ago (2015-11-10 22:18:37 UTC) #7
Mark P
I did everything you suggested except I didn't manage to comment the AddTo/RemoveFrom DomainMap() header ...
5 years, 1 month ago (2015-11-11 07:41:01 UTC) #8
Mark P
Here are fixes for the last two comments you had for me. I'm adding unit ...
5 years, 1 month ago (2015-11-12 20:13:03 UTC) #9
Peter Kasting
You didn't actually upload your new fixes, but that's fine, I'll look when you upload ...
5 years, 1 month ago (2015-11-12 20:36:11 UTC) #10
Mark P
Here's an actual upload that includes - the previously-promised Remove/Add map comments and refactoring - ...
5 years, 1 month ago (2015-11-12 21:42:49 UTC) #11
Peter Kasting
You missed a couple comments I made on your older patch sets; replied t them ...
5 years, 1 month ago (2015-11-12 22:32:11 UTC) #12
Mark P
Here ya go. Sorry I missed those comments from earlier patchsets. I'm usually better about ...
5 years, 1 month ago (2015-11-12 23:18:42 UTC) #13
Peter Kasting
https://codereview.chromium.org/1411543011/diff/100001/components/search_engines/template_url_service.cc File components/search_engines/template_url_service.cc (right): https://codereview.chromium.org/1411543011/diff/100001/components/search_engines/template_url_service.cc#newcode182 components/search_engines/template_url_service.cc:182: keyword.length() - (registry_length ? (registry_length + 1) : 0), ...
5 years, 1 month ago (2015-11-12 23:37:51 UTC) #14
Mark P
https://codereview.chromium.org/1411543011/diff/100001/components/search_engines/template_url_service.cc File components/search_engines/template_url_service.cc (right): https://codereview.chromium.org/1411543011/diff/100001/components/search_engines/template_url_service.cc#newcode182 components/search_engines/template_url_service.cc:182: keyword.length() - (registry_length ? (registry_length + 1) : 0), ...
5 years, 1 month ago (2015-11-12 23:49:34 UTC) #15
Peter Kasting
LGTM https://codereview.chromium.org/1411543011/diff/140001/components/search_engines/template_url_service.cc File components/search_engines/template_url_service.cc (right): https://codereview.chromium.org/1411543011/diff/140001/components/search_engines/template_url_service.cc#newcode1519 components/search_engines/template_url_service.cc:1519: const auto match_range( I just realized "auto" might ...
5 years, 1 month ago (2015-11-13 00:00:41 UTC) #16
Mark P
Thanks for the speedy reviews. --mark https://codereview.chromium.org/1411543011/diff/140001/components/search_engines/template_url_service.cc File components/search_engines/template_url_service.cc (right): https://codereview.chromium.org/1411543011/diff/140001/components/search_engines/template_url_service.cc#newcode1519 components/search_engines/template_url_service.cc:1519: const auto match_range( ...
5 years, 1 month ago (2015-11-13 00:11:15 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1411543011/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1411543011/160001
5 years, 1 month ago (2015-11-13 00:12:20 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/128493)
5 years, 1 month ago (2015-11-13 00:46:17 UTC) #22
Mark P
https://codereview.chromium.org/1411543011/diff/220001/components/search_engines/template_url_service.cc File components/search_engines/template_url_service.cc (right): https://codereview.chromium.org/1411543011/diff/220001/components/search_engines/template_url_service.cc#newcode1541 components/search_engines/template_url_service.cc:1541: void TemplateURLService::AddToMap(TemplateURL* template_url) { FYI, I had to revise ...
5 years, 1 month ago (2015-11-13 06:06:49 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1411543011/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1411543011/220001
5 years, 1 month ago (2015-11-13 06:07:07 UTC) #26
commit-bot: I haz the power
Committed patchset #12 (id:220001)
5 years, 1 month ago (2015-11-13 06:44:35 UTC) #27
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/6456fb606e045e77b4efa9e8058dcd86209d992a Cr-Commit-Position: refs/heads/master@{#359505}
5 years, 1 month ago (2015-11-13 06:45:25 UTC) #28
Mark P
5 years, 1 month ago (2015-11-13 16:33:14 UTC) #29
Message was sent while issue was closed.
https://codereview.chromium.org/1411543011/diff/220001/components/search_engi...
File components/search_engines/template_url_service.cc (right):

https://codereview.chromium.org/1411543011/diff/220001/components/search_engi...
components/search_engines/template_url_service.cc:1541: void
TemplateURLService::AddToMap(TemplateURL* template_url) {
On 2015/11/13 06:06:49, Mark P wrote:
> FYI, I had to revise this function.  To see my changes, compare this patchset
> with 8 or 9 (the last patchset you reviewed).
> 
> Earlier, part of my earlier refactoring to make it shared between the regular
> map and the domain map, I made it do .insert() on the map.  This doesn't work
on
> the regular map because I wanted the replace behavior and .insert() doesn't do
> anything if the key already exists.  Hence, I changed this function to only be
> used with the regular map and did the [] insert, and changed AddToDomainMap to
> do the .insert() method.  It's too bad there isn't a common function that
means
> insert (if not existing, or if applied to a multimap) or replace (if existing
> when applied to a non-multimap).

For the record, I realized I could do something messy such
value = TemplateURLAndMeaningfulLength(...)
map->insert(std::make_pair(key, value)).second = value
but that seems unnecessarily messy, and the current approach (one helper for
each map) seems pretty clean to me.

Powered by Google App Engine
This is Rietveld 408576698