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 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 // This string is loaded into the location bar when the item is selected | 240 // This string is loaded into the location bar when the item is selected |
241 // by pressing the arrow keys. This may be different than a URL, for example, | 241 // by pressing the arrow keys. This may be different than a URL, for example, |
242 // for search suggestions, this would just be the search terms. | 242 // for search suggestions, this would just be the search terms. |
243 string16 fill_into_edit; | 243 string16 fill_into_edit; |
244 | 244 |
245 // The position within fill_into_edit from which we'll display the inline | 245 // The position within fill_into_edit from which we'll display the inline |
246 // autocomplete string. This will be string16::npos if this match should | 246 // autocomplete string. This will be string16::npos if this match should |
247 // not be inline autocompleted. | 247 // not be inline autocompleted. |
248 size_t inline_autocomplete_offset; | 248 size_t inline_autocomplete_offset; |
249 | 249 |
250 // The completion suggested by instant, displayed in gray text besides | |
251 // |fill_into_edit|. | |
252 string16 gray_suggestion; | |
Peter Kasting
2013/06/11 22:42:55
It doesn't seem right to put this on AutocompleteM
beaudoin
2013/06/14 21:39:38
I agree. For now I will just keep that gray text i
| |
253 | |
250 // The URL to actually load when the autocomplete item is selected. This URL | 254 // The URL to actually load when the autocomplete item is selected. This URL |
251 // should be canonical so we can compare URLs with strcmp to avoid dupes. | 255 // should be canonical so we can compare URLs with strcmp to avoid dupes. |
252 // It may be empty if there is no possible navigation. | 256 // It may be empty if there is no possible navigation. |
253 GURL destination_url; | 257 GURL destination_url; |
254 | 258 |
255 // The destination URL with "www." stripped off for better dupe finding. | 259 // The destination URL with "www." stripped off for better dupe finding. |
256 GURL stripped_destination_url; | 260 GURL stripped_destination_url; |
257 | 261 |
258 // The main text displayed in the address bar dropdown. | 262 // The main text displayed in the address bar dropdown. |
259 string16 contents; | 263 string16 contents; |
(...skipping 17 matching lines...) Expand all Loading... | |
277 | 281 |
278 // Set with a keyword provider match if this match can show a keyword hint. | 282 // Set with a keyword provider match if this match can show a keyword hint. |
279 // For example, if this is a SearchProvider match for "www.amazon.com", | 283 // For example, if this is a SearchProvider match for "www.amazon.com", |
280 // |associated_keyword| could be a KeywordProvider match for "amazon.com". | 284 // |associated_keyword| could be a KeywordProvider match for "amazon.com". |
281 scoped_ptr<AutocompleteMatch> associated_keyword; | 285 scoped_ptr<AutocompleteMatch> associated_keyword; |
282 | 286 |
283 // The keyword of the TemplateURL the match originated from. This is nonempty | 287 // The keyword of the TemplateURL the match originated from. This is nonempty |
284 // for both explicit "keyword mode" matches as well as matches for the default | 288 // for both explicit "keyword mode" matches as well as matches for the default |
285 // search provider (so, any match for which we're doing substitution); it | 289 // search provider (so, any match for which we're doing substitution); it |
286 // doesn't imply (alone) that the UI is going to show a keyword hint or | 290 // doesn't imply (alone) that the UI is going to show a keyword hint or |
287 // keyword mode. For that, see GetKeywordUIState() or | 291 // keyword mode. For that, see GetSubstitutingExplicitlyInvokedKeyword(). |
288 // GetSubstitutingExplicitlyInvokedKeyword(). | |
289 // | 292 // |
290 // CAUTION: The TemplateURL associated with this keyword may be deleted or | 293 // CAUTION: The TemplateURL associated with this keyword may be deleted or |
291 // modified while the AutocompleteMatch is alive. This means anyone who | 294 // modified while the AutocompleteMatch is alive. This means anyone who |
292 // accesses it must perform any necessary sanity checks before blindly using | 295 // accesses it must perform any necessary sanity checks before blindly using |
293 // it! | 296 // it! |
294 string16 keyword; | 297 string16 keyword; |
295 | 298 |
296 // True if the user has starred the destination URL. | 299 // True if the user has starred the destination URL. |
297 bool starred; | 300 bool starred; |
298 | 301 |
(...skipping 22 matching lines...) Expand all Loading... | |
321 const string16& text, | 324 const string16& text, |
322 const ACMatchClassifications& classifications) const; | 325 const ACMatchClassifications& classifications) const; |
323 #endif | 326 #endif |
324 }; | 327 }; |
325 | 328 |
326 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; | 329 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; |
327 typedef std::vector<ACMatchClassification> ACMatchClassifications; | 330 typedef std::vector<ACMatchClassification> ACMatchClassifications; |
328 typedef std::vector<AutocompleteMatch> ACMatches; | 331 typedef std::vector<AutocompleteMatch> ACMatches; |
329 | 332 |
330 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 333 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
OLD | NEW |