summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/history_url_provider.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-19 02:45:05 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-19 02:45:05 +0000
commita2d2e2f9de8dad20f28734486cadcd3c03e45bfa (patch)
treefaf6efa06a03b9da2369592bcb89f0b3382dd516 /chrome/browser/autocomplete/history_url_provider.cc
parent0e6d0b4250e3d5e6925d2c84fa640a06ce5787a6 (diff)
downloadchromium_src-a2d2e2f9de8dad20f28734486cadcd3c03e45bfa.zip
chromium_src-a2d2e2f9de8dad20f28734486cadcd3c03e45bfa.tar.gz
chromium_src-a2d2e2f9de8dad20f28734486cadcd3c03e45bfa.tar.bz2
Correctly score intranet URLs with typed_counts of 0 as UNVISITED_INTRANET if they are on known hostnames.
BUG=103470 TEST=On a clean profile, type an intranet host (e.g. "go/") and hit enter; then paste a different address on that host (e.g. "go/shuttlealerts") and hit enter; then in a new tab, paste that second address again and verify that the default action is to navigate rather than search. Review URL: http://codereview.chromium.org/8497050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110820 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/history_url_provider.cc')
-rw-r--r--chrome/browser/autocomplete/history_url_provider.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc
index cbbfb0e..692587b 100644
--- a/chrome/browser/autocomplete/history_url_provider.cc
+++ b/chrome/browser/autocomplete/history_url_provider.cc
@@ -705,13 +705,12 @@ bool HistoryURLProvider::FixupExactSuggestion(
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 @@ bool HistoryURLProvider::CanFindIntranetURL(
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(