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

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

Issue 7607007: Add confidence to AutocompleteMatch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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_contents_provider.h
diff --git a/chrome/browser/autocomplete/history_contents_provider.h b/chrome/browser/autocomplete/history_contents_provider.h
index 7ceb0b90639758ce5eff2c5d683d37af39068001..ce31ec38c7f7178b6e943f3e724585de6ffb5fcb 100644
--- a/chrome/browser/autocomplete/history_contents_provider.h
+++ b/chrome/browser/autocomplete/history_contents_provider.h
@@ -9,6 +9,8 @@
#include "chrome/browser/autocomplete/history_provider.h"
#include "chrome/browser/history/history.h"
+struct MatchReference;
Peter Kasting 2011/08/09 20:53:00 Nit: Shouldn't this be moved inside HistoryContent
dominich 2011/08/09 21:43:43 I went back and forward on this a couple of times.
+
namespace bookmark_utils {
struct TitleMatch;
}
@@ -45,8 +47,7 @@ class HistoryContentsProvider : public HistoryProvider {
void ConvertResults();
// Creates and returns an AutocompleteMatch from a MatchingPageResult.
- AutocompleteMatch ResultToMatch(const history::URLResult& result,
- int score);
+ AutocompleteMatch ResultToMatch(const MatchReference& match_reference);
// Adds ACMatchClassifications to match from the offset positions in
// page_result.
@@ -57,6 +58,12 @@ class HistoryContentsProvider : public HistoryProvider {
// chart in autocomplete.h for the list of values this returns.
int CalculateRelevance(const history::URLResult& result);
+ // Calculates and returns the confidence for a particular result. This is
+ // calculated by comparing the result's |visit_count| to that of all the
+ // results.
+ float CalculateConfidence(const history::URLResult& result,
+ const history::QueryResults& results) const;
+
// Queries the bookmarks for any bookmarks whose title matches input. All
// matches are added directly to results_.
void QueryBookmarks(const AutocompleteInput& input);

Powered by Google App Engine
This is Rietveld 408576698