Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3101)

Unified Diff: chrome/browser/autocomplete/autocomplete_match.h

Issue 353223002: Omnibox: Fix URL-What-You-Typed Allowed-To-Be-Default-Match Issues (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix crashes on about: schemes Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_match.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_match.h
diff --git a/chrome/browser/autocomplete/autocomplete_match.h b/chrome/browser/autocomplete/autocomplete_match.h
index 6682af4e84159a6e8480b14e887d86686d7c68f7..cf71883490851d43de94ead4e88e9c236cc3f069 100644
--- a/chrome/browser/autocomplete/autocomplete_match.h
+++ b/chrome/browser/autocomplete/autocomplete_match.h
@@ -168,18 +168,41 @@ 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
- // other than the search terms themselves that would otherwise prevent from
+ // 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 doing
// 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.,
+ // AutocompleteInput::canonicalized_url()).
+ 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
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_match.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698