From 90437dd218ba09f01612ebfc47eda167d67fb368 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 4 Aug 2015 00:05:17 -0700 Subject: Revert of Move net::FormatUrl and friends outside of //net and into //components (patchset #16 id:290001 of https://codereview.chromium.org/1171333003/ ) Reason for revert: breaks gn_check on Android: https://build.chromium.org/p/chromium.linux/builders/Android%20GN/builds/28796/steps/gn_check/logs/stdio Original issue's description: > Move net::FormatUrl and friends outside of //net and into //components > > net::FormatUrl and related are specifically concerned with display > policies of URLs, which is not something that //net needs to be aware > of, as that's a UX question. > > This folds in net::FormatURL along with the existing //components/url_fixer > and //components/secure_display into a common component, > //components/url_formatter, that handles reformatting URLs for user-friendly > or data storage (url_formatter), for use in security prompts (elide_url), > or for reformatting URLs from user input (url_fixer) > > (Disabling presubmit since this is intentionally not fixing a legacy API, just moving it for future cleanups) > > BUG=486979 > NOPRESUBMIT=true > > Committed: https://crrev.com/1659865c3eb47166c82378bb840801135b057a09 > Cr-Commit-Position: refs/heads/master@{#341605} TBR=droger@chromium.org,jam@chromium.org,mkwst@chromium.org,pkasting@chromium.org,sky@chromium.org,stuartmorgan@chromium.org,felt@chromium.org,rsleevi@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=486979 Review URL: https://codereview.chromium.org/1260033005 Cr-Commit-Position: refs/heads/master@{#341691} --- components/omnibox/browser/BUILD.gn | 2 +- components/omnibox/browser/DEPS | 2 +- components/omnibox/browser/autocomplete_input.cc | 11 ++++--- components/omnibox/browser/autocomplete_match.cc | 8 ++--- .../omnibox/browser/autocomplete_provider.cc | 4 +-- components/omnibox/browser/autocomplete_result.cc | 4 +-- components/omnibox/browser/bookmark_provider.cc | 9 +++--- components/omnibox/browser/builtin_provider.cc | 4 +-- .../omnibox/browser/history_quick_provider.cc | 19 ++++++------ components/omnibox/browser/history_url_provider.cc | 34 ++++++++++----------- components/omnibox/browser/search_provider.cc | 13 ++++---- .../omnibox/browser/search_suggestion_parser.cc | 35 ++++++++-------------- components/omnibox/browser/shortcuts_provider.cc | 2 +- .../omnibox/browser/url_index_private_data.cc | 9 +++--- .../omnibox/browser/zero_suggest_provider.cc | 7 ++--- 15 files changed, 72 insertions(+), 91 deletions(-) (limited to 'components/omnibox') diff --git a/components/omnibox/browser/BUILD.gn b/components/omnibox/browser/BUILD.gn index 8217c11..cc2fc78 100644 --- a/components/omnibox/browser/BUILD.gn +++ b/components/omnibox/browser/BUILD.gn @@ -98,7 +98,7 @@ source_set("browser") { "//components/search_engines", "//components/sessions", "//components/strings", - "//components/url_formatter", + "//components/url_fixer", "//components/variations", "//components/variations/net", "//net", diff --git a/components/omnibox/browser/DEPS b/components/omnibox/browser/DEPS index 646d9c3..e915c67 100644 --- a/components/omnibox/browser/DEPS +++ b/components/omnibox/browser/DEPS @@ -8,7 +8,7 @@ include_rules = [ "+components/search", "+components/search_engines", "+components/sessions", - "+components/url_formatter", + "+components/url_fixer", "+components/variations", "+grit", "+net", diff --git a/components/omnibox/browser/autocomplete_input.cc b/components/omnibox/browser/autocomplete_input.cc index d5e10f5b..c8b744a 100644 --- a/components/omnibox/browser/autocomplete_input.cc +++ b/components/omnibox/browser/autocomplete_input.cc @@ -10,8 +10,7 @@ #include "components/metrics/proto/omnibox_event.pb.h" #include "components/omnibox/browser/autocomplete_scheme_classifier.h" #include "components/omnibox/browser/omnibox_field_trial.h" -#include "components/url_formatter/url_fixer.h" -#include "components/url_formatter/url_formatter.h" +#include "components/url_fixer/url_fixer.h" #include "net/base/net_util.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "url/url_canon_ip.h" @@ -189,7 +188,7 @@ metrics::OmniboxInputType::Type AutocompleteInput::Parse( url::Parsed local_parts; if (!parts) parts = &local_parts; - const base::string16 parsed_scheme(url_formatter::SegmentURL(text, parts)); + const base::string16 parsed_scheme(url_fixer::SegmentURL(text, parts)); if (scheme) *scheme = parsed_scheme; const std::string parsed_scheme_utf8(base::UTF16ToUTF8(parsed_scheme)); @@ -201,7 +200,7 @@ metrics::OmniboxInputType::Type AutocompleteInput::Parse( if (!canonicalized_url) canonicalized_url = &placeholder_canonicalized_url; *canonicalized_url = - url_formatter::FixupURL(base::UTF16ToUTF8(text), desired_tld); + url_fixer::FixupURL(base::UTF16ToUTF8(text), desired_tld); if (!canonicalized_url->is_valid()) return metrics::OmniboxInputType::QUERY; @@ -256,7 +255,7 @@ metrics::OmniboxInputType::Type AutocompleteInput::Parse( &http_parts.ref, }; for (size_t i = 0; i < arraysize(components); ++i) { - url_formatter::OffsetComponent( + url_fixer::OffsetComponent( -static_cast(http_scheme_prefix.length()), components[i]); } @@ -505,7 +504,7 @@ base::string16 AutocompleteInput::FormattedStringWithEquivalentMeaning( const GURL& url, const base::string16& formatted_url, const AutocompleteSchemeClassifier& scheme_classifier) { - if (!url_formatter::CanStripTrailingSlash(url)) + if (!net::CanStripTrailingSlash(url)) return formatted_url; const base::string16 url_with_path(formatted_url + base::char16('/')); return (AutocompleteInput::Parse(formatted_url, std::string(), diff --git a/components/omnibox/browser/autocomplete_match.cc b/components/omnibox/browser/autocomplete_match.cc index 03dc219..77bcf25 100644 --- a/components/omnibox/browser/autocomplete_match.cc +++ b/components/omnibox/browser/autocomplete_match.cc @@ -17,8 +17,8 @@ #include "components/omnibox/browser/suggestion_answer.h" #include "components/search_engines/template_url.h" #include "components/search_engines/template_url_service.h" -#include "components/url_formatter/url_formatter.h" #include "grit/components_scaled_resources.h" +#include "net/base/net_util.h" namespace { @@ -42,9 +42,9 @@ bool WordMatchesURLContent( size_t prefix_length = url.scheme().length() + strlen(url::kStandardSchemeSeparator); DCHECK_GE(url.spec().length(), prefix_length); - const base::string16& formatted_url = url_formatter::FormatUrl( - url, languages, url_formatter::kFormatUrlOmitNothing, - net::UnescapeRule::NORMAL, nullptr, nullptr, &prefix_length); + const base::string16& formatted_url = net::FormatUrl( + url, languages, net::kFormatUrlOmitNothing, net::UnescapeRule::NORMAL, + NULL, NULL, &prefix_length); if (prefix_length == base::string16::npos) return false; const base::string16& formatted_url_without_scheme = diff --git a/components/omnibox/browser/autocomplete_provider.cc b/components/omnibox/browser/autocomplete_provider.cc index 5072af2..7c43ab4 100644 --- a/components/omnibox/browser/autocomplete_provider.cc +++ b/components/omnibox/browser/autocomplete_provider.cc @@ -8,7 +8,7 @@ #include "base/strings/utf_string_conversions.h" #include "components/omnibox/browser/autocomplete_input.h" #include "components/omnibox/browser/autocomplete_match.h" -#include "components/url_formatter/url_fixer.h" +#include "components/url_fixer/url_fixer.h" #include "net/base/net_util.h" #include "url/gurl.h" @@ -102,7 +102,7 @@ AutocompleteProvider::FixupReturn AutocompleteProvider::FixupUserInput( // Fixup and canonicalize user input. const GURL canonical_gurl( - url_formatter::FixupURL(base::UTF16ToUTF8(input_text), std::string())); + url_fixer::FixupURL(base::UTF16ToUTF8(input_text), std::string())); std::string canonical_gurl_str(canonical_gurl.possibly_invalid_spec()); if (canonical_gurl_str.empty()) { // This probably won't happen, but there are no guarantees. diff --git a/components/omnibox/browser/autocomplete_result.cc b/components/omnibox/browser/autocomplete_result.cc index f1e03a7..da7f1ca 100644 --- a/components/omnibox/browser/autocomplete_result.cc +++ b/components/omnibox/browser/autocomplete_result.cc @@ -18,7 +18,7 @@ #include "components/omnibox/browser/omnibox_field_trial.h" #include "components/omnibox/browser/omnibox_switches.h" #include "components/search/search.h" -#include "components/url_formatter/url_fixer.h" +#include "components/url_fixer/url_fixer.h" using metrics::OmniboxEventProto; @@ -250,7 +250,7 @@ void AutocompleteResult::SortAndCull( const std::string& in_scheme = base::UTF16ToUTF8(input.scheme()); const std::string& dest_scheme = default_match_->destination_url.scheme(); - DCHECK(url_formatter::IsEquivalentScheme(in_scheme, dest_scheme)) + DCHECK(url_fixer::IsEquivalentScheme(in_scheme, dest_scheme)) << debug_info; } } diff --git a/components/omnibox/browser/bookmark_provider.cc b/components/omnibox/browser/bookmark_provider.cc index fc55713..ffce9b8 100644 --- a/components/omnibox/browser/bookmark_provider.cc +++ b/components/omnibox/browser/bookmark_provider.cc @@ -18,7 +18,7 @@ #include "components/omnibox/browser/autocomplete_result.h" #include "components/omnibox/browser/history_provider.h" #include "components/omnibox/browser/url_prefix.h" -#include "components/url_formatter/url_formatter.h" +#include "net/base/net_util.h" #include "url/url_constants.h" using bookmarks::BookmarkMatch; @@ -188,10 +188,9 @@ AutocompleteMatch BookmarkProvider::BookmarkMatchToACMatch( // |offsets|, compute how everything is transformed, then remove it from the // end. offsets.push_back(inline_autocomplete_offset); - match.contents = url_formatter::FormatUrlWithOffsets( - url, languages_, url_formatter::kFormatUrlOmitAll & - ~(trim_http ? 0 : url_formatter::kFormatUrlOmitHTTP), - net::UnescapeRule::SPACES, nullptr, nullptr, &offsets); + match.contents = net::FormatUrlWithOffsets(url, languages_, + net::kFormatUrlOmitAll & ~(trim_http ? 0 : net::kFormatUrlOmitHTTP), + net::UnescapeRule::SPACES, NULL, NULL, &offsets); inline_autocomplete_offset = offsets.back(); offsets.pop_back(); BookmarkMatch::MatchPositions new_url_match_positions = diff --git a/components/omnibox/browser/builtin_provider.cc b/components/omnibox/browser/builtin_provider.cc index 6e3dde6..43e728b 100644 --- a/components/omnibox/browser/builtin_provider.cc +++ b/components/omnibox/browser/builtin_provider.cc @@ -12,7 +12,7 @@ #include "components/omnibox/browser/autocomplete_input.h" #include "components/omnibox/browser/autocomplete_provider_client.h" #include "components/omnibox/browser/history_provider.h" -#include "components/url_formatter/url_fixer.h" +#include "components/url_fixer/url_fixer.h" const int BuiltinProvider::kRelevance = 860; @@ -61,7 +61,7 @@ void BuiltinProvider::Start(const AutocompleteInput& input, AddMatch(url, base::string16(), styles); } else { // Match input about: or |embedderAbout| URL input against builtin URLs. - GURL url = url_formatter::FixupURL(base::UTF16ToUTF8(text), std::string()); + GURL url = url_fixer::FixupURL(base::UTF16ToUTF8(text), std::string()); // BuiltinProvider doesn't know how to suggest valid ?query or #fragment // extensions to builtin URLs. if (url.SchemeIs( diff --git a/components/omnibox/browser/history_quick_provider.cc b/components/omnibox/browser/history_quick_provider.cc index 32ac0e7..d2f15cf 100644 --- a/components/omnibox/browser/history_quick_provider.cc +++ b/components/omnibox/browser/history_quick_provider.cc @@ -28,8 +28,8 @@ #include "components/omnibox/browser/omnibox_field_trial.h" #include "components/search_engines/template_url.h" #include "components/search_engines/template_url_service.h" -#include "components/url_formatter/url_formatter.h" #include "net/base/escape.h" +#include "net/base/net_util.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "url/third_party/mozilla/url_parse.h" #include "url/url_util.h" @@ -221,21 +221,20 @@ AutocompleteMatch HistoryQuickProvider::QuickMatchToACMatch( DCHECK(match.destination_url.is_valid()); // Format the URL autocomplete presentation. - const url_formatter::FormatUrlTypes format_types = - url_formatter::kFormatUrlOmitAll & - ~(!history_match.match_in_scheme ? 0 : url_formatter::kFormatUrlOmitHTTP); + const net::FormatUrlTypes format_types = net::kFormatUrlOmitAll & + ~(!history_match.match_in_scheme ? 0 : net::kFormatUrlOmitHTTP); match.fill_into_edit = AutocompleteInput::FormattedStringWithEquivalentMeaning( - info.url(), url_formatter::FormatUrl( - info.url(), languages_, format_types, - net::UnescapeRule::SPACES, nullptr, nullptr, nullptr), + info.url(), + net::FormatUrl(info.url(), languages_, format_types, + net::UnescapeRule::SPACES, NULL, NULL, NULL), client()->GetSchemeClassifier()); std::vector offsets = OffsetsFromTermMatches(history_match.url_matches); base::OffsetAdjuster::Adjustments adjustments; - match.contents = url_formatter::FormatUrlWithAdjustments( - info.url(), languages_, format_types, net::UnescapeRule::SPACES, nullptr, - nullptr, &adjustments); + match.contents = net::FormatUrlWithAdjustments( + info.url(), languages_, format_types, net::UnescapeRule::SPACES, NULL, + NULL, &adjustments); base::OffsetAdjuster::AdjustOffsets(adjustments, &offsets); TermMatches new_matches = ReplaceOffsetsInTermMatches(history_match.url_matches, offsets); diff --git a/components/omnibox/browser/history_url_provider.cc b/components/omnibox/browser/history_url_provider.cc index 3ad59b5..2140fbd 100644 --- a/components/omnibox/browser/history_url_provider.cc +++ b/components/omnibox/browser/history_url_provider.cc @@ -32,8 +32,8 @@ #include "components/omnibox/browser/url_prefix.h" #include "components/search_engines/search_terms_data.h" #include "components/search_engines/template_url_service.h" -#include "components/url_formatter/url_fixer.h" -#include "components/url_formatter/url_formatter.h" +#include "components/url_fixer/url_fixer.h" +#include "net/base/net_util.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "url/gurl.h" #include "url/third_party/mozilla/url_parse.h" @@ -494,7 +494,7 @@ void HistoryURLProvider::Start(const AutocompleteInput& input, if (!fixup_return.first) return; url::Parsed parts; - url_formatter::SegmentURL(fixup_return.second, &parts); + url_fixer::SegmentURL(fixup_return.second, &parts); AutocompleteInput fixed_up_input(input); fixed_up_input.UpdateText(fixup_return.second, base::string16::npos, parts); @@ -590,10 +590,10 @@ AutocompleteMatch HistoryURLProvider::SuggestExactInput( // Trim off "http://" if the user didn't type it. DCHECK(!trim_http || !AutocompleteInput::HasHTTPScheme(input.text())); - base::string16 display_string(url_formatter::FormatUrl( - destination_url, std::string(), - url_formatter::kFormatUrlOmitAll & ~url_formatter::kFormatUrlOmitHTTP, - net::UnescapeRule::SPACES, nullptr, nullptr, nullptr)); + base::string16 display_string( + net::FormatUrl(destination_url, std::string(), + net::kFormatUrlOmitAll & ~net::kFormatUrlOmitHTTP, + net::UnescapeRule::SPACES, NULL, NULL, NULL)); const size_t offset = trim_http ? TrimHttpPrefix(&display_string) : 0; match.fill_into_edit = AutocompleteInput::FormattedStringWithEquivalentMeaning( @@ -1160,17 +1160,14 @@ AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch( history_match.input_location + params.input.text().length(); std::string languages = (match_type == WHAT_YOU_TYPED) ? std::string() : params.languages; - const url_formatter::FormatUrlTypes format_types = - url_formatter::kFormatUrlOmitAll & - ~((params.trim_http && !history_match.match_in_scheme) - ? 0 - : url_formatter::kFormatUrlOmitHTTP); + const net::FormatUrlTypes format_types = net::kFormatUrlOmitAll & + ~((params.trim_http && !history_match.match_in_scheme) ? + 0 : net::kFormatUrlOmitHTTP); match.fill_into_edit = AutocompleteInput::FormattedStringWithEquivalentMeaning( - info.url(), - url_formatter::FormatUrl(info.url(), languages, format_types, - net::UnescapeRule::SPACES, nullptr, nullptr, - &inline_autocomplete_offset), + info.url(), net::FormatUrl(info.url(), languages, format_types, + net::UnescapeRule::SPACES, NULL, NULL, + &inline_autocomplete_offset), client()->GetSchemeClassifier()); if (!params.prevent_inline_autocomplete && (inline_autocomplete_offset != base::string16::npos)) { @@ -1185,9 +1182,8 @@ AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch( (inline_autocomplete_offset >= match.fill_into_edit.length())); size_t match_start = history_match.input_location; - match.contents = url_formatter::FormatUrl(info.url(), languages, format_types, - net::UnescapeRule::SPACES, nullptr, - nullptr, &match_start); + match.contents = net::FormatUrl(info.url(), languages, + format_types, net::UnescapeRule::SPACES, NULL, NULL, &match_start); if ((match_start != base::string16::npos) && (inline_autocomplete_offset != base::string16::npos) && (inline_autocomplete_offset != match_start)) { diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/browser/search_provider.cc index 7f4aab1..9067f859 100644 --- a/components/omnibox/browser/search_provider.cc +++ b/components/omnibox/browser/search_provider.cc @@ -31,11 +31,11 @@ #include "components/search/search.h" #include "components/search_engines/template_url_prepopulate_data.h" #include "components/search_engines/template_url_service.h" -#include "components/url_formatter/url_formatter.h" #include "components/variations/net/variations_http_header_provider.h" #include "grit/components_strings.h" #include "net/base/escape.h" #include "net/base/load_flags.h" +#include "net/base/net_util.h" #include "net/http/http_request_headers.h" #include "net/url_request/url_fetcher.h" #include "net/url_request/url_request_status.h" @@ -1379,9 +1379,8 @@ AutocompleteMatch SearchProvider::NavigationToMatch( navigation.formatted_url().find(input) : prefix->prefix.length(); bool trim_http = !AutocompleteInput::HasHTTPScheme(input) && (!prefix || (match_start != 0)); - const url_formatter::FormatUrlTypes format_types = - url_formatter::kFormatUrlOmitAll & - ~(trim_http ? 0 : url_formatter::kFormatUrlOmitHTTP); + const net::FormatUrlTypes format_types = + net::kFormatUrlOmitAll & ~(trim_http ? 0 : net::kFormatUrlOmitHTTP); const std::string languages(client()->GetAcceptLanguages()); size_t inline_autocomplete_offset = (prefix == NULL) ? @@ -1389,9 +1388,9 @@ AutocompleteMatch SearchProvider::NavigationToMatch( match.fill_into_edit += AutocompleteInput::FormattedStringWithEquivalentMeaning( navigation.url(), - url_formatter::FormatUrl(navigation.url(), languages, format_types, - net::UnescapeRule::SPACES, nullptr, nullptr, - &inline_autocomplete_offset), + net::FormatUrl(navigation.url(), languages, format_types, + net::UnescapeRule::SPACES, NULL, NULL, + &inline_autocomplete_offset), client()->GetSchemeClassifier()); // Preserve the forced query '?' prefix in |match.fill_into_edit|. // Otherwise, user edits to a suggestion would show non-Search results. diff --git a/components/omnibox/browser/search_suggestion_parser.cc b/components/omnibox/browser/search_suggestion_parser.cc index 24ab637..30543fc 100644 --- a/components/omnibox/browser/search_suggestion_parser.cc +++ b/components/omnibox/browser/search_suggestion_parser.cc @@ -18,8 +18,8 @@ #include "components/omnibox/browser/autocomplete_i18n.h" #include "components/omnibox/browser/autocomplete_input.h" #include "components/omnibox/browser/url_prefix.h" -#include "components/url_formatter/url_fixer.h" -#include "components/url_formatter/url_formatter.h" +#include "components/url_fixer/url_fixer.h" +#include "net/base/net_util.h" #include "net/http/http_response_headers.h" #include "net/url_request/url_fetcher.h" #include "url/url_constants.h" @@ -226,22 +226,13 @@ SearchSuggestionParser::NavigationResult::NavigationResult( bool relevance_from_server, const base::string16& input_text, const std::string& languages) - : Result(from_keyword_provider, - relevance, - relevance_from_server, - type, + : Result(from_keyword_provider, relevance, relevance_from_server, type, deletion_url), url_(url), formatted_url_(AutocompleteInput::FormattedStringWithEquivalentMeaning( - url, - url_formatter::FormatUrl(url, - languages, - url_formatter::kFormatUrlOmitAll & - ~url_formatter::kFormatUrlOmitHTTP, - net::UnescapeRule::SPACES, - nullptr, - nullptr, - nullptr), + url, net::FormatUrl(url, languages, + net::kFormatUrlOmitAll & ~net::kFormatUrlOmitHTTP, + net::UnescapeRule::SPACES, NULL, NULL, NULL), scheme_classifier)), description_(description) { DCHECK(url_.is_valid()); @@ -271,13 +262,11 @@ SearchSuggestionParser::NavigationResult::CalculateAndClassifyMatchContents( formatted_url_.find(input_text) : prefix->prefix.length(); bool trim_http = !AutocompleteInput::HasHTTPScheme(input_text) && (!prefix || (match_start != 0)); - const url_formatter::FormatUrlTypes format_types = - url_formatter::kFormatUrlOmitAll & - ~(trim_http ? 0 : url_formatter::kFormatUrlOmitHTTP); + const net::FormatUrlTypes format_types = + net::kFormatUrlOmitAll & ~(trim_http ? 0 : net::kFormatUrlOmitHTTP); - base::string16 match_contents = url_formatter::FormatUrl( - url_, languages, format_types, net::UnescapeRule::SPACES, nullptr, - nullptr, &match_start); + base::string16 match_contents = net::FormatUrl(url_, languages, format_types, + net::UnescapeRule::SPACES, NULL, NULL, &match_start); // If the first match in the untrimmed string was inside a scheme that we // trimmed, look for a subsequent match. if (match_start == base::string16::npos) @@ -481,8 +470,8 @@ bool SearchSuggestionParser::ParseSuggestResults( if ((match_type == AutocompleteMatchType::NAVSUGGEST) || (match_type == AutocompleteMatchType::NAVSUGGEST_PERSONALIZED)) { // Do not blindly trust the URL coming from the server to be valid. - GURL url(url_formatter::FixupURL(base::UTF16ToUTF8(suggestion), - std::string())); + GURL url( + url_fixer::FixupURL(base::UTF16ToUTF8(suggestion), std::string())); if (url.is_valid() && allow_navsuggest) { base::string16 title; if (descriptions != NULL) diff --git a/components/omnibox/browser/shortcuts_provider.cc b/components/omnibox/browser/shortcuts_provider.cc index 2b5eead..8d43be6 100644 --- a/components/omnibox/browser/shortcuts_provider.cc +++ b/components/omnibox/browser/shortcuts_provider.cc @@ -28,7 +28,7 @@ #include "components/omnibox/browser/history_provider.h" #include "components/omnibox/browser/omnibox_field_trial.h" #include "components/omnibox/browser/url_prefix.h" -#include "components/url_formatter/url_fixer.h" +#include "components/url_fixer/url_fixer.h" #include "url/third_party/mozilla/url_parse.h" namespace { diff --git a/components/omnibox/browser/url_index_private_data.cc b/components/omnibox/browser/url_index_private_data.cc index a468d2b..a965c86 100644 --- a/components/omnibox/browser/url_index_private_data.cc +++ b/components/omnibox/browser/url_index_private_data.cc @@ -26,7 +26,7 @@ #include "components/history/core/browser/history_db_task.h" #include "components/history/core/browser/history_service.h" #include "components/omnibox/browser/in_memory_url_index.h" -#include "components/url_formatter/url_formatter.h" +#include "net/base/net_util.h" #if defined(USE_SYSTEM_PROTOBUF) #include @@ -707,9 +707,10 @@ bool URLIndexPrivateData::IndexRow( history::URLID row_id = row.id(); // Strip out username and password before saving and indexing. - base::string16 url(url_formatter::FormatUrl( - gurl, languages, url_formatter::kFormatUrlOmitUsernamePassword, - net::UnescapeRule::NONE, nullptr, nullptr, nullptr)); + base::string16 url(net::FormatUrl(gurl, languages, + net::kFormatUrlOmitUsernamePassword, + net::UnescapeRule::NONE, + NULL, NULL, NULL)); HistoryID history_id = static_cast(row_id); DCHECK_LT(history_id, std::numeric_limits::max()); diff --git a/components/omnibox/browser/zero_suggest_provider.cc b/components/omnibox/browser/zero_suggest_provider.cc index 17a1bc9..ad75cc0 100644 --- a/components/omnibox/browser/zero_suggest_provider.cc +++ b/components/omnibox/browser/zero_suggest_provider.cc @@ -27,10 +27,10 @@ #include "components/omnibox/browser/search_provider.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/search_engines/template_url_service.h" -#include "components/url_formatter/url_formatter.h" #include "components/variations/net/variations_http_header_provider.h" #include "net/base/escape.h" #include "net/base/load_flags.h" +#include "net/base/net_util.h" #include "net/http/http_request_headers.h" #include "net/url_request/url_fetcher.h" #include "net/url_request/url_request_status.h" @@ -288,9 +288,8 @@ AutocompleteMatch ZeroSuggestProvider::NavigationToMatch( // Zero suggest results should always omit protocols and never appear bold. const std::string languages(client()->GetAcceptLanguages()); - match.contents = url_formatter::FormatUrl( - navigation.url(), languages, url_formatter::kFormatUrlOmitAll, - net::UnescapeRule::SPACES, nullptr, nullptr, nullptr); + match.contents = net::FormatUrl(navigation.url(), languages, + net::kFormatUrlOmitAll, net::UnescapeRule::SPACES, NULL, NULL, NULL); match.fill_into_edit += AutocompleteInput::FormattedStringWithEquivalentMeaning( navigation.url(), match.contents, client()->GetSchemeClassifier()); -- cgit v1.1