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_MATCH_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
180 // Convenience function to check if |type| is a search (as opposed to a URL or | 180 // Convenience function to check if |type| is a search (as opposed to a URL or |
181 // an extension). | 181 // an extension). |
182 static bool IsSearchType(Type type); | 182 static bool IsSearchType(Type type); |
183 | 183 |
184 // Copies the destination_url with "www." stripped off to | 184 // Copies the destination_url with "www." stripped off to |
185 // |stripped_destination_url| and also converts https protocol to | 185 // |stripped_destination_url| and also converts https protocol to |
186 // http. These two conversions are merely to allow comparisons to | 186 // http. These two conversions are merely to allow comparisons to |
187 // remove likely duplicates; these URLs are not used as actual | 187 // remove likely duplicates; these URLs are not used as actual |
188 // destination URLs. This method is invoked internally by the | 188 // destination URLs. This method is invoked internally by the |
189 // AutocompleteResult and does not normally need to be invoked. | 189 // AutocompleteResult and does not normally need to be invoked. |
190 void ComputeStrippedDestinationURL(); | 190 // If |search_provider_url| is not NULL, it is used to normalize |
191 // URLs that might have been generated by the default search provider. | |
Peter Kasting
2012/10/19 22:49:33
We should not pass this in.
If the match has an a
| |
192 // This is in particular important for all URLs with time/position sensitive | |
193 // CGI params that need to be stripped off. | |
194 void ComputeStrippedDestinationURL(TemplateURL* search_provider_url); | |
191 | 195 |
192 // Gets data relevant to whether there should be any special keyword-related | 196 // Gets data relevant to whether there should be any special keyword-related |
193 // UI shown for this match. If this match represents a selected keyword, i.e. | 197 // UI shown for this match. If this match represents a selected keyword, i.e. |
194 // the UI should be "in keyword mode", |keyword| will be set to the keyword | 198 // the UI should be "in keyword mode", |keyword| will be set to the keyword |
195 // and |is_keyword_hint| will be set to false. If this match has a non-NULL | 199 // and |is_keyword_hint| will be set to false. If this match has a non-NULL |
196 // |associated_keyword|, i.e. we should show a "Press [tab] to search ___" | 200 // |associated_keyword|, i.e. we should show a "Press [tab] to search ___" |
197 // hint and allow the user to toggle into keyword mode, |keyword| will be set | 201 // hint and allow the user to toggle into keyword mode, |keyword| will be set |
198 // to the associated keyword and |is_keyword_hint| will be set to true. Note | 202 // to the associated keyword and |is_keyword_hint| will be set to true. Note |
199 // that only one of these states can be in effect at once. In all other | 203 // that only one of these states can be in effect at once. In all other |
200 // cases, |keyword| will be cleared, even when our member variable |keyword| | 204 // cases, |keyword| will be cleared, even when our member variable |keyword| |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
332 const string16& text, | 336 const string16& text, |
333 const ACMatchClassifications& classifications) const; | 337 const ACMatchClassifications& classifications) const; |
334 #endif | 338 #endif |
335 }; | 339 }; |
336 | 340 |
337 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; | 341 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; |
338 typedef std::vector<ACMatchClassification> ACMatchClassifications; | 342 typedef std::vector<ACMatchClassification> ACMatchClassifications; |
339 typedef std::vector<AutocompleteMatch> ACMatches; | 343 typedef std::vector<AutocompleteMatch> ACMatches; |
340 | 344 |
341 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 345 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
OLD | NEW |