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

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

Issue 8497050: Correctly score intranet URLs with typed_counts of 0 as UNVISITED_INTRANET if they are on known h... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/autocomplete/history_url_provider_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/history_url_provider.cc
===================================================================
--- chrome/browser/autocomplete/history_url_provider.cc (revision 108344)
+++ chrome/browser/autocomplete/history_url_provider.cc (working copy)
@@ -705,13 +705,12 @@
ACMatchClassification::NONE, &match->description_class);
if (!classifier.url_row().typed_count()) {
// If we reach here, we must be in the second pass, and we must not have
- // promoted this match as an exact match during the first pass. That
- // means it will have been outscored by the "search what you typed
- // match". We need to maintain that ordering in order to not make the
- // destination for the user's typing change depending on when they hit
- // enter. So lower the score here enough to let the search provider
- // continue to outscore this match.
- type = WHAT_YOU_TYPED;
+ // this row's data available during the first pass. That means we
+ // either scored it as WHAT_YOU_TYPED or UNVISITED_INTRANET, and to
+ // maintain the ordering between passes consistent, we need to score it
+ // the same way here.
+ type = CanFindIntranetURL(db, input) ?
+ UNVISITED_INTRANET : WHAT_YOU_TYPED;
}
break;
case VisitClassifier::UNVISITED_INTRANET:
@@ -752,9 +751,8 @@
return false;
const std::string host(UTF16ToUTF8(
input.text().substr(input.parts().host.begin, input.parts().host.len)));
- if (net::RegistryControlledDomainService::GetRegistryLength(host, false) != 0)
- return false;
- return db->IsTypedHost(host);
+ return (net::RegistryControlledDomainService::GetRegistryLength(host,
+ false) == 0) && db->IsTypedHost(host);
}
bool HistoryURLProvider::PromoteMatchForInlineAutocomplete(
« no previous file with comments | « no previous file | chrome/browser/autocomplete/history_url_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698