Index: chrome/browser/autocomplete/history_quick_provider.cc |
diff --git a/chrome/browser/autocomplete/history_quick_provider.cc b/chrome/browser/autocomplete/history_quick_provider.cc |
index 5291c7e87ec20690aaa3edbc30fdd097097ccd84..29645b06e05e12597a86146e7797cd1a85e6b328 100644 |
--- a/chrome/browser/autocomplete/history_quick_provider.cc |
+++ b/chrome/browser/autocomplete/history_quick_provider.cc |
@@ -275,6 +275,16 @@ AutocompleteMatch HistoryQuickProvider::QuickMatchToACMatch( |
match.allowed_to_be_default_match = match.inline_autocompletion.empty() || |
!PreventInlineAutocomplete(autocomplete_input_); |
} |
+ // 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 cursor being into the middle of input, making |
+ // ScoredHistoryMatch think the input is two terms and thus be unable to |
+ // decide if it's inlineable. |
+ match.ComputeStrippedDestinationURL(profile_); |
+ if (AutocompleteMatch::GURLToStrippedGURL( |
+ autocomplete_input_.canonicalized_url(), profile_, |
+ base::string16()) == match.stripped_destination_url) |
+ match.allowed_to_be_default_match = true; |
// Format the description autocomplete presentation. |
match.description = info.title(); |