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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 // Removes invalid characters from |text|. Should be called on strings coming | 156 // Removes invalid characters from |text|. Should be called on strings coming |
157 // from external sources (such as extensions) before assigning to |contents| | 157 // from external sources (such as extensions) before assigning to |contents| |
158 // or |description|. | 158 // or |description|. |
159 static base::string16 SanitizeString(const base::string16& text); | 159 static base::string16 SanitizeString(const base::string16& text); |
160 | 160 |
161 // Convenience function to check if |type| is a search (as opposed to a URL or | 161 // Convenience function to check if |type| is a search (as opposed to a URL or |
162 // an extension). | 162 // an extension). |
163 static bool IsSearchType(Type type); | 163 static bool IsSearchType(Type type); |
164 | 164 |
| 165 // Convenience function to check if |type| is a special search suggest type - |
| 166 // like entity, personalized, profile or postfix. |
| 167 static bool IsSpecializedSearchType(Type type); |
| 168 |
165 // Copies the destination_url with "www." stripped off to | 169 // Copies the destination_url with "www." stripped off to |
166 // |stripped_destination_url| and also converts https protocol to | 170 // |stripped_destination_url| and also converts https protocol to |
167 // http. These two conversions are merely to allow comparisons to | 171 // http. These two conversions are merely to allow comparisons to |
168 // remove likely duplicates; these URLs are not used as actual | 172 // remove likely duplicates; these URLs are not used as actual |
169 // destination URLs. This method is invoked internally by the | 173 // destination URLs. This method is invoked internally by the |
170 // AutocompleteResult and does not normally need to be invoked. | 174 // AutocompleteResult and does not normally need to be invoked. |
171 // If |profile| is not NULL, it is used to get a template URL corresponding | 175 // If |profile| is not NULL, it is used to get a template URL corresponding |
172 // to this match. The template is used to strip off query args other than | 176 // to this match. The template is used to strip off query args other than |
173 // the search terms themselves that would otherwise prevent from proper | 177 // the search terms themselves that would otherwise prevent from proper |
174 // deduping. | 178 // deduping. |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 const base::string16& text, | 358 const base::string16& text, |
355 const ACMatchClassifications& classifications) const; | 359 const ACMatchClassifications& classifications) const; |
356 #endif | 360 #endif |
357 }; | 361 }; |
358 | 362 |
359 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; | 363 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; |
360 typedef std::vector<ACMatchClassification> ACMatchClassifications; | 364 typedef std::vector<ACMatchClassification> ACMatchClassifications; |
361 typedef std::vector<AutocompleteMatch> ACMatches; | 365 typedef std::vector<AutocompleteMatch> ACMatches; |
362 | 366 |
363 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 367 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
OLD | NEW |