Chromium Code Reviews| Index: chrome/browser/autocomplete/history_url_provider.cc |
| diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc |
| index 61eceda8b345109719c6c0082b39ce99a62e8d8d..362f20b48267792514c1c55cae2e93deaa174252 100644 |
| --- a/chrome/browser/autocomplete/history_url_provider.cc |
| +++ b/chrome/browser/autocomplete/history_url_provider.cc |
| @@ -756,20 +756,20 @@ void HistoryURLProvider::DoAutocomplete(history::HistoryBackend* backend, |
| SortAndDedupMatches(¶ms->matches); |
| // Try to create a shorter suggestion from the best match. |
| - // We consider the what you typed match eligible for display when there's a |
| - // reasonable chance the user actually cares: |
| - // * Their input can be opened as a URL, and |
| - // * We parsed the input as a URL, or it starts with an explicit "http:" or |
| - // "https:". |
| - // Otherwise, this is just low-quality noise. In the cases where we've parsed |
| - // as UNKNOWN, we'll still show an accidental search infobar if need be. |
| + // We consider the what you typed match eligible for display when it's |
| + // navigable and there's a reasonable chance the user intended to do |
| + // something other than search. We use a variety of heuristics to determine |
| + // this, e.g. whether the user explicitly typed a scheme, or if omnibox |
| + // searching has been disabled by policy. In the cases where we've parsed as |
| + // UNKNOWN, we'll still show an accidental search infobar if need be. |
| VisitClassifier classifier(this, params->input, db); |
| params->have_what_you_typed_match = |
| (params->input.type() != metrics::OmniboxInputType::QUERY) && |
| ((params->input.type() != metrics::OmniboxInputType::UNKNOWN) || |
| (classifier.type() == VisitClassifier::UNVISITED_INTRANET) || |
| !params->trim_http || |
| - (AutocompleteInput::NumNonHostComponents(params->input.parts()) > 0)); |
| + (AutocompleteInput::NumNonHostComponents(params->input.parts()) > 0) || |
| + (!params->default_search_provider)); |
|
Peter Kasting
2014/10/24 22:02:13
Nit: No parens around unary operation
|
| const bool have_shorter_suggestion_suitable_for_inline_autocomplete = |
| PromoteOrCreateShorterSuggestion( |
| db, params->have_what_you_typed_match, params); |