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

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

Issue 353223002: Omnibox: Fix URL-What-You-Typed Allowed-To-Be-Default-Match Issues (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: polish Created 6 years, 6 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_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();

Powered by Google App Engine
This is Rietveld 408576698