Index: chrome/browser/autocomplete/search_provider.cc |
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc |
index 85557113ccbac455efaa5b3d50e7fc60be43f61d..00d47cddd3428a95e44d8fcc08a044bbe56b5aa2 100644 |
--- a/chrome/browser/autocomplete/search_provider.cc |
+++ b/chrome/browser/autocomplete/search_provider.cc |
@@ -1126,10 +1126,19 @@ AutocompleteMatch SearchProvider::NavigationToMatch( |
// that we're not preventing, make sure we didn't trim any whitespace. |
// We don't want to claim http://foo.com/bar is inlineable against the |
// input "foo.com/b ". |
- match.allowed_to_be_default_match = navigation.IsInlineable(input) && |
+ match.allowed_to_be_default_match = (prefix != NULL) && |
(providers_.GetKeywordProviderURL() == NULL) && |
(match.inline_autocompletion.empty() || |
(!input_.prevent_inline_autocomplete() && !trimmed_whitespace)); |
+ // Also allow a user's input to be marked as default if it would be fixed |
+ // up to something equivalent to the URL-what-you-typed match. This handles |
+ // cases like the user input containing a trailing colon on a raw hostname. |
+ // (The URL-what-you-typed match will ignore the colon.) |
+ match.ComputeStrippedDestinationURL(profile_); |
+ if (AutocompleteMatch::GURLToStrippedGURL( |
+ input_.canonicalized_url(), profile_, base::string16()) == |
+ match.stripped_destination_url) |
+ match.allowed_to_be_default_match = true; |
match.contents = navigation.match_contents(); |
match.contents_class = navigation.match_contents_class(); |