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

Unified Diff: chrome/browser/history/url_index_private_data.cc

Issue 9289034: Fix keyword recognition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Change IMUI to handle trailing space as a multi-term query. Created 8 years, 11 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
« no previous file with comments | « chrome/browser/history/in_memory_url_index_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/url_index_private_data.cc
===================================================================
--- chrome/browser/history/url_index_private_data.cc (revision 119252)
+++ chrome/browser/history/url_index_private_data.cc (working copy)
@@ -530,12 +530,19 @@
match.title_matches = SortAndDeoverlapMatches(match.title_matches);
// We can inline autocomplete a result if:
- // 1) the search term starts at the beginning of the candidate URL, OR
- // 2) the candidate URL has one of the standard 'ftp' or 'http[s]'
- // prefixes.
- match.can_inline = match.url_matches.size() &&
+ // 1) there is only one search term, AND
+ // 2) there is one match within the URL, AND
Peter Kasting 2012/01/26 22:19:25 Shouldn't we allow multiple URL matches for our on
mrossetti 2012/01/26 22:58:55 Done.
+ // 2) it starts at the beginning of the candidate URL, OR
Peter Kasting 2012/01/26 22:19:25 Nit: To make clear how tightly the ANDs and ORd on
mrossetti 2012/01/26 22:58:55 Done.
+ // 3) the candidate URL starts with one of the standard URL prefixes with
+ // the URL match immediately following that prefix.
+ // 4) AND the search string does not end in whitespace (making it look to
+ // the IMUI as though there is a single search term when actually there
+ // is a second, empty term).
+ match.can_inline = match.url_matches.size() == 1 &&
+ terms.size() == 1 &&
(match.url_matches[0].offset == 0 ||
- IsInlineablePrefix(url.substr(0, match.url_matches[0].offset)));
+ IsInlineablePrefix(url.substr(0, match.url_matches[0].offset))) &&
+ !IsWhitespace(*(lower_string.rbegin()));
// Get partial scores based on term matching. Note that the score for
// each of the URL and title are adjusted by the fraction of the
« no previous file with comments | « chrome/browser/history/in_memory_url_index_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698