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

Unified Diff: chrome/browser/autocomplete/history_url_provider.cc

Issue 1171333003: Move net::FormatUrl and friends outside of //net and into //components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile fixes following rebase Created 5 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: chrome/browser/autocomplete/history_url_provider.cc
diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc
index 7f59e68a2a1746ece2ec91b2e64c718ec0085dc7..89da71c4ab111d81ffff9643cbbad1f7e95d2433 100644
--- a/chrome/browser/autocomplete/history_url_provider.cc
+++ b/chrome/browser/autocomplete/history_url_provider.cc
@@ -38,8 +38,8 @@
#include "components/omnibox/url_prefix.h"
#include "components/search_engines/template_url_service.h"
#include "components/url_fixer/url_fixer.h"
+#include "components/url_formatter/url_formatter.h"
#include "content/public/browser/browser_thread.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"
@@ -610,10 +610,10 @@ AutocompleteMatch HistoryURLProvider::SuggestExactInput(
// Trim off "http://" if the user didn't type it.
DCHECK(!trim_http || !AutocompleteInput::HasHTTPScheme(text));
- base::string16 display_string(
- net::FormatUrl(destination_url, std::string(),
- net::kFormatUrlOmitAll & ~net::kFormatUrlOmitHTTP,
- net::UnescapeRule::SPACES, NULL, NULL, NULL));
+ base::string16 display_string(url_formatter::FormatUrl(
+ destination_url, std::string(),
+ url_formatter::kFormatUrlOmitAll & ~url_formatter::kFormatUrlOmitHTTP,
+ net::UnescapeRule::SPACES, nullptr, nullptr, nullptr));
const size_t offset = trim_http ? TrimHttpPrefix(&display_string) : 0;
match.fill_into_edit =
AutocompleteInput::FormattedStringWithEquivalentMeaning(
@@ -1143,15 +1143,17 @@ AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch(
history_match.input_location + params.input.text().length();
std::string languages = (match_type == WHAT_YOU_TYPED) ?
std::string() : params.languages;
- const net::FormatUrlTypes format_types = net::kFormatUrlOmitAll &
- ~((params.trim_http && !history_match.match_in_scheme) ?
- 0 : net::kFormatUrlOmitHTTP);
+ const url_formatter::FormatUrlTypes format_types =
+ url_formatter::kFormatUrlOmitAll &
+ ~((params.trim_http && !history_match.match_in_scheme)
+ ? 0
+ : url_formatter::kFormatUrlOmitHTTP);
match.fill_into_edit =
AutocompleteInput::FormattedStringWithEquivalentMeaning(
info.url(),
- net::FormatUrl(info.url(), languages, format_types,
- net::UnescapeRule::SPACES, NULL, NULL,
- &inline_autocomplete_offset),
+ url_formatter::FormatUrl(info.url(), languages, format_types,
+ net::UnescapeRule::SPACES, nullptr, nullptr,
+ &inline_autocomplete_offset),
ChromeAutocompleteSchemeClassifier(profile_));
if (!params.prevent_inline_autocomplete &&
(inline_autocomplete_offset != base::string16::npos)) {
@@ -1166,8 +1168,9 @@ AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch(
(inline_autocomplete_offset >= match.fill_into_edit.length()));
size_t match_start = history_match.input_location;
- match.contents = net::FormatUrl(info.url(), languages,
- format_types, net::UnescapeRule::SPACES, NULL, NULL, &match_start);
+ match.contents = url_formatter::FormatUrl(info.url(), languages, format_types,
+ net::UnescapeRule::SPACES, nullptr,
+ nullptr, &match_start);
if ((match_start != base::string16::npos) &&
(inline_autocomplete_offset != base::string16::npos) &&
(inline_autocomplete_offset != match_start)) {

Powered by Google App Engine
This is Rietveld 408576698