diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-19 18:42:36 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-19 18:42:36 +0000 |
commit | 52d08b12e8e7ff7c9b865837a2aeb17fb9dc2d42 (patch) | |
tree | daa03a7be2ffe72d304d7498b7b438ddb4469ae3 /chrome/browser/autocomplete/search_provider.h | |
parent | c6d5cdb28856a33676e3bf40e213bddf204df9df (diff) | |
download | chromium_src-52d08b12e8e7ff7c9b865837a2aeb17fb9dc2d42.zip chromium_src-52d08b12e8e7ff7c9b865837a2aeb17fb9dc2d42.tar.gz chromium_src-52d08b12e8e7ff7c9b865837a2aeb17fb9dc2d42.tar.bz2 |
Allow the history URL provider to handle input of type QUERY. This helps in the case where the user types something that on its own isn't navigable, but might be the prefix of something else navigable.
While there are no tests for this directly, another change of mine to treat more inputs with explicit schemes as queries (e.g. "http:/") relies on this, and does unittest for it.
In order to fit the new relevance scores into the table, I went through and simplified the relevance scoring so that generally providers used the same scores for more input types. The effects of this should be barely noticeable (it affects the ranking of past search queries that are old against results from the secondary search provider), and it simplifies the code noticeably.
This also fixes a "bug" that the NavSuggest results were incremented backwards, but since we only score one of these right now there's no visible effect.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/291005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29428 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/search_provider.h')
-rw-r--r-- | chrome/browser/autocomplete/search_provider.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/chrome/browser/autocomplete/search_provider.h b/chrome/browser/autocomplete/search_provider.h index 9b0ef38..f333c4f 100644 --- a/chrome/browser/autocomplete/search_provider.h +++ b/chrome/browser/autocomplete/search_provider.h @@ -236,15 +236,16 @@ class SearchProvider : public AutocompleteProvider, // if the search is from the keyword provider. int CalculateRelevanceForHistory(const base::Time& time, bool is_keyword) const; - // |suggestion_value| is the index of the suggestion in |suggest_results| that - // was returned from the server; the best suggestion is suggestion number 0. - // |is_keyword| is true if the search is from the keyword provider. - int CalculateRelevanceForSuggestion(const SuggestResults& suggest_results, - size_t suggestion_number, + // |result_number| is the index of the suggestion in the result set from the + // server; the best suggestion is suggestion number 0. |is_keyword| is true + // if the search is from the keyword provider. + int CalculateRelevanceForSuggestion(size_t num_results, + size_t result_number, bool is_keyword) const; - // |suggestion_value| is same as above. |is_keyword| is true if the navigation + // |result_number| is same as above. |is_keyword| is true if the navigation // result was suggested by the keyword provider. - int CalculateRelevanceForNavigation(size_t suggestion_value, + int CalculateRelevanceForNavigation(size_t num_results, + size_t result_number, bool is_keyword) const; // Creates an AutocompleteMatch for "Search <engine> for |query_string|" with |