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

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

Issue 7607007: Add confidence to AutocompleteMatch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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_quick_provider.h
diff --git a/chrome/browser/autocomplete/history_quick_provider.h b/chrome/browser/autocomplete/history_quick_provider.h
index bd7a8244acba8d84250f0083e1d5c278ef5ed19c..a77c34396c4e89eda52674783b40b9bc551784fb 100644
--- a/chrome/browser/autocomplete/history_quick_provider.h
+++ b/chrome/browser/autocomplete/history_quick_provider.h
@@ -49,9 +49,11 @@ class HistoryQuickProvider : public HistoryProvider {
static const int kMaxNonInliningScore;
// Creates an AutocompleteMatch from |history_match|. |max_match_score| gives
- // the maximum possible score for the match.
+ // the maximum possible score for the match. |history_matches| is the full set
+ // of matches to compare each match to when calculating confidence.
AutocompleteMatch QuickMatchToACMatch(
const history::ScoredHistoryMatch& history_match,
+ const history::ScoredHistoryMatches& history_matches,
bool prevent_inline_autocomplete,
int* max_match_score);
@@ -64,6 +66,12 @@ class HistoryQuickProvider : public HistoryProvider {
const history::ScoredHistoryMatch& history_match,
int* max_match_score);
+ // Determines the confidence of |match| by comparing the |raw_score| to the
+ // sum of the scores of |matches|. Returns a float in the range [0, 1].
+ static float CalculateConfidence(
+ const history::ScoredHistoryMatch& match,
+ const history::ScoredHistoryMatches& matches);
+
// Returns the index that should be used for history lookups.
history::InMemoryURLIndex* GetIndex();
« no previous file with comments | « chrome/browser/autocomplete/history_contents_provider.cc ('k') | chrome/browser/autocomplete/history_quick_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698