Chromium Code Reviews| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 70 HISTORY_TITLE, // A past page whose title contains the input. | 70 HISTORY_TITLE, // A past page whose title contains the input. |
| 71 HISTORY_BODY, // A past page whose body contains the input. | 71 HISTORY_BODY, // A past page whose body contains the input. |
| 72 HISTORY_KEYWORD, // A past page whose keyword contains the input. | 72 HISTORY_KEYWORD, // A past page whose keyword contains the input. |
| 73 NAVSUGGEST, // A suggested URL. | 73 NAVSUGGEST, // A suggested URL. |
| 74 SEARCH_WHAT_YOU_TYPED, // The input as a search query (with the default | 74 SEARCH_WHAT_YOU_TYPED, // The input as a search query (with the default |
| 75 // engine). | 75 // engine). |
| 76 SEARCH_HISTORY, // A past search (with the default engine) | 76 SEARCH_HISTORY, // A past search (with the default engine) |
| 77 // containing the input. | 77 // containing the input. |
| 78 SEARCH_SUGGEST, // A suggested search (with the default engine). | 78 SEARCH_SUGGEST, // A suggested search (with the default engine). |
| 79 SEARCH_OTHER_ENGINE, // A search with a non-default engine. | 79 SEARCH_OTHER_ENGINE, // A search with a non-default engine. |
| 80 OPEN_HISTORY_PAGE, // A synthetic result that opens the history page | |
| 81 // to search for the input. | |
| 82 NUM_TYPES, | 80 NUM_TYPES, |
| 83 }; | 81 }; |
| 84 | 82 |
| 85 AutocompleteMatch(); | 83 AutocompleteMatch(); |
| 86 AutocompleteMatch(AutocompleteProvider* provider, | 84 AutocompleteMatch(AutocompleteProvider* provider, |
| 87 int relevance, | 85 int relevance, |
| 88 bool deletable, | 86 bool deletable, |
| 89 Type type); | 87 Type type); |
| 90 ~AutocompleteMatch(); | 88 ~AutocompleteMatch(); |
| 91 | 89 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 // The provider of this match, used to remember which provider the user had | 126 // 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 | 127 // selected when the input changes. This may be NULL, in which case there is |
| 130 // no provider (or memory of the user's selection). | 128 // no provider (or memory of the user's selection). |
| 131 AutocompleteProvider* provider; | 129 AutocompleteProvider* provider; |
| 132 | 130 |
| 133 // The relevance of this match. See table above for scores returned by | 131 // The relevance of this match. See table above for scores returned by |
| 134 // various providers. This is used to rank matches among all responding | 132 // various providers. This is used to rank matches among all responding |
| 135 // providers, so different providers must be carefully tuned to supply | 133 // providers, so different providers must be carefully tuned to supply |
| 136 // matches with appropriate relevance. | 134 // matches with appropriate relevance. |
| 137 // | 135 // |
| 138 // If the relevance is negative, it will only be displayed if there are not | 136 // If the relevance is negative, it will only be displayed if there are not |
|
Peter Kasting
2011/01/19 20:02:36
Nit: This paragraph can go away?
| |
| 139 // enough non-negative items in all the providers to max out the popup. In | 137 // enough non-negative items in all the providers to max out the popup. In |
| 140 // this case, the relevance of the additional items will be inverted so they | 138 // this case, the relevance of the additional items will be inverted so they |
| 141 // can be mixed in with the rest of the relevances. This allows a provider | 139 // can be mixed in with the rest of the relevances. This allows a provider |
| 142 // to group its matches, having the added items appear intermixed with its | 140 // to group its matches, having the added items appear intermixed with its |
| 143 // other matches. | 141 // other matches. |
| 144 // | 142 // |
| 145 // TODO(pkasting): http://b/1111299 This should be calculated algorithmically, | 143 // TODO(pkasting): http://b/1111299 This should be calculated algorithmically, |
| 146 // rather than being a fairly fixed value defined by the table above. | 144 // rather than being a fairly fixed value defined by the table above. |
| 147 int relevance; | 145 int relevance; |
| 148 | 146 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 void ValidateClassifications( | 197 void ValidateClassifications( |
| 200 const std::wstring& text, | 198 const std::wstring& text, |
| 201 const ACMatchClassifications& classifications) const; | 199 const ACMatchClassifications& classifications) const; |
| 202 #endif | 200 #endif |
| 203 }; | 201 }; |
| 204 | 202 |
| 205 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; | 203 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; |
| 206 typedef std::vector<ACMatchClassification> ACMatchClassifications; | 204 typedef std::vector<ACMatchClassification> ACMatchClassifications; |
| 207 | 205 |
| 208 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 206 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
| OLD | NEW |