Chromium Code Reviews| Index: chrome/browser/autocomplete/autocomplete_match.h |
| =================================================================== |
| --- chrome/browser/autocomplete/autocomplete_match.h (revision 94623) |
| +++ chrome/browser/autocomplete/autocomplete_match.h (working copy) |
| @@ -9,6 +9,7 @@ |
| #include <vector> |
| #include <string> |
| +#include "base/memory/scoped_ptr.h" |
| #include "content/common/page_transition_types.h" |
| #include "googleurl/src/gurl.h" |
| @@ -87,8 +88,11 @@ |
| int relevance, |
| bool deletable, |
| Type type); |
| + AutocompleteMatch(const AutocompleteMatch& match); |
| ~AutocompleteMatch(); |
| + AutocompleteMatch& operator=(const AutocompleteMatch& match); |
| + |
| // Converts |type| to a string representation. Used in logging. |
| static std::string TypeToString(Type type); |
| @@ -101,6 +105,7 @@ |
| const AutocompleteMatch& elem2); |
| // Comparison functions for removing matches with duplicate destinations. |
| + // Destinations are compared using |stripped_destination_url|. |
| static bool DestinationSortFunc(const AutocompleteMatch& elem1, |
| const AutocompleteMatch& elem2); |
| static bool DestinationsEqual(const AutocompleteMatch& elem1, |
| @@ -125,6 +130,10 @@ |
| int style, |
| ACMatchClassifications* classifications); |
| + // Copies the destination_url with "www." stripped off to |
| + // |stripped_destination_url|. |
| + void ComputeStrippedDestinationURL(); |
| + |
| // The provider of this match, used to remember which provider the user had |
| // selected when the input changes. This may be NULL, in which case there is |
| // no provider (or memory of the user's selection). |
| @@ -157,6 +166,9 @@ |
| // It may be empty if there is no possible navigation. |
| GURL destination_url; |
| + // The destination URL with "www." stripped off for better dupe finding. |
| + GURL stripped_destination_url; |
| + |
| // The main text displayed in the address bar dropdown. |
| string16 contents; |
| ACMatchClassifications contents_class; |
| @@ -177,6 +189,15 @@ |
| // Type of this match. |
| Type type; |
| + // Set with a keyword provider match if this match can show a keyword hint. |
| + // For example, if this is a SearchProvider match for "ama", |
| + // |associated_keyword| could be a KeywordProvider match for "amazon.com". |
|
Peter Kasting
2011/07/29 21:08:44
This comment isn't right, is it? If the match wer
|
| + scoped_ptr<AutocompleteMatch> associated_keyword; |
| + |
| + // If this is a keyword match from the keyword provider, |
| + // |keyword| is the keyword text. |
|
Peter Kasting
2011/07/29 21:08:44
I'm not sure this is right either. Isn't |keyword
aaron.randolph
2011/07/30 01:59:16
How about "If this is a keyword search match, |key
|
| + string16 keyword; |
| + |
| // Indicates the TemplateURL the match originated from. This is set for |
| // keywords as well as matches for the default search provider. |
| const TemplateURL* template_url; |