OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_PROVIDER_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_PROVIDER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_PROVIDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 // HistoryURL (good exact or inline autocomplete matches, some inexact)| 1410++ | 43 // HistoryURL (good exact or inline autocomplete matches, some inexact)| 1410++ |
44 // HistoryURL (intranet url never visited match, some inexact matches) | 1400++ | 44 // HistoryURL (intranet url never visited match, some inexact matches) | 1400++ |
45 // Search Primary Provider (past query in history within 2 days) | 1399** | 45 // Search Primary Provider (past query in history within 2 days) | 1399** |
46 // Search Primary Provider (what you typed) | 1300 | 46 // Search Primary Provider (what you typed) | 1300 |
47 // HistoryURL (what you typed, some inexact matches) | 1200++ | 47 // HistoryURL (what you typed, some inexact matches) | 1200++ |
48 // Extension App (inexact match) | 1175*~ | 48 // Extension App (inexact match) | 1175*~ |
49 // Keyword (substituting, exact match) | 1100 | 49 // Keyword (substituting, exact match) | 1100 |
50 // Search Primary Provider (past query in history older than 2 days) | 1050-- | 50 // Search Primary Provider (past query in history older than 2 days) | 1050-- |
51 // HistoryContents (any match in title of starred page) | 1000++ | 51 // HistoryContents (any match in title of starred page) | 1000++ |
52 // HistoryURL (some inexact matches) | 900++ | 52 // HistoryURL (some inexact matches) | 900++ |
53 // BookmarkProvider (prefix match in bookmark title) | 900+- | |
53 // Search Primary Provider (navigational suggestion) | 800++ | 54 // Search Primary Provider (navigational suggestion) | 800++ |
54 // HistoryContents (any match in title of nonstarred page) | 700++ | 55 // HistoryContents (any match in title of nonstarred page) | 700++ |
55 // Search Primary Provider (suggestion) | 600++ | 56 // Search Primary Provider (suggestion) | 600++ |
56 // Built-in | 575++ | 57 // Built-in | 575++ |
57 // HistoryContents (any match in body of starred page) | 550++ | 58 // HistoryContents (any match in body of starred page) | 550++ |
58 // HistoryContents (any match in body of nonstarred page) | 500++ | 59 // HistoryContents (any match in body of nonstarred page) | 500++ |
59 // Keyword (inexact match) | 450 | 60 // Keyword (inexact match) | 450 |
60 // Search Secondary Provider (what you typed) | 250 | 61 // Search Secondary Provider (what you typed) | 250 |
61 // Search Secondary Provider (past query in history) | 200-- | 62 // Search Secondary Provider (past query in history) | 200-- |
62 // Search Secondary Provider (navigational suggestion) | 150++ | 63 // Search Secondary Provider (navigational suggestion) | 150++ |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 // Search Primary or Secondary (past query in history within 2 days) | 1599** | 115 // Search Primary or Secondary (past query in history within 2 days) | 1599** |
115 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 | 116 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 |
116 // Keyword (substituting, exact match) | 1450 | 117 // Keyword (substituting, exact match) | 1450 |
117 // Extension App (exact match) | 1425 | 118 // Extension App (exact match) | 1425 |
118 // Search Primary Provider (past query in history within 2 days) | 1399** | 119 // Search Primary Provider (past query in history within 2 days) | 1399** |
119 // Search Primary Provider (what you typed) | 1300 | 120 // Search Primary Provider (what you typed) | 1300 |
120 // Extension App (inexact match) | 1175*~ | 121 // Extension App (inexact match) | 1175*~ |
121 // Search Primary Provider (past query in history older than 2 days) | 1050-- | 122 // Search Primary Provider (past query in history older than 2 days) | 1050-- |
122 // HistoryContents (any match in title of starred page) | 1000++ | 123 // HistoryContents (any match in title of starred page) | 1000++ |
123 // HistoryURL (inexact match) | 900++ | 124 // HistoryURL (inexact match) | 900++ |
125 // BookmarkProvider (prefix match in bookmark title) | 900+- | |
124 // Search Primary Provider (navigational suggestion) | 800++ | 126 // Search Primary Provider (navigational suggestion) | 800++ |
125 // HistoryContents (any match in title of nonstarred page) | 700++ | 127 // HistoryContents (any match in title of nonstarred page) | 700++ |
126 // Search Primary Provider (suggestion) | 600++ | 128 // Search Primary Provider (suggestion) | 600++ |
127 // HistoryContents (any match in body of starred page) | 550++ | 129 // HistoryContents (any match in body of starred page) | 550++ |
128 // HistoryContents (any match in body of nonstarred page) | 500++ | 130 // HistoryContents (any match in body of nonstarred page) | 500++ |
129 // Keyword (inexact match) | 450 | 131 // Keyword (inexact match) | 450 |
130 // Search Secondary Provider (what you typed) | 250 | 132 // Search Secondary Provider (what you typed) | 250 |
131 // Search Secondary Provider (past query in history) | 200-- | 133 // Search Secondary Provider (past query in history) | 200-- |
132 // Search Secondary Provider (navigational suggestion) | 150++ | 134 // Search Secondary Provider (navigational suggestion) | 150++ |
133 // Search Secondary Provider (suggestion) | 100++ | 135 // Search Secondary Provider (suggestion) | 100++ |
(...skipping 25 matching lines...) Expand all Loading... | |
159 // | 161 // |
160 // The value column gives the ranking returned from the various providers. | 162 // The value column gives the ranking returned from the various providers. |
161 // ++: a series of matches with relevance from n up to (n + max_matches). | 163 // ++: a series of matches with relevance from n up to (n + max_matches). |
162 // --: relevance score falls off over time (discounted 50 points @ 15 minutes, | 164 // --: relevance score falls off over time (discounted 50 points @ 15 minutes, |
163 // 450 points @ two weeks) | 165 // 450 points @ two weeks) |
164 // **: relevance score falls off over two days (discounted 99 points after two | 166 // **: relevance score falls off over two days (discounted 99 points after two |
165 // days). | 167 // days). |
166 // *~: Partial matches get a score on a sliding scale from about 575-1125 based | 168 // *~: Partial matches get a score on a sliding scale from about 575-1125 based |
167 // on how many times the URL for the Extension App has been typed and how | 169 // on how many times the URL for the Extension App has been typed and how |
168 // many of the letters match. | 170 // many of the letters match. |
171 // +-: A base score that the provider will adjust upward or downward based on | |
172 // provider-specific metrics. | |
169 // | 173 // |
170 // A single result provider for the autocomplete system. Given user input, the | 174 // A single result provider for the autocomplete system. Given user input, the |
171 // provider decides what (if any) matches to return, their relevance, and their | 175 // provider decides what (if any) matches to return, their relevance, and their |
172 // classifications. | 176 // classifications. |
173 class AutocompleteProvider | 177 class AutocompleteProvider |
174 : public base::RefCountedThreadSafe<AutocompleteProvider> { | 178 : public base::RefCountedThreadSafe<AutocompleteProvider> { |
175 public: | 179 public: |
176 // Different AutocompleteProvider implementations. | 180 // Different AutocompleteProvider implementations. |
177 enum Type { | 181 enum Type { |
182 TYPE_BOOKMARK = 1 << 10, | |
Mark P
2012/10/08 22:51:59
Side comment: alphabetic order without renumbering
Peter Kasting
2012/10/09 18:30:41
Agreed, my intent was that these also be renumbere
mrossetti
2012/10/10 02:26:42
It looks like renumber would be harmless. Done.
O
| |
178 TYPE_BUILTIN = 1 << 0, | 183 TYPE_BUILTIN = 1 << 0, |
179 TYPE_CONTACT = 1 << 1, | 184 TYPE_CONTACT = 1 << 1, |
180 TYPE_EXTENSION_APP = 1 << 2, | 185 TYPE_EXTENSION_APP = 1 << 2, |
181 TYPE_HISTORY_CONTENTS = 1 << 3, | 186 TYPE_HISTORY_CONTENTS = 1 << 3, |
182 TYPE_HISTORY_QUICK = 1 << 4, | 187 TYPE_HISTORY_QUICK = 1 << 4, |
183 TYPE_HISTORY_URL = 1 << 5, | 188 TYPE_HISTORY_URL = 1 << 5, |
184 TYPE_KEYWORD = 1 << 6, | 189 TYPE_KEYWORD = 1 << 6, |
185 TYPE_SEARCH = 1 << 7, | 190 TYPE_SEARCH = 1 << 7, |
186 TYPE_SHORTCUTS = 1 << 8, | 191 TYPE_SHORTCUTS = 1 << 8, |
187 TYPE_ZERO_SUGGEST = 1 << 9, | 192 TYPE_ZERO_SUGGEST = 1 << 9, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
288 | 293 |
289 Type type_; | 294 Type type_; |
290 | 295 |
291 private: | 296 private: |
292 DISALLOW_COPY_AND_ASSIGN(AutocompleteProvider); | 297 DISALLOW_COPY_AND_ASSIGN(AutocompleteProvider); |
293 }; | 298 }; |
294 | 299 |
295 typedef std::vector<AutocompleteProvider*> ACProviders; | 300 typedef std::vector<AutocompleteProvider*> ACProviders; |
296 | 301 |
297 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_PROVIDER_H_ | 302 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_PROVIDER_H_ |
OLD | NEW |