 Chromium Code Reviews
 Chromium Code Reviews Issue 1215233003:
  Reland - Omnibox - Mark As Duplicates URLs that only differ by a trailing slash  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1215233003:
  Reland - Omnibox - Mark As Duplicates URLs that only differ by a trailing slash  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: components/omnibox/autocomplete_match.h | 
| diff --git a/components/omnibox/autocomplete_match.h b/components/omnibox/autocomplete_match.h | 
| index fc460dcfd37e5ad3eba49a44048b2854ce704d3f..cef04cc4c90ae236537a0b4857559bb2dc40bf81 100644 | 
| --- a/components/omnibox/autocomplete_match.h | 
| +++ b/components/omnibox/autocomplete_match.h | 
| @@ -179,15 +179,15 @@ struct AutocompleteMatch { | 
| 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. | 
| + // to http, normalizing trailing slashes, 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); | 
| @@ -272,6 +272,20 @@ struct AutocompleteMatch { | 
| // it is true. | 
| void PossiblySwapContentsAndDescriptionForDisplay(); | 
| + // If |inline_autocompletion| is "/", clears the inline autocompletion. | 
| + // Inline autocompletions of "/" have extremely limited utility because | 
| + // the omnibox treats two URLs that only differ by whether they end in a | 
| + // slash as duplicates. This means that one can type one of those URLs | 
| + // and hit enter and end up navigating to the other depending on which | 
| + // URL suggestion scores better. Displaying an inline autocompletion | 
| + // of a slash isn't very useful in this context and can cause issues if the | 
| 
Peter Kasting
2015/07/01 22:01:36
I would stop after "isn't very useful in this cont
 | 
| + // user made a typo and wants to backspace. With an inline autocompletion | 
| + // of a slash, the user first has to delete the completion and then delete | 
| + // the typed text to correct it, taking longer than if the completion was | 
| + // not there. Hence, it's not worth displaying the inline autocompletion | 
| + // in this context. Intended to be used for URL suggestions. | 
| + void StripLoneSlashOnInlineAutocompletion(); | 
| 
Mark P
2015/06/30 23:47:30
I know this function is trivial and could be inlin
 | 
| + | 
| // 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). | 
| @@ -320,7 +334,7 @@ struct AutocompleteMatch { | 
| // It may be empty if there is no possible navigation. | 
| GURL destination_url; | 
| - // The destination URL with "www." stripped off for better dupe finding. | 
| + // The destination URL, somewhat normalized for better dupe finding. | 
| GURL stripped_destination_url; | 
| // The main text displayed in the address bar dropdown. |