summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/autocomplete.h
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-19 18:42:36 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-19 18:42:36 +0000
commit52d08b12e8e7ff7c9b865837a2aeb17fb9dc2d42 (patch)
treedaa03a7be2ffe72d304d7498b7b438ddb4469ae3 /chrome/browser/autocomplete/autocomplete.h
parentc6d5cdb28856a33676e3bf40e213bddf204df9df (diff)
downloadchromium_src-52d08b12e8e7ff7c9b865837a2aeb17fb9dc2d42.zip
chromium_src-52d08b12e8e7ff7c9b865837a2aeb17fb9dc2d42.tar.gz
chromium_src-52d08b12e8e7ff7c9b865837a2aeb17fb9dc2d42.tar.bz2
Allow the history URL provider to handle input of type QUERY. This helps in the case where the user types something that on its own isn't navigable, but might be the prefix of something else navigable.
While there are no tests for this directly, another change of mine to treat more inputs with explicit schemes as queries (e.g. "http:/") relies on this, and does unittest for it. In order to fit the new relevance scores into the table, I went through and simplified the relevance scoring so that generally providers used the same scores for more input types. The effects of this should be barely noticeable (it affects the ranking of past search queries that are old against results from the secondary search provider), and it simplifies the code noticeably. This also fixes a "bug" that the NavSuggest results were incremented backwards, but since we only score one of these right now there's no visible effect. BUG=none TEST=none Review URL: http://codereview.chromium.org/291005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29428 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete.h')
-rw-r--r--chrome/browser/autocomplete/autocomplete.h44
1 files changed, 25 insertions, 19 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.h b/chrome/browser/autocomplete/autocomplete.h
index 5134f8f..0416328 100644
--- a/chrome/browser/autocomplete/autocomplete.h
+++ b/chrome/browser/autocomplete/autocomplete.h
@@ -63,8 +63,8 @@
// --------------------------------------------------------------------|-----
// Keyword (non-substituting or in keyword UI mode, exact match) | 1500
// HistoryURL (exact or inline autocomplete match) | 1400
-// HistoryURL (what you typed) | 1300
-// Search Primary Provider (what you typed) | 1200
+// HistoryURL (what you typed) | 1200
+// Search Primary Provider (what you typed) | 1150
// Keyword (substituting, exact match) | 1100
// Search Primary Provider (past query in history) | 1050--
// HistoryContents (any match in title of starred page) | 1000++
@@ -100,16 +100,18 @@
// QUERY input type:
// --------------------------------------------------------------------|-----
// Keyword (non-substituting or in keyword UI mode, exact match) | 1500
-// Keyword (substituting, exact match) | 1400
+// Keyword (substituting, exact match) | 1450
+// HistoryURL (exact or inline autocomplete match) | 1400
// Search Primary Provider (what you typed) | 1300
-// Search Primary Provider (past query in history) | 1250--
-// HistoryContents (any match in title of starred page) | 1200++
-// Search Primary Provider (navigational suggestion) | 1000++
-// HistoryContents (any match in title of nonstarred page) | 900++
-// Search Primary Provider (suggestion) | 800++
-// HistoryContents (any match in body of starred page) | 750++
-// HistoryContents (any match in body of nonstarred page) | 700++
-// Keyword (inexact match) | 650
+// Search Primary Provider (past query in history) | 1050--
+// HistoryContents (any match in title of starred page) | 1000++
+// HistoryURL (inexact match) | 900++
+// Search Primary Provider (navigational suggestion) | 800++
+// HistoryContents (any match in title of nonstarred page) | 700++
+// Search Primary Provider (suggestion) | 600++
+// HistoryContents (any match in body of starred page) | 550++
+// HistoryContents (any match in body of nonstarred page) | 500++
+// Keyword (inexact match) | 450
// Search Secondary Provider (what you typed) | 250
// Search Secondary Provider (past query in history) | 200--
// Search Secondary Provider (navigational suggestion) | 150++
@@ -117,14 +119,14 @@
//
// FORCED_QUERY input type:
// --------------------------------------------------------------------|-----
-// Search Primary Provider (what you typed) | 1500
-// Search Primary Provider (past query in history) | 1250--
-// HistoryContents (any match in title of starred page) | 1200++
-// Search Primary Provider (navigational suggestion) | 1000++
-// HistoryContents (any match in title of nonstarred page) | 900++
-// Search Primary Provider (suggestion) | 800++
-// HistoryContents (any match in body of starred page) | 750++
-// HistoryContents (any match in body of nonstarred page) | 700++
+// Search Primary Provider (what you typed) | 1300
+// Search Primary Provider (past query in history) | 1050--
+// HistoryContents (any match in title of starred page) | 1000++
+// Search Primary Provider (navigational suggestion) | 800++
+// HistoryContents (any match in title of nonstarred page) | 700++
+// Search Primary Provider (suggestion) | 600++
+// HistoryContents (any match in body of starred page) | 550++
+// HistoryContents (any match in body of nonstarred page) | 500++
//
// (A search keyword is a keyword with a replacement string; a bookmark keyword
// is a keyword with no replacement string, that is, a shortcut for a URL.)
@@ -157,6 +159,10 @@ typedef std::vector<AutocompleteProvider*> ACProviders;
// The user input for an autocomplete query. Allows copying.
class AutocompleteInput {
public:
+ // Note that the type below may be misleading. For example, "http:/" alone
+ // cannot be opened as a URL, so it is marked as a QUERY; yet the user
+ // probably intends to type more and have it eventually become a URL, so we
+ // need to make sure we still run it through inline autocomplete.
enum Type {
INVALID, // Empty input
UNKNOWN, // Valid input whose type cannot be determined