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

Issue 12090006: Omnibox: Create Keyword Verbatim Result in Search Provider (Closed)

Created:
7 years, 11 months ago by Mark P
Modified:
7 years, 10 months ago
CC:
chromium-reviews, James Su
Visibility:
Public.

Description

Omnibox: Create Keyword Verbatim Result in Search Provider It's a little weird that SearchProvider creates the default provider's search-what-you-typed (a.k.a. verbatim) match, the default provider's suggestion matches, and the keyword provider's suggestions, but not the keyword provider's search-what-you-typed match. This change adds code to create the keyword-search-what-you-typed suggestion (for keywords that aren't extensions) to SearchProvider. It also modifies the code in KeywordProvider to prevent creating the keyword-search-what-you-typed suggestions in these cases. This is the natural step to fix the linked bug. It also preps the path to get suggested relevance scores for keyword providers. It should have nearly no user-visible effect. The reason for the nearly no and not a "no" is because now that the SearchProvider is generating the keyword verbatim result, we allow the SearchProvider to return an additional result to the AutocompleteController. (The keyword provider would always return this result, so we leave an extra slot in SearchProvider's result set for this result.) However, it's vaguely conceivable if we have suggest relevance scoring and have more than four very-highly-scoring suggestions that those suggestions could starve out the keyword verbatim result. Frankly, I'm not worried about this. Note that there is a logging change: the verbatim result for the keyword provider's search was previously marked as Keyword provider, SEARCH_OTHER_ENGINE result type. Now it will be marked as Search provider, SEARCH_OTHER_ENGINE result type. As for how I created CalculateRelevanceForKeywordVerbatim(), it's a direct copy of KeywordProvider::CalculateRelevance() with certain tests removed for things that are guaranteed to be true/false in SearchProvider if we're using the keyword fetcher. I decided not to make this code in common because there's no reason the Keyword scoring algorithm should be the same as the SearchProvider's scoring algorithm. i.e., if one later alters one of these functions, no harm will come as a result of the fact that the code isn't shared. BUG=171104 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=181181

Patch Set 1 #

Patch Set 2 : corrected tests. #

Patch Set 3 : fix last failing test #

Patch Set 4 : cleanup extension keyword handling #

Patch Set 5 : more extension cleanup #

Total comments: 37

Patch Set 6 : Bart's comments plus more tests. #

Total comments: 6

Patch Set 7 : Bart's final comments. #

Total comments: 33

Patch Set 8 : Mike's comments. #

Patch Set 9 : Mike's comments, plus more tests he requested. #

Patch Set 10 : Better extension tests for SearchProvider. #

Total comments: 18

Patch Set 11 : Mike's comments. #

Total comments: 10

Patch Set 12 : Mike's comments. #

Total comments: 4

Patch Set 13 : Mike's final comments. #

Patch Set 14 : Update comment. #

Total comments: 10

Patch Set 15 : parens #

Patch Set 16 : revise comments #

Patch Set 17 : rebased #

Patch Set 18 : roperly resolved (variable rename) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+301 lines, -56 lines) Patch
M chrome/browser/autocomplete/autocomplete_provider_unittest.cc View 1 2 3 4 5 6 1 chunk +9 lines, -4 lines 0 comments Download
M chrome/browser/autocomplete/keyword_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +21 lines, -2 lines 0 comments Download
M chrome/browser/autocomplete/keyword_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +29 lines, -17 lines 0 comments Download
M chrome/browser/autocomplete/search_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +13 lines, -9 lines 0 comments Download
M chrome/browser/autocomplete/search_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +49 lines, -9 lines 0 comments Download
M chrome/browser/autocomplete/search_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +159 lines, -10 lines 0 comments Download
M chrome/browser/extensions/api/omnibox/omnibox_apitest.cc View 1 2 3 4 5 6 7 8 9 4 chunks +21 lines, -5 lines 0 comments Download

Messages

