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

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

Issue 2940973002: Omnibox UI Experiments: Implement scheme-trimming for suggested URLs. (Closed)
Patch Set: fix 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/titled_url_match_utils.cc
diff --git a/components/omnibox/browser/titled_url_match_utils.cc b/components/omnibox/browser/titled_url_match_utils.cc
index f60d0d5aa075265e716ed903e3769204963736f1..1b3ac7b7ca011cc851e8f3cf25685f796e3f6cd4 100644
--- a/components/omnibox/browser/titled_url_match_utils.cc
+++ b/components/omnibox/browser/titled_url_match_utils.cc
@@ -85,10 +85,11 @@ AutocompleteMatch TitledUrlMatchToAutocompleteMatch(
// |offsets|, compute how everything is transformed, then remove it from the
// end.
offsets.push_back(inline_autocomplete_offset);
- match.contents = url_formatter::FormatUrlWithOffsets(
- url, url_formatter::kFormatUrlOmitAll &
- ~(trim_http ? 0 : url_formatter::kFormatUrlOmitHTTP),
- net::UnescapeRule::SPACES, nullptr, nullptr, &offsets);
+ base::OffsetAdjuster::Adjustments adjustments;
+ match.contents =
+ AutocompleteMatch::FormatUrlForSuggestionDisplayWithAdjustments(
Justin Donnelly 2017/06/20 17:31:02 If it's worth having a convenience version of this
tommycli 2017/06/20 22:51:21 Done. Hmm... well after this there's now some non-
+ url, trim_http, &adjustments);
+ base::OffsetAdjuster::AdjustOffsets(adjustments, &offsets);
inline_autocomplete_offset = offsets.back();
offsets.pop_back();
TitledUrlMatch::MatchPositions new_url_match_positions =

Powered by Google App Engine
This is Rietveld 408576698