OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // Keyword (inexact match) | 450 | 56 // Keyword (inexact match) | 450 |
57 // Search Secondary Provider (what you typed) | 250 | 57 // Search Secondary Provider (what you typed) | 250 |
58 // Search Secondary Provider (past query in history) | 200-- | 58 // Search Secondary Provider (past query in history) | 200-- |
59 // Search Secondary Provider (navigational suggestion) | 150++ | 59 // Search Secondary Provider (navigational suggestion) | 150++ |
60 // Search Secondary Provider (suggestion) | 100++ | 60 // Search Secondary Provider (suggestion) | 100++ |
61 // | 61 // |
62 // REQUESTED_URL input type: | 62 // REQUESTED_URL input type: |
63 // --------------------------------------------------------------------|----- | 63 // --------------------------------------------------------------------|----- |
64 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 | 64 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 |
65 // HistoryURL (exact or inline autocomplete match) | 1400 | 65 // HistoryURL (exact or inline autocomplete match) | 1400 |
66 // HistoryURL (what you typed) | 1300 | 66 // HistoryURL (what you typed) | 1200 |
67 // Search Primary Provider (what you typed) | 1200 | 67 // Search Primary Provider (what you typed) | 1150 |
68 // Keyword (substituting, exact match) | 1100 | 68 // Keyword (substituting, exact match) | 1100 |
69 // Search Primary Provider (past query in history) | 1050-- | 69 // Search Primary Provider (past query in history) | 1050-- |
70 // HistoryContents (any match in title of starred page) | 1000++ | 70 // HistoryContents (any match in title of starred page) | 1000++ |
71 // HistoryURL (inexact match) | 900++ | 71 // HistoryURL (inexact match) | 900++ |
72 // Search Primary Provider (navigational suggestion) | 800++ | 72 // Search Primary Provider (navigational suggestion) | 800++ |
73 // HistoryContents (any match in title of nonstarred page) | 700++ | 73 // HistoryContents (any match in title of nonstarred page) | 700++ |
74 // Search Primary Provider (suggestion) | 600++ | 74 // Search Primary Provider (suggestion) | 600++ |
75 // HistoryContents (any match in body of starred page) | 550++ | 75 // HistoryContents (any match in body of starred page) | 550++ |
76 // HistoryContents (any match in body of nonstarred page) | 500++ | 76 // HistoryContents (any match in body of nonstarred page) | 500++ |
77 // Keyword (inexact match) | 450 | 77 // Keyword (inexact match) | 450 |
(...skipping 15 matching lines...) Expand all Loading... |
93 // Keyword (inexact match) | 700 | 93 // Keyword (inexact match) | 700 |
94 // Search Primary Provider (suggestion) | 300++ | 94 // Search Primary Provider (suggestion) | 300++ |
95 // Search Secondary Provider (what you typed) | 250 | 95 // Search Secondary Provider (what you typed) | 250 |
96 // Search Secondary Provider (past query in history) | 200-- | 96 // Search Secondary Provider (past query in history) | 200-- |
97 // Search Secondary Provider (navigational suggestion) | 150++ | 97 // Search Secondary Provider (navigational suggestion) | 150++ |
98 // Search Secondary Provider (suggestion) | 100++ | 98 // Search Secondary Provider (suggestion) | 100++ |
99 // | 99 // |
100 // QUERY input type: | 100 // QUERY input type: |
101 // --------------------------------------------------------------------|----- | 101 // --------------------------------------------------------------------|----- |
102 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 | 102 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 |
103 // Keyword (substituting, exact match) | 1400 | 103 // Keyword (substituting, exact match) | 1450 |
| 104 // HistoryURL (exact or inline autocomplete match) | 1400 |
104 // Search Primary Provider (what you typed) | 1300 | 105 // Search Primary Provider (what you typed) | 1300 |
105 // Search Primary Provider (past query in history) | 1250-- | 106 // Search Primary Provider (past query in history) | 1050-- |
106 // HistoryContents (any match in title of starred page) | 1200++ | 107 // HistoryContents (any match in title of starred page) | 1000++ |
107 // Search Primary Provider (navigational suggestion) | 1000++ | 108 // HistoryURL (inexact match) | 900++ |
108 // HistoryContents (any match in title of nonstarred page) | 900++ | 109 // Search Primary Provider (navigational suggestion) | 800++ |
109 // Search Primary Provider (suggestion) | 800++ | 110 // HistoryContents (any match in title of nonstarred page) | 700++ |
110 // HistoryContents (any match in body of starred page) | 750++ | 111 // Search Primary Provider (suggestion) | 600++ |
111 // HistoryContents (any match in body of nonstarred page) | 700++ | 112 // HistoryContents (any match in body of starred page) | 550++ |
112 // Keyword (inexact match) | 650 | 113 // HistoryContents (any match in body of nonstarred page) | 500++ |
| 114 // Keyword (inexact match) | 450 |
113 // Search Secondary Provider (what you typed) | 250 | 115 // Search Secondary Provider (what you typed) | 250 |
114 // Search Secondary Provider (past query in history) | 200-- | 116 // Search Secondary Provider (past query in history) | 200-- |
115 // Search Secondary Provider (navigational suggestion) | 150++ | 117 // Search Secondary Provider (navigational suggestion) | 150++ |
116 // Search Secondary Provider (suggestion) | 100++ | 118 // Search Secondary Provider (suggestion) | 100++ |
117 // | 119 // |
118 // FORCED_QUERY input type: | 120 // FORCED_QUERY input type: |
119 // --------------------------------------------------------------------|----- | 121 // --------------------------------------------------------------------|----- |
120 // Search Primary Provider (what you typed) | 1500 | 122 // Search Primary Provider (what you typed) | 1300 |
121 // Search Primary Provider (past query in history) | 1250-- | 123 // Search Primary Provider (past query in history) | 1050-- |
122 // HistoryContents (any match in title of starred page) | 1200++ | 124 // HistoryContents (any match in title of starred page) | 1000++ |
123 // Search Primary Provider (navigational suggestion) | 1000++ | 125 // Search Primary Provider (navigational suggestion) | 800++ |
124 // HistoryContents (any match in title of nonstarred page) | 900++ | 126 // HistoryContents (any match in title of nonstarred page) | 700++ |
125 // Search Primary Provider (suggestion) | 800++ | 127 // Search Primary Provider (suggestion) | 600++ |
126 // HistoryContents (any match in body of starred page) | 750++ | 128 // HistoryContents (any match in body of starred page) | 550++ |
127 // HistoryContents (any match in body of nonstarred page) | 700++ | 129 // HistoryContents (any match in body of nonstarred page) | 500++ |
128 // | 130 // |
129 // (A search keyword is a keyword with a replacement string; a bookmark keyword | 131 // (A search keyword is a keyword with a replacement string; a bookmark keyword |
130 // is a keyword with no replacement string, that is, a shortcut for a URL.) | 132 // is a keyword with no replacement string, that is, a shortcut for a URL.) |
131 // | 133 // |
132 // There are two possible providers for search suggestions. If the user has | 134 // There are two possible providers for search suggestions. If the user has |
133 // typed a keyword, then the primary provider is the keyword provider and the | 135 // typed a keyword, then the primary provider is the keyword provider and the |
134 // secondary provider is the default provider. If the user has not typed a | 136 // secondary provider is the default provider. If the user has not typed a |
135 // keyword, then the primary provider corresponds to the default provider. | 137 // keyword, then the primary provider corresponds to the default provider. |
136 // | 138 // |
137 // The value column gives the ranking returned from the various providers. | 139 // The value column gives the ranking returned from the various providers. |
(...skipping 12 matching lines...) Expand all Loading... |
150 class TemplateURL; | 152 class TemplateURL; |
151 | 153 |
152 typedef std::vector<AutocompleteMatch> ACMatches; | 154 typedef std::vector<AutocompleteMatch> ACMatches; |
153 typedef std::vector<AutocompleteProvider*> ACProviders; | 155 typedef std::vector<AutocompleteProvider*> ACProviders; |
154 | 156 |
155 // AutocompleteInput ---------------------------------------------------------- | 157 // AutocompleteInput ---------------------------------------------------------- |
156 | 158 |
157 // The user input for an autocomplete query. Allows copying. | 159 // The user input for an autocomplete query. Allows copying. |
158 class AutocompleteInput { | 160 class AutocompleteInput { |
159 public: | 161 public: |
| 162 // Note that the type below may be misleading. For example, "http:/" alone |
| 163 // cannot be opened as a URL, so it is marked as a QUERY; yet the user |
| 164 // probably intends to type more and have it eventually become a URL, so we |
| 165 // need to make sure we still run it through inline autocomplete. |
160 enum Type { | 166 enum Type { |
161 INVALID, // Empty input | 167 INVALID, // Empty input |
162 UNKNOWN, // Valid input whose type cannot be determined | 168 UNKNOWN, // Valid input whose type cannot be determined |
163 REQUESTED_URL, // Input autodetected as UNKNOWN, which the user wants to | 169 REQUESTED_URL, // Input autodetected as UNKNOWN, which the user wants to |
164 // treat as an URL by specifying a desired_tld | 170 // treat as an URL by specifying a desired_tld |
165 URL, // Input autodetected as a URL | 171 URL, // Input autodetected as a URL |
166 QUERY, // Input autodetected as a query | 172 QUERY, // Input autodetected as a query |
167 FORCED_QUERY, // Input forced to be a query by an initial '?' | 173 FORCED_QUERY, // Input forced to be a query by an initial '?' |
168 }; | 174 }; |
169 | 175 |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 AutocompleteInput::Type input_type; | 878 AutocompleteInput::Type input_type; |
873 // Selected index (if selected) or -1 (AutocompletePopupModel::kNoMatch). | 879 // Selected index (if selected) or -1 (AutocompletePopupModel::kNoMatch). |
874 size_t selected_index; | 880 size_t selected_index; |
875 // Inline autocompleted length (if displayed). | 881 // Inline autocompleted length (if displayed). |
876 size_t inline_autocompleted_length; | 882 size_t inline_autocompleted_length; |
877 // Result set. | 883 // Result set. |
878 const AutocompleteResult& result; | 884 const AutocompleteResult& result; |
879 }; | 885 }; |
880 | 886 |
881 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ | 887 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ |
OLD | NEW |