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 "content/public/common/page_transition_types.h" | 13 #include "content/public/common/page_transition_types.h" |
14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
15 | 15 |
16 class AutocompleteProvider; | 16 class AutocompleteProvider; |
17 class Profile; | 17 class Profile; |
18 class SearchTermsArgs; | |
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 |
23 // the 'contents' and the 'description' (the description is optional) in the | 24 // the 'contents' and the 'description' (the description is optional) in the |
24 // autocomplete dropdown, and fills in 'fill_into_edit' into the textbox when | 25 // autocomplete dropdown, and fills in 'fill_into_edit' into the textbox when |
25 // that line is selected. fill_into_edit may be the same as 'description' for | 26 // that line is selected. fill_into_edit may be the same as 'description' for |
26 // things like URLs, but may be different for searches or other providers. For | 27 // things like URLs, but may be different for searches or other providers. For |
27 // example, a search result may say "Search for asdf" as the description, but | 28 // example, a search result may say "Search for asdf" as the description, but |
(...skipping 239 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 arguments used to initialize destination_url above. | |
Peter Kasting
2012/06/16 03:14:17
Nit: How about:
"Optional search terms args. If
Bart N
2012/06/16 23:38:10
Done.
| |
279 // If present, it will be passed to TemplateURL::ReplaceSearchTerms, otherwise | |
280 // the destination URL won't be set. | |
281 // | |
282 // Note: The contents of this structure gets initialized at different | |
283 // processing stages. For instance, the original query (input) and search | |
284 // terms are set by the SearchProvider, but the remaining fields, | |
285 // e.g. assisted_query_stats, are set later on by the AutocompleteController. | |
286 scoped_ptr<SearchTermsArgs> search_terms_args; | |
287 | |
277 #ifndef NDEBUG | 288 #ifndef NDEBUG |
278 // Does a data integrity check on this match. | 289 // Does a data integrity check on this match. |
279 void Validate() const; | 290 void Validate() const; |
280 | 291 |
281 // Checks one text/classifications pair for valid values. | 292 // Checks one text/classifications pair for valid values. |
282 void ValidateClassifications( | 293 void ValidateClassifications( |
283 const string16& text, | 294 const string16& text, |
284 const ACMatchClassifications& classifications) const; | 295 const ACMatchClassifications& classifications) const; |
285 #endif | 296 #endif |
286 }; | 297 }; |
287 | 298 |
288 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; | 299 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; |
289 typedef std::vector<ACMatchClassification> ACMatchClassifications; | 300 typedef std::vector<ACMatchClassification> ACMatchClassifications; |
290 | 301 |
291 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 302 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
OLD | NEW |