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

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

Issue 291005: Allow the history URL provider to handle input of type QUERY. This helps in ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 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.cc
===================================================================
--- chrome/browser/autocomplete/history_contents_provider.cc (revision 29226)
+++ chrome/browser/autocomplete/history_contents_provider.cc (working copy)
@@ -250,31 +250,11 @@
int HistoryContentsProvider::CalculateRelevance(
const history::URLResult& result) {
const bool in_title = MatchInTitle(result);
- const bool is_starred =
- (profile_->GetBookmarkModel() &&
- profile_->GetBookmarkModel()->IsBookmarked(result.url()));
-
- switch (input_type_) {
- case AutocompleteInput::UNKNOWN:
- case AutocompleteInput::REQUESTED_URL:
- if (is_starred) {
- return in_title ?
- (1000 + star_title_count_++) : (550 + star_contents_count_++);
- }
- return in_title ? (700 + title_count_++) : (500 + contents_count_++);
-
- case AutocompleteInput::QUERY:
- case AutocompleteInput::FORCED_QUERY:
- if (is_starred) {
- return in_title ?
- (1200 + star_title_count_++) : (750 + star_contents_count_++);
- }
- return in_title ? (900 + title_count_++) : (700 + contents_count_++);
-
- default:
- NOTREACHED();
- return 0;
- }
+ if (!profile_->GetBookmarkModel() ||
+ !profile_->GetBookmarkModel()->IsBookmarked(result.url()))
+ return in_title ? (700 + title_count_++) : (500 + contents_count_++);
+ return in_title ?
+ (1000 + star_title_count_++) : (550 + star_contents_count_++);
}
void HistoryContentsProvider::QueryBookmarks(const AutocompleteInput& input) {

Powered by Google App Engine
This is Rietveld 408576698