Chromium Code Reviews| Index: chrome/browser/autocomplete/autocomplete_match.h |
| diff --git a/chrome/browser/autocomplete/autocomplete_match.h b/chrome/browser/autocomplete/autocomplete_match.h |
| index fed520699e1492c1b9a657c11fe759490e93ba2f..812235b30cda0be67247133c1ee8a01b6fc6ca7f 100644 |
| --- a/chrome/browser/autocomplete/autocomplete_match.h |
| +++ b/chrome/browser/autocomplete/autocomplete_match.h |
| @@ -168,18 +168,40 @@ struct AutocompleteMatch { |
| // like entity, personalized, profile or postfix. |
| static bool IsSpecializedSearchType(Type type); |
| - // Copies the destination_url with "www." stripped off to |
| - // |stripped_destination_url| and also converts https protocol to |
| - // http. These two conversions are merely to allow comparisons to |
| - // remove likely duplicates; these URLs are not used as actual |
| - // destination URLs. This method is invoked internally by the |
| - // AutocompleteResult and does not normally need to be invoked. |
| - // If |template_url_service| is not NULL, it is used to get a template URL |
| - // corresponding to this match. The template is used to strip off query args |
| + // A static version GetTemplateURL() that takes the match's keyword and |
| + // match's hostname as parameters. In short, returns the TemplateURL |
| + // associated with |keyword| if it exists; otherwise returns the TemplateURL |
| + // associated with |host| if it exists. |
| + static TemplateURL* GetTemplateURLWithKeyword( |
| + TemplateURLService* template_url_service, |
| + const base::string16& keyword, |
| + const std::string& host); |
| + |
| + // Returns |url| altered by stripping off "www.", converting https protocol |
| + // to http, and stripping excess query parameters. These conversions are |
| + // merely to allow comparisons to remove likely duplicates; these URLs are |
| + // not used as actual destination URLs. If |template_url_service| is not |
| + // NULL, it is used to get a template URL corresponding to this match. If |
| + // the match's keyword is known, it can be passed in. Otherwise, it can be |
| + // left empty and the template URL (if any) is determined from the |
| + // destination's hostname. The template URL is used to strip off query args |
| // other than the search terms themselves that would otherwise prevent from |
|
Peter Kasting
2014/07/09 00:46:43
Nit: from -> doing
Mark P
2014/07/09 19:54:17
Done.
|
| // proper deduping. |
| + static GURL GURLToStrippedGURL(const GURL& url, |
| + TemplateURLService* template_url_service, |
| + const base::string16& keyword); |
| + |
| + // Computes the stripped destination URL (via GURLToStrippedGURL()) and |
| + // stores the result in |stripped_destination_url|. |
| void ComputeStrippedDestinationURL(TemplateURLService* template_url_service); |
| + // Sets |allowed_to_be_default_match| to true if this match is effectively |
| + // the URL-what-you-typed match (i.e., would be dupped against the UWYT |
| + // match when AutocompleteResult merges matches). |canonical_input_url| is |
| + // the AutocompleteInput interpreted as a URL (i.e., canonicalized_url()). |
|
Peter Kasting
2014/07/09 00:46:43
Nit: canonicalized_url() -> AutocompleteInput::can
Mark P
2014/07/09 19:54:17
Done.
|
| + void EnsureUWYTIsAllowedToBeDefault(const GURL& canonical_input_url, |
| + TemplateURLService* template_url_service); |
| + |
| // Gets data relevant to whether there should be any special keyword-related |
| // UI shown for this match. If this match represents a selected keyword, i.e. |
| // the UI should be "in keyword mode", |keyword| will be set to the keyword |