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

Unified Diff: chrome/browser/autocomplete/history_url_provider.h

Issue 7607007: Add confidence to AutocompleteMatch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to pkasting Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autocomplete/history_url_provider.h
diff --git a/chrome/browser/autocomplete/history_url_provider.h b/chrome/browser/autocomplete/history_url_provider.h
index 5e5fe67cadfb992c49e3d9d176b33671842c8d8e..4257003a409b37498b667d89a2ebca658a1f9a36 100644
--- a/chrome/browser/autocomplete/history_url_provider.h
+++ b/chrome/browser/autocomplete/history_url_provider.h
@@ -196,6 +196,11 @@ class HistoryURLProvider : public HistoryProvider {
MatchType match_type,
size_t match_number);
+ // Determines the confidence for a |match| when compared to all the
+ // |matches|. Returns a number in the range [0, 1].
+ static float CalculateConfidence(const history::HistoryMatch& match,
+ const history::HistoryMatches& matches);
+
// Given the user's |input| and a |match| created from it, reduce the
// match's URL to just a host. If this host still matches the user input,
// return it. Returns the empty string on failure.
@@ -259,8 +264,10 @@ class HistoryURLProvider : public HistoryProvider {
// Determines if |match| is suitable for inline autocomplete, and promotes it
// if so.
- bool PromoteMatchForInlineAutocomplete(HistoryURLProviderParams* params,
- const history::HistoryMatch& match);
+ bool PromoteMatchForInlineAutocomplete(
+ HistoryURLProviderParams* params,
+ const history::HistoryMatch& match,
+ const history::HistoryMatches& history_matches);
// Sorts the given list of matches.
void SortMatches(history::HistoryMatches* matches) const;
@@ -292,6 +299,7 @@ class HistoryURLProvider : public HistoryProvider {
AutocompleteMatch HistoryMatchToACMatch(
HistoryURLProviderParams* params,
const history::HistoryMatch& history_match,
+ const history::HistoryMatches& history_matches,
MatchType match_type,
size_t match_number);

Powered by Google App Engine
This is Rietveld 408576698