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

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

Issue 7314018: Don't autocomplete searches of >1 word if they've only been visited once and the user has not yet... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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/search_provider.h
===================================================================
--- chrome/browser/autocomplete/search_provider.h (revision 92729)
+++ chrome/browser/autocomplete/search_provider.h (working copy)
@@ -171,7 +171,11 @@
typedef std::vector<NavigationResult> NavigationResults;
typedef std::vector<history::KeywordSearchTermVisit> HistoryResults;
typedef std::map<string16, AutocompleteMatch> MatchMap;
+ typedef std::pair<string16, int> ScoredTerm;
+ typedef std::vector<ScoredTerm> ScoredTerms;
+ class CompareScoredTerms;
+
// Called when timer_ expires.
void Run();
@@ -224,6 +228,13 @@
int did_not_accept_suggestion,
MatchMap* map);
+ // Calculates relevance scores for all |results|.
+ ScoredTerms ScoreHistoryTerms(const HistoryResults& results,
+ bool base_prevent_inline_autocomplete,
+ bool input_multiple_words,
+ const string16& input_text,
+ bool is_keyword);
+
// Adds a match for each result in |suggest_results| to |map|. |is_keyword|
// indicates whether the results correspond to the keyword provider or default
// provider.
@@ -235,12 +246,13 @@
// Determines the relevance for a particular match. We use different scoring
// algorithms for the different types of matches.
int CalculateRelevanceForWhatYouTyped() const;
- // |time| is the time at which this query was last seen. |is_keyword| is true
- // if the search is from the keyword provider. |looks_like_url| is true if the
- // search term would be treated as a URL if typed into the omnibox.
+ // |time| is the time at which this query was last seen. |is_keyword|
+ // indicates whether the results correspond to the keyword provider or default
+ // provider. |prevent_inline_autocomplete| is true if we should not inline
+ // autocomplete this query.
int CalculateRelevanceForHistory(const base::Time& time,
- bool looks_like_url,
- bool is_keyword) const;
+ bool is_keyword,
+ bool prevent_inline_autocomplete) const;
// |result_number| is the index of the suggestion in the result set from the
// server; the best suggestion is suggestion number 0. |is_keyword| is true
// if the search is from the keyword provider.

Powered by Google App Engine
This is Rietveld 408576698