Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 // Similar to ClassifyMatchInString(), but for cases where the range to mark | 117 // Similar to ClassifyMatchInString(), but for cases where the range to mark |
| 118 // as matching is already known (avoids calling find()). This can be helpful | 118 // as matching is already known (avoids calling find()). This can be helpful |
| 119 // when find() would be misleading (e.g. you want to mark the second match in | 119 // when find() would be misleading (e.g. you want to mark the second match in |
| 120 // a string instead of the first). | 120 // a string instead of the first). |
| 121 static void ClassifyLocationInString(size_t match_location, | 121 static void ClassifyLocationInString(size_t match_location, |
| 122 size_t match_length, | 122 size_t match_length, |
| 123 size_t overall_length, | 123 size_t overall_length, |
| 124 int style, | 124 int style, |
| 125 ACMatchClassifications* classifications); | 125 ACMatchClassifications* classifications); |
| 126 | 126 |
| 127 // Removes invalid characters from |str|. Should be called on strings coming | |
| 128 // from external sources (such as extensions) before assigning to |contents|. | |
|
Peter Kasting
2011/10/25 20:37:07
Nit: ... or |description|.
Alexei Svitkine (slow)
2011/10/25 21:37:16
Done.
| |
| 129 static string16 SanitizeString(const string16& str); | |
|
Peter Kasting
2011/10/25 20:37:07
Nit: For consistency with other functions, call th
Alexei Svitkine (slow)
2011/10/25 21:37:16
Done.
| |
| 130 | |
| 127 // The provider of this match, used to remember which provider the user had | 131 // The provider of this match, used to remember which provider the user had |
| 128 // selected when the input changes. This may be NULL, in which case there is | 132 // selected when the input changes. This may be NULL, in which case there is |
| 129 // no provider (or memory of the user's selection). | 133 // no provider (or memory of the user's selection). |
| 130 AutocompleteProvider* provider; | 134 AutocompleteProvider* provider; |
| 131 | 135 |
| 132 // The relevance of this match. See table in autocomplete.h for scores | 136 // The relevance of this match. See table in autocomplete.h for scores |
| 133 // returned by various providers. This is used to rank matches among all | 137 // returned by various providers. This is used to rank matches among all |
| 134 // responding providers, so different providers must be carefully tuned to | 138 // responding providers, so different providers must be carefully tuned to |
| 135 // supply matches with appropriate relevance. | 139 // supply matches with appropriate relevance. |
| 136 // | 140 // |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 void ValidateClassifications( | 198 void ValidateClassifications( |
| 195 const string16& text, | 199 const string16& text, |
| 196 const ACMatchClassifications& classifications) const; | 200 const ACMatchClassifications& classifications) const; |
| 197 #endif | 201 #endif |
| 198 }; | 202 }; |
| 199 | 203 |
| 200 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; | 204 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; |
| 201 typedef std::vector<ACMatchClassification> ACMatchClassifications; | 205 typedef std::vector<ACMatchClassification> ACMatchClassifications; |
| 202 | 206 |
| 203 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 207 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
| OLD | NEW |