OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // Similar to ClassifyMatchInString(), but for cases where the range to mark | 118 // Similar to ClassifyMatchInString(), but for cases where the range to mark |
119 // as matching is already known (avoids calling find()). This can be helpful | 119 // as matching is already known (avoids calling find()). This can be helpful |
120 // when find() would be misleading (e.g. you want to mark the second match in | 120 // when find() would be misleading (e.g. you want to mark the second match in |
121 // a string instead of the first). | 121 // a string instead of the first). |
122 static void ClassifyLocationInString(size_t match_location, | 122 static void ClassifyLocationInString(size_t match_location, |
123 size_t match_length, | 123 size_t match_length, |
124 size_t overall_length, | 124 size_t overall_length, |
125 int style, | 125 int style, |
126 ACMatchClassifications* classifications); | 126 ACMatchClassifications* classifications); |
127 | 127 |
128 // The provider of this match, used to remember which provider the user had | 128 // The provider of this match, used to remember which provider the user had |
129 // selected when the input changes. This may be NULL, in which case there is | 129 // selected when the input changes. This may be NULL, in which case there is |
130 // no provider (or memory of the user's selection). | 130 // no provider (or memory of the user's selection). |
131 AutocompleteProvider* provider; | 131 AutocompleteProvider* provider; |
132 | 132 |
133 // The relevance of this match. See table above for scores returned by | 133 // The relevance of this match. See table above for scores returned by |
134 // various providers. This is used to rank matches among all responding | 134 // various providers. This is used to rank matches among all responding |
135 // providers, so different providers must be carefully tuned to supply | 135 // providers, so different providers must be carefully tuned to supply |
136 // matches with appropriate relevance. | 136 // matches with appropriate relevance. |
137 // | 137 // |
138 // If the relevance is negative, it will only be displayed if there are not | 138 // If the relevance is negative, it will only be displayed if there are not |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 void ValidateClassifications( | 199 void ValidateClassifications( |
200 const std::wstring& text, | 200 const std::wstring& text, |
201 const ACMatchClassifications& classifications) const; | 201 const ACMatchClassifications& classifications) const; |
202 #endif | 202 #endif |
203 }; | 203 }; |
204 | 204 |
205 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; | 205 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; |
206 typedef std::vector<ACMatchClassification> ACMatchClassifications; | 206 typedef std::vector<ACMatchClassification> ACMatchClassifications; |
207 | 207 |
208 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 208 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
OLD | NEW |