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

Unified Diff: components/omnibox/browser/clipboard_url_provider.cc

Issue 2963883002: Omnibox UI Experiments: Refactor HTTPS trimming into UrlFormatter. (Closed)
Patch Set: update comment Created 3 years, 6 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
Index: components/omnibox/browser/clipboard_url_provider.cc
diff --git a/components/omnibox/browser/clipboard_url_provider.cc b/components/omnibox/browser/clipboard_url_provider.cc
index b3729328beefb959f6f9bf45f34d439effcd0d76..273b3f0856308e5076cf1babf720192c29d2bf25 100644
--- a/components/omnibox/browser/clipboard_url_provider.cc
+++ b/components/omnibox/browser/clipboard_url_provider.cc
@@ -86,8 +86,10 @@ void ClipboardURLProvider::Start(const AutocompleteInput& input,
// Add the clipboard match. The relevance is 800 to beat ZeroSuggest results.
AutocompleteMatch match(this, 800, false, AutocompleteMatchType::CLIPBOARD);
match.destination_url = url;
- match.contents.assign(AutocompleteMatch::FormatUrlForSuggestionDisplay(
- url, true /* trim_scheme */, nullptr));
+ auto format_types =
+ AutocompleteMatch::GetFormatForSuggestionDisplay(true /* trim_scheme*/);
+ match.contents.assign(url_formatter::FormatUrl(
+ url, format_types, net::UnescapeRule::SPACES, nullptr, nullptr, nullptr));
AutocompleteMatch::ClassifyLocationInString(
base::string16::npos, 0, match.contents.length(),
ACMatchClassification::URL, &match.contents_class);

Powered by Google App Engine
This is Rietveld 408576698