diff options
author | dominich@chromium.org <dominich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-01 06:16:52 +0000 |
---|---|---|
committer | dominich@chromium.org <dominich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-01 06:16:52 +0000 |
commit | 925136821950cb844c98dcfa88c7807e8708746e (patch) | |
tree | 4b2337cac69fee8f562b68fba7385349f5de0045 /chrome/browser/autocomplete/history_quick_provider.cc | |
parent | 70213de441a0c8e29ffc6f73bd64c78aabba06aa (diff) | |
download | chromium_src-925136821950cb844c98dcfa88c7807e8708746e.zip chromium_src-925136821950cb844c98dcfa88c7807e8708746e.tar.gz chromium_src-925136821950cb844c98dcfa88c7807e8708746e.tar.bz2 |
Remove confidence from AutocompleteMatch and use History DB instead.
Adds a class responsible for providing recommended actions given an AutocompleteMatch which uses the History Database to determine that action.
BUG=92896,94423
TEST=NetworkActionPredictorTest*
Review URL: http://codereview.chromium.org/7686012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99140 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/history_quick_provider.cc')
-rw-r--r-- | chrome/browser/autocomplete/history_quick_provider.cc | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/chrome/browser/autocomplete/history_quick_provider.cc b/chrome/browser/autocomplete/history_quick_provider.cc index 8a96c52..fbdc559 100644 --- a/chrome/browser/autocomplete/history_quick_provider.cc +++ b/chrome/browser/autocomplete/history_quick_provider.cc @@ -119,8 +119,6 @@ void HistoryQuickProvider::DoAutocomplete() { history_match, matches, PreventInlineAutocomplete(autocomplete_input_), &max_match_score); - UMA_HISTOGRAM_COUNTS_100("Autocomplete.Confidence_HistoryQuick", - ac_match.confidence * 100); matches_.push_back(ac_match); } } @@ -134,11 +132,9 @@ AutocompleteMatch HistoryQuickProvider::QuickMatchToACMatch( DCHECK(max_match_score); const history::URLRow& info = history_match.url_info; int score = CalculateRelevance(history_match, max_match_score); - float confidence = CalculateConfidence(history_match, history_matches); - AutocompleteMatch match(this, score, confidence, !!info.visit_count(), - history_match.url_matches.empty() ? - AutocompleteMatch::HISTORY_URL : - AutocompleteMatch::HISTORY_TITLE); + AutocompleteMatch match(this, score, !!info.visit_count(), + history_match.url_matches.empty() ? + AutocompleteMatch::HISTORY_URL : AutocompleteMatch::HISTORY_TITLE); match.destination_url = info.url(); DCHECK(match.destination_url.is_valid()); @@ -206,20 +202,6 @@ int HistoryQuickProvider::CalculateRelevance( } // static -float HistoryQuickProvider::CalculateConfidence( - const ScoredHistoryMatch& match, - const ScoredHistoryMatches& matches) { - float denominator = 0.0f; - for (ScoredHistoryMatches::const_iterator it = matches.begin(); - it != matches.end(); ++it) { - denominator += it->raw_score; - } - DCHECK(denominator > 0); - - return static_cast<float>(match.raw_score) / denominator; -} - -// static ACMatchClassifications HistoryQuickProvider::SpansFromTermMatch( const history::TermMatches& matches, size_t text_length, |