| Index: components/omnibox/browser/autocomplete_match.cc
|
| diff --git a/components/omnibox/browser/autocomplete_match.cc b/components/omnibox/browser/autocomplete_match.cc
|
| index dd0eaf01265b6dce6010bbc47f060bcefefea2a8..31047eec36686a215a8aceefb743dc7a888cc3b0 100644
|
| --- a/components/omnibox/browser/autocomplete_match.cc
|
| +++ b/components/omnibox/browser/autocomplete_match.cc
|
| @@ -526,29 +526,17 @@ base::string16 AutocompleteMatch::FormatUrlForSuggestionDisplayWithAdjustments(
|
| const GURL& url,
|
| bool trim_scheme,
|
| base::OffsetAdjuster::Adjustments* adjustments) {
|
| - const url_formatter::FormatUrlTypes format_types =
|
| - url_formatter::kFormatUrlOmitAll &
|
| - ~(trim_scheme ? 0 : url_formatter::kFormatUrlOmitHTTP);
|
| - base::string16 result = url_formatter::FormatUrlWithAdjustments(
|
| - url, format_types, net::UnescapeRule::SPACES, nullptr, nullptr,
|
| - adjustments);
|
| -
|
| - // Also trim HTTPS if experiment is enabled. Note this intentionally has
|
| - // no effect on view-source URLs.
|
| - if (trim_scheme && base::FeatureList::IsEnabled(
|
| - omnibox::kUIExperimentHideSuggestionUrlScheme)) {
|
| - // TODO(tommycli): If this becomes enabled by default, investigate
|
| - // folding this logic into url_formatter::FormatUrlWithAdjustments.
|
| - if (url.SchemeIs(url::kHttpsScheme)) {
|
| - const size_t kHTTPSSize =
|
| - strlen(url::kHttpsScheme) + strlen(url::kStandardSchemeSeparator);
|
| - result = result.substr(kHTTPSSize);
|
| - adjustments->insert(adjustments->begin(),
|
| - base::OffsetAdjuster::Adjustment(0, kHTTPSSize, 0));
|
| - }
|
| + auto format_types = url_formatter::kFormatUrlOmitAll;
|
| + if (!trim_scheme) {
|
| + format_types &= ~url_formatter::kFormatUrlOmitHTTP;
|
| + } else if (base::FeatureList::IsEnabled(
|
| + omnibox::kUIExperimentHideSuggestionUrlScheme)) {
|
| + format_types |= url_formatter::kFormatUrlExperimentalOmitHTTPS;
|
| }
|
|
|
| - return result;
|
| + return url_formatter::FormatUrlWithAdjustments(url, format_types,
|
| + net::UnescapeRule::SPACES,
|
| + nullptr, nullptr, adjustments);
|
| }
|
|
|
| void AutocompleteMatch::ComputeStrippedDestinationURL(
|
|
|