diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-09 21:26:42 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-09 21:26:42 +0000 |
commit | e0b231d3878b5351b1e643a2d746b733e3a5e13d (patch) | |
tree | 8c4ee545feb929fe2898d3424e335e81ce7d5daf /chrome/browser/autocomplete/history_url_provider.cc | |
parent | 2c6b521e275b8145e2546fb12404aceaed60cbcb (diff) | |
download | chromium_src-e0b231d3878b5351b1e643a2d746b733e3a5e13d.zip chromium_src-e0b231d3878b5351b1e643a2d746b733e3a5e13d.tar.gz chromium_src-e0b231d3878b5351b1e643a2d746b733e3a5e13d.tar.bz2 |
Makes autocompleting previous search terms work on word boundaries.
BUG=80057
TEST=covered by unit tests, but see bugs for details.
R=pkasting@chromium.org
Review URL: http://codereview.chromium.org/6893140
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84681 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/history_url_provider.cc')
-rw-r--r-- | chrome/browser/autocomplete/history_url_provider.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc index 3b5354a..342efce 100644 --- a/chrome/browser/autocomplete/history_url_provider.cc +++ b/chrome/browser/autocomplete/history_url_provider.cc @@ -109,6 +109,7 @@ HistoryURLProviderParams::HistoryURLProviderParams( const std::string& languages) : message_loop(MessageLoop::current()), input(input), + prevent_inline_autocomplete(input.prevent_inline_autocomplete()), trim_http(trim_http), cancel(false), failed(false), @@ -243,7 +244,7 @@ void HistoryURLProvider::DoAutocomplete(history::HistoryBackend* backend, // regardless of the input type. exact_suggestion = 1; params->matches.push_back(what_you_typed_match); - } else if (params->input.prevent_inline_autocomplete() || + } else if (params->prevent_inline_autocomplete || history_matches.empty() || !PromoteMatchForInlineAutocomplete(params, history_matches.front())) { // Failed to promote any URLs for inline autocompletion. Use the What You @@ -603,6 +604,9 @@ void HistoryURLProvider::RunAutocompletePasses( scoped_ptr<HistoryURLProviderParams> params( new HistoryURLProviderParams(input, trim_http, languages)); + params->prevent_inline_autocomplete = + PreventInlineAutocomplete(input); + if (fixup_input_and_run_pass_1) { // Do some fixup on the user input before matching against it, so we provide // good results for local file paths, input with spaces, etc. @@ -792,7 +796,7 @@ AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch( net::FormatUrl(info.url(), languages, format_types, UnescapeRule::SPACES, NULL, NULL, &inline_autocomplete_offset)); - if (!params->input.prevent_inline_autocomplete()) + if (!params->prevent_inline_autocomplete) match.inline_autocomplete_offset = inline_autocomplete_offset; DCHECK((match.inline_autocomplete_offset == string16::npos) || (match.inline_autocomplete_offset <= match.fill_into_edit.length())); |