Total messages: 34 (0 generated)
Mark P
Hi Bart, Can you give this a painstakingly detailed review before I ask anyone else ...
7 years, 10 months ago (2013-01-28 18:07:25 UTC) #1
Bart N.
On 2013/01/28 18:07:25, Mark P wrote: > Hi Bart, > > Can you give this ...
7 years, 10 months ago (2013-01-28 23:33:28 UTC) #2
Bart N.
Mark, I've gone with this change carefully and I believe it should work as you ...
7 years, 10 months ago (2013-01-29 18:50:42 UTC) #3
Bart N.
https://codereview.chromium.org/12090006/diff/10002/chrome/browser/autocomplete/keyword_provider_unittest.cc File chrome/browser/autocomplete/keyword_provider_unittest.cc (right): https://codereview.chromium.org/12090006/diff/10002/chrome/browser/autocomplete/keyword_provider_unittest.cc#newcode165 chrome/browser/autocomplete/keyword_provider_unittest.cc:165: // Exact keyword matches with remaining text should return ...
7 years, 10 months ago (2013-01-29 21:48:35 UTC) #4
Mark P
Thanks for the detailed review. I think I've answered all your questions. Please take another ...
7 years, 10 months ago (2013-01-30 19:46:21 UTC) #5
Bart N.
LGTM Mark, this is looking very clean to me now. Please see a few minor ...
7 years, 10 months ago (2013-01-30 21:36:21 UTC) #6
Mark P
Thanks for the review. Now to add more reviewers. https://codereview.chromium.org/12090006/diff/11003/chrome/browser/autocomplete/autocomplete_provider_unittest.cc File chrome/browser/autocomplete/autocomplete_provider_unittest.cc (right): https://codereview.chromium.org/12090006/diff/11003/chrome/browser/autocomplete/autocomplete_provider_unittest.cc#newcode400 chrome/browser/autocomplete/autocomplete_provider_unittest.cc:400: ...
7 years, 10 months ago (2013-01-30 22:19:45 UTC) #7
Mark P
Hi Mike, Can you please look at this? I'd like the most eyes on it ...
7 years, 10 months ago (2013-01-30 22:28:52 UTC) #8
msw
https://codereview.chromium.org/12090006/diff/13003/chrome/browser/autocomplete/keyword_provider.cc File chrome/browser/autocomplete/keyword_provider.cc (right): https://codereview.chromium.org/12090006/diff/13003/chrome/browser/autocomplete/keyword_provider.cc#newcode290 chrome/browser/autocomplete/keyword_provider.cc:290: profile_ && template_url->IsExtensionKeyword(); Is |profile_| actually required for extension ...
7 years, 10 months ago (2013-01-31 00:38:16 UTC) #9
Mark P
Mike, Aside from the requested additional tests, I replied to your comments. Some require clarification. ...
7 years, 10 months ago (2013-01-31 23:09:27 UTC) #10
msw
I hope I caught everything, looking forward to tests! https://codereview.chromium.org/12090006/diff/13003/chrome/browser/autocomplete/keyword_provider.cc File chrome/browser/autocomplete/keyword_provider.cc (right): https://codereview.chromium.org/12090006/diff/13003/chrome/browser/autocomplete/keyword_provider.cc#newcode290 chrome/browser/autocomplete/keyword_provider.cc:290: ...
7 years, 10 months ago (2013-02-01 20:52:37 UTC) #11
Mark P
I added the tests you wanted (or at least a framework for them). If you ...
7 years, 10 months ago (2013-02-02 00:24:35 UTC) #12
msw
Tests are looking good, thanks! https://codereview.chromium.org/12090006/diff/13003/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/12090006/diff/13003/chrome/browser/autocomplete/search_provider.cc#newcode887 chrome/browser/autocomplete/search_provider.cc:887: matches_.front().type != AutocompleteMatch::SEARCH_OTHER_ENGINE && ...
7 years, 10 months ago (2013-02-02 02:27:52 UTC) #13
Mark P
Hi Mike, Here's all the cleanup you wanted. --mark https://codereview.chromium.org/12090006/diff/13003/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/12090006/diff/13003/chrome/browser/autocomplete/search_provider.cc#newcode887 chrome/browser/autocomplete/search_provider.cc:887: ...
7 years, 10 months ago (2013-02-04 19:46:09 UTC) #14
msw
Looking mostly good; please try URLPrefix::BestURLPrefix. https://codereview.chromium.org/12090006/diff/13003/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/12090006/diff/13003/chrome/browser/autocomplete/search_provider.cc#newcode887 chrome/browser/autocomplete/search_provider.cc:887: matches_.front().type != AutocompleteMatch::SEARCH_OTHER_ENGINE ...
7 years, 10 months ago (2013-02-04 22:51:39 UTC) #15
Mark P
Mike, Here ya go. --mark https://codereview.chromium.org/12090006/diff/13003/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/12090006/diff/13003/chrome/browser/autocomplete/search_provider.cc#newcode887 chrome/browser/autocomplete/search_provider.cc:887: matches_.front().type != AutocompleteMatch::SEARCH_OTHER_ENGINE && ...
7 years, 10 months ago (2013-02-05 00:54:36 UTC) #16
msw
https://codereview.chromium.org/12090006/diff/43001/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/12090006/diff/43001/chrome/browser/autocomplete/search_provider.cc#newcode902 chrome/browser/autocomplete/search_provider.cc:902: #ifdef DEBUG Shoot, I thought you were going to ...
7 years, 10 months ago (2013-02-05 01:35:19 UTC) #17
Mark P
Now I think it's time to get Peter's eyes on this. https://codereview.chromium.org/12090006/diff/43001/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): ...
7 years, 10 months ago (2013-02-05 19:50:54 UTC) #18
Mark P
Peter, Bart and Mike have given this change an extensive review (as you can see ...
7 years, 10 months ago (2013-02-05 20:00:03 UTC) #19
Peter Kasting
LGTM https://codereview.chromium.org/12090006/diff/51002/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/12090006/diff/51002/chrome/browser/autocomplete/search_provider.cc#newcode1118 chrome/browser/autocomplete/search_provider.cc:1118: // Perhaps this should be kept similar to ...
7 years, 10 months ago (2013-02-05 23:17:48 UTC) #20
Mark P
Peter, Thanks for the fast review! --mark https://codereview.chromium.org/12090006/diff/51002/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/12090006/diff/51002/chrome/browser/autocomplete/search_provider.cc#newcode1118 chrome/browser/autocomplete/search_provider.cc:1118: // Perhaps ...
7 years, 10 months ago (2013-02-06 01:31:59 UTC) #21
Mark P
mpcomplete@, As the OWNER of chrome/browser/extensions/api/omnibox/omnibox_apitest.cc can you please review and approve the changes to ...
7 years, 10 months ago (2013-02-06 01:35:05 UTC) #22
Matt Perry
lgtm
7 years, 10 months ago (2013-02-06 01:42:26 UTC) #23
Peter Kasting
https://codereview.chromium.org/12090006/diff/51002/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/12090006/diff/51002/chrome/browser/autocomplete/search_provider.cc#newcode1118 chrome/browser/autocomplete/search_provider.cc:1118: // Perhaps this should be kept similar to On ...
7 years, 10 months ago (2013-02-06 02:01:41 UTC) #24
Mark P
https://codereview.chromium.org/12090006/diff/51002/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/12090006/diff/51002/chrome/browser/autocomplete/search_provider.cc#newcode1118 chrome/browser/autocomplete/search_provider.cc:1118: // Perhaps this should be kept similar to On ...
7 years, 10 months ago (2013-02-06 04:31:13 UTC) #25
Peter Kasting
https://codereview.chromium.org/12090006/diff/51002/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/12090006/diff/51002/chrome/browser/autocomplete/search_provider.cc#newcode1118 chrome/browser/autocomplete/search_provider.cc:1118: // Perhaps this should be kept similar to Honestly, ...
7 years, 10 months ago (2013-02-06 18:47:34 UTC) #26
Mark P
https://codereview.chromium.org/12090006/diff/51002/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/12090006/diff/51002/chrome/browser/autocomplete/search_provider.cc#newcode1118 chrome/browser/autocomplete/search_provider.cc:1118: // Perhaps this should be kept similar to On ...
7 years, 10 months ago (2013-02-06 18:54:11 UTC) #27
Peter Kasting
https://codereview.chromium.org/12090006/diff/51002/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/12090006/diff/51002/chrome/browser/autocomplete/search_provider.cc#newcode1118 chrome/browser/autocomplete/search_provider.cc:1118: // Perhaps this should be kept similar to On ...
7 years, 10 months ago (2013-02-06 19:00:08 UTC) #28
Mark P
I'm glad we got a comment we're all happy with. I'll try submitting this later ...
7 years, 10 months ago (2013-02-06 19:50:22 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mpearson@chromium.org/12090006/46002
7 years, 10 months ago (2013-02-06 22:44:09 UTC) #30
commit-bot: I haz the power
Failed to trigger a try job on android_clang_dbg HTTP Error 400: Bad Request
7 years, 10 months ago (2013-02-06 23:02:38 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mpearson@chromium.org/12090006/51012
7 years, 10 months ago (2013-02-06 23:11:22 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mpearson@chromium.org/12090006/57003
7 years, 10 months ago (2013-02-07 00:17:03 UTC) #33
commit-bot: I haz the power
7 years, 10 months ago (2013-02-07 03:58:49 UTC) #34
Message was sent while issue was closed.
Change committed as 181181

Powered by Google App Engine
This is Rietveld 408576698