Chromium Code Reviews| Index: chrome/browser/autocomplete/autocomplete_match.h |
| =================================================================== |
| --- chrome/browser/autocomplete/autocomplete_match.h (revision 80868) |
| +++ chrome/browser/autocomplete/autocomplete_match.h (working copy) |
| @@ -9,6 +9,8 @@ |
| #include <vector> |
| #include <string> |
| +#include "base/memory/ref_counted.h" |
| +#include "chrome/browser/profiles/profile.h" |
| #include "content/common/page_transition_types.h" |
| #include "googleurl/src/gurl.h" |
| @@ -63,6 +65,24 @@ |
| typedef std::vector<ACMatchClassification> ACMatchClassifications; |
| + struct Keyword : public base::RefCounted<Keyword> { |
| + Keyword(const string16& keyword_text, bool keyword_hint, bool keyword_mode) |
| + : text(keyword_text), is_keyword_hint(keyword_hint), |
| + is_keyword_mode(keyword_mode) { |
| + } |
| + |
| + string16 text; |
| + |
| + const TemplateURL* template_url; |
| + |
| + // True if this match should show a keyword hint. |
| + bool is_keyword_hint; |
| + |
| + // True if the keyword has been accepted or if the default |
| + // is to show keyword mode. |
| + bool is_keyword_mode; |
| + }; |
| + |
| // The type of this match. |
| enum Type { |
| URL_WHAT_YOU_TYPED = 0, // The input as a URL. |
| @@ -123,6 +143,10 @@ |
| int style, |
| ACMatchClassifications* classifications); |
| + // Copies the destination_url with "www." stripped off to |
| + // stripped_destination_url |
|
Peter Kasting
2011/04/11 23:17:33
Nit: Add trailing period. I suggest using || arou
|
| + 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). |
| @@ -155,6 +179,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; |
| @@ -179,6 +206,9 @@ |
| // keyword was obtained from. |
| const TemplateURL* template_url; |
| + // Keyword for this match. |
| + scoped_refptr<Keyword> keyword; |
| + |
| // True if the user has starred the destination URL. |
| bool starred; |