Index: chrome/browser/autocomplete/autocomplete_match.h |
=================================================================== |
--- chrome/browser/autocomplete/autocomplete_match.h (revision 95169) |
+++ 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(); |
sky
2011/08/09 00:32:51
nit: Can you mention this is invoked internally an
|
+ |
// 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,22 @@ |
// 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 "www.amazon.com", |
+ // |associated_keyword| could be a KeywordProvider match for "amazon.com". |
+ scoped_ptr<AutocompleteMatch> associated_keyword; |
+ |
+ // For matches that correspond to valid substituting keywords ("search |
+ // engines" that aren't the default engine, or extension keywords), this |
+ // is the keyword. If this is set, then when displaying this match, the |
+ // edit will use the "keyword mode" UI that shows a blue |
+ // "Search <engine name>" chit before the user's typing. This should be |
+ // set for any match that's an |associated_keyword| of a match in the main |
+ // result list, as well as any other matches in the main result list that |
+ // are direct keyword matches (e.g. if the user types in a keyword name and |
+ // some search terms directly). |
+ string16 keyword; |
sky
2011/08/09 00:32:51
Since the matches you care about have TemplateURL
aaron.randolph
2011/08/16 17:52:43
The issue with |template_url| is it is only set on
|
+ |
// 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; |