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 | |
169 // Copies the destination_url with "www." stripped off to | 165 // Copies the destination_url with "www." stripped off to |
170 // |stripped_destination_url| and also converts https protocol to | 166 // |stripped_destination_url| and also converts https protocol to |
171 // http. These two conversions are merely to allow comparisons to | 167 // http. These two conversions are merely to allow comparisons to |
172 // remove likely duplicates; these URLs are not used as actual | 168 // remove likely duplicates; these URLs are not used as actual |
173 // destination URLs. This method is invoked internally by the | 169 // destination URLs. This method is invoked internally by the |
174 // AutocompleteResult and does not normally need to be invoked. | 170 // AutocompleteResult and does not normally need to be invoked. |
175 // If |profile| is not NULL, it is used to get a template URL corresponding | 171 // If |profile| is not NULL, it is used to get a template URL corresponding |
176 // to this match. The template is used to strip off query args other than | 172 // to this match. The template is used to strip off query args other than |
177 // the search terms themselves that would otherwise prevent from proper | 173 // the search terms themselves that would otherwise prevent from proper |
178 // deduping. | 174 // deduping. |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 const base::string16& text, | 354 const base::string16& text, |
359 const ACMatchClassifications& classifications) const; | 355 const ACMatchClassifications& classifications) const; |
360 #endif | 356 #endif |
361 }; | 357 }; |
362 | 358 |
363 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; | 359 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; |
364 typedef std::vector<ACMatchClassification> ACMatchClassifications; | 360 typedef std::vector<ACMatchClassification> ACMatchClassifications; |
365 typedef std::vector<AutocompleteMatch> ACMatches; | 361 typedef std::vector<AutocompleteMatch> ACMatches; |
366 | 362 |
367 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 363 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
OLD | NEW |