Index: chrome/browser/autocomplete/autocomplete_match.h |
=================================================================== |
--- chrome/browser/autocomplete/autocomplete_match.h (revision 81359) |
+++ chrome/browser/autocomplete/autocomplete_match.h (working copy) |
@@ -99,6 +99,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, |
@@ -123,6 +124,15 @@ |
int style, |
ACMatchClassifications* classifications); |
+ // Copies the destination_url with "www." stripped off to |
+ // |stripped_destination_url|. |
+ void ComputeStrippedDestinationURL(); |
+ |
+ bool has_keyword_hint() const { |
+ return keyword_state == DUAL_SHOWING_KEYWORD || |
Peter Kasting
2011/04/13 21:06:59
This isn't right. DUAL_SHOWING_NON_KEYWORD is the
|
+ keyword_state == DUAL_SHOWING_NON_KEYWORD; |
+ } |
+ |
// 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 +165,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; |
@@ -175,9 +188,22 @@ |
// Type of this match. |
Type type; |
+ enum KeywordState { |
Peter Kasting
2011/04/13 21:06:59
Nit: Probably want to document these.
|
+ NO_KEYWORD, |
+ KEYWORD, |
+ DUAL_SHOWING_NON_KEYWORD, |
+ DUAL_SHOWING_KEYWORD, |
+ }; |
+ |
+ KeywordState keyword_state; |
+ |
+ // Keyword for this match. |
+ string16 keyword; |
+ |
// If this match corresponds to a keyword, this is the TemplateURL the |
- // keyword was obtained from. |
- const TemplateURL* template_url; |
+ // keyword was obtained from. If this match has a keyword hint, this is |
+ // the TemplateURL for the keyword. |
+ const TemplateURL* keyword_url; |
// True if the user has starred the destination URL. |
bool starred; |