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(); |
+ |
// 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,14 @@ |
// 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; |
+ |
+ // If this is a keyword search match, |keyword| is the keyword text. |
Peter Kasting
2011/08/04 20:07:53
Nit: Maybe the explicit "If this match is a keywor
aaron.randolph
2011/08/04 21:02:50
I don't think that would be accurate because if th
Peter Kasting
2011/08/04 21:31:42
That was what I was asking in my patch set 7 comme
aaron.randolph
2011/08/04 22:32:25
In the places where |keyword| is used, we don't kn
Peter Kasting
2011/08/04 23:13:16
It sounds like this member deserves a block commen
|
+ 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; |