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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/browser/search_engines/template_url.h" |
13 #include "content/public/common/page_transition_types.h" | 14 #include "content/public/common/page_transition_types.h" |
14 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
15 | 16 |
16 class AutocompleteProvider; | 17 class AutocompleteProvider; |
17 class Profile; | 18 class Profile; |
18 class TemplateURL; | 19 class TemplateURL; |
19 | 20 |
20 // AutocompleteMatch ---------------------------------------------------------- | 21 // AutocompleteMatch ---------------------------------------------------------- |
21 | 22 |
22 // A single result line with classified spans. The autocomplete popup displays | 23 // A single result line with classified spans. The autocomplete popup displays |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 // accesses it must perform any necessary sanity checks before blindly using | 268 // accesses it must perform any necessary sanity checks before blindly using |
268 // it! | 269 // it! |
269 string16 keyword; | 270 string16 keyword; |
270 | 271 |
271 // True if the user has starred the destination URL. | 272 // True if the user has starred the destination URL. |
272 bool starred; | 273 bool starred; |
273 | 274 |
274 // True if this match is from a previous result. | 275 // True if this match is from a previous result. |
275 bool from_previous; | 276 bool from_previous; |
276 | 277 |
| 278 // Optional search terms args. If present, |
| 279 // AutocompleteController::UpdateAssistedQueryStats() will incorporate this |
| 280 // data with additional data it calculates and pass the completed struct to |
| 281 // TemplateURLRef::ReplaceSearchTerms() to reset the match's |destination_url| |
| 282 // after the complete set of matches in the AutocompleteResult has been chosen |
| 283 // and sorted. Most providers will leave this as NULL, which will cause the |
| 284 // AutocompleteController to do no additional transformations. |
| 285 scoped_ptr<TemplateURLRef::SearchTermsArgs> search_terms_args; |
| 286 |
277 #ifndef NDEBUG | 287 #ifndef NDEBUG |
278 // Does a data integrity check on this match. | 288 // Does a data integrity check on this match. |
279 void Validate() const; | 289 void Validate() const; |
280 | 290 |
281 // Checks one text/classifications pair for valid values. | 291 // Checks one text/classifications pair for valid values. |
282 void ValidateClassifications( | 292 void ValidateClassifications( |
283 const string16& text, | 293 const string16& text, |
284 const ACMatchClassifications& classifications) const; | 294 const ACMatchClassifications& classifications) const; |
285 #endif | 295 #endif |
286 }; | 296 }; |
287 | 297 |
288 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; | 298 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; |
289 typedef std::vector<ACMatchClassification> ACMatchClassifications; | 299 typedef std::vector<ACMatchClassification> ACMatchClassifications; |
290 | 300 |
291 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 301 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
OLD | NEW |