| 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> |
| 11 | 11 |
| 12 #include "content/common/page_transition_types.h" | 12 #include "content/public/common/page_transition_types.h" |
| 13 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
| 14 | 14 |
| 15 class AutocompleteProvider; | 15 class AutocompleteProvider; |
| 16 class PageTransition; | |
| 17 class TemplateURL; | 16 class TemplateURL; |
| 18 | 17 |
| 19 // AutocompleteMatch ---------------------------------------------------------- | 18 // AutocompleteMatch ---------------------------------------------------------- |
| 20 | 19 |
| 21 // A single result line with classified spans. The autocomplete popup displays | 20 // A single result line with classified spans. The autocomplete popup displays |
| 22 // the 'contents' and the 'description' (the description is optional) in the | 21 // the 'contents' and the 'description' (the description is optional) in the |
| 23 // autocomplete dropdown, and fills in 'fill_into_edit' into the textbox when | 22 // autocomplete dropdown, and fills in 'fill_into_edit' into the textbox when |
| 24 // that line is selected. fill_into_edit may be the same as 'description' for | 23 // that line is selected. fill_into_edit may be the same as 'description' for |
| 25 // things like URLs, but may be different for searches or other providers. For | 24 // things like URLs, but may be different for searches or other providers. For |
| 26 // example, a search result may say "Search for asdf" as the description, but | 25 // example, a search result may say "Search for asdf" as the description, but |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 string16 contents; | 160 string16 contents; |
| 162 ACMatchClassifications contents_class; | 161 ACMatchClassifications contents_class; |
| 163 | 162 |
| 164 // Additional helper text for each entry, such as a title or description. | 163 // Additional helper text for each entry, such as a title or description. |
| 165 string16 description; | 164 string16 description; |
| 166 ACMatchClassifications description_class; | 165 ACMatchClassifications description_class; |
| 167 | 166 |
| 168 // The transition type to use when the user opens this match. By default | 167 // The transition type to use when the user opens this match. By default |
| 169 // this is TYPED. Providers whose matches do not look like URLs should set | 168 // this is TYPED. Providers whose matches do not look like URLs should set |
| 170 // it to GENERATED. | 169 // it to GENERATED. |
| 171 PageTransition::Type transition; | 170 content::PageTransition transition; |
| 172 | 171 |
| 173 // True when this match is the "what you typed" match from the history | 172 // True when this match is the "what you typed" match from the history |
| 174 // system. | 173 // system. |
| 175 bool is_history_what_you_typed_match; | 174 bool is_history_what_you_typed_match; |
| 176 | 175 |
| 177 // Type of this match. | 176 // Type of this match. |
| 178 Type type; | 177 Type type; |
| 179 | 178 |
| 180 // Indicates the TemplateURL the match originated from. This is set for | 179 // Indicates the TemplateURL the match originated from. This is set for |
| 181 // keywords as well as matches for the default search provider. | 180 // keywords as well as matches for the default search provider. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 195 void ValidateClassifications( | 194 void ValidateClassifications( |
| 196 const string16& text, | 195 const string16& text, |
| 197 const ACMatchClassifications& classifications) const; | 196 const ACMatchClassifications& classifications) const; |
| 198 #endif | 197 #endif |
| 199 }; | 198 }; |
| 200 | 199 |
| 201 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; | 200 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; |
| 202 typedef std::vector<ACMatchClassification> ACMatchClassifications; | 201 typedef std::vector<ACMatchClassification> ACMatchClassifications; |
| 203 | 202 |
| 204 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 203 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
| OLD | NEW |