Reviewers: Bart N., msw, Peter Kasting,
Message:
I think this is right thing to do. This is a bit messy, mainly because
KeywordProvider is separate from SearchProvider. Sadly, that means I had to
make its CalculateRelevance public. (Ideally I'd make the function visible
only
to SearchProvider. However, it doesn't seem possible to make private
_functions_ available to a friend, only friend member _variables_.)
Alternative implementation suggestions encouraged.
Sticking with this implementation, I know I made a number of decisions about
wrapping and indentation that you may question. If you prefer a different
choice, tell me and I'll reformat the code.
thanks,
mark
https://codereview.chromium.org/11953016/diff/1/chrome/browser/autocomplete/keyword_provider.cc
File chrome/browser/autocomplete/keyword_provider.cc (right):
https://codereview.chromium.org/11953016/diff/1/chrome/browser/autocomplete/keyword_provider.cc#newcode353
chrome/browser/autocomplete/keyword_provider.cc:353: int
KeywordProvider::CalculateRelevance(AutocompleteInput::Type type,
This is an exact cut-and-paste.
https://codereview.chromium.org/11953016/diff/1/chrome/browser/autocomplete/keyword_provider.h
File chrome/browser/autocomplete/keyword_provider.h (right):
https://codereview.chromium.org/11953016/diff/1/chrome/browser/autocomplete/keyword_provider.h#newcode96
chrome/browser/autocomplete/keyword_provider.h:96: // Determines the
relevance for some input, given its type, whether the user
This is an exact cut-and-paste.
Description:
Omnibox: Better Enforce Suggest Relevance Constraints in Keyword Mode
TEST=doesn't check. Also, all the inline completion suggestions look
sane.
BUG=171104
Please review this at
https://codereview.chromium.org/11953016/
SVN Base: svn://
svn.chromium.org/chrome/trunk/src
Affected files:
M chrome/browser/autocomplete/keyword_provider.h
M chrome/browser/autocomplete/keyword_provider.cc
M chrome/browser/autocomplete/search_provider.h
M chrome/browser/autocomplete/search_provider.cc