From 1659865c3eb47166c82378bb840801135b057a09 Mon Sep 17 00:00:00 2001 From: rsleevi Date: Mon, 3 Aug 2015 13:47:03 -0700 Subject: 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 Review URL: https://codereview.chromium.org/1171333003 Cr-Commit-Position: refs/heads/master@{#341605} --- components/history/core/DEPS | 2 ++ components/history/core/browser/BUILD.gn | 1 + components/history/core/browser/url_database.cc | 5 +++-- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'components/history') diff --git a/components/history/core/DEPS b/components/history/core/DEPS index 062cbac..636e200 100644 --- a/components/history/core/DEPS +++ b/components/history/core/DEPS @@ -2,4 +2,6 @@ include_rules = [ # history is a layered-component, forbid dependency on //content "-components/history/content", "-content", + + "+components/url_formatter", ] diff --git a/components/history/core/browser/BUILD.gn b/components/history/core/browser/BUILD.gn index ea7fee6..fa8cc4d 100644 --- a/components/history/core/browser/BUILD.gn +++ b/components/history/core/browser/BUILD.gn @@ -93,6 +93,7 @@ static_library("browser") { "//components/keyed_service/core", "//components/query_parser", "//components/signin/core/browser", + "//components/url_formatter", "//google_apis", "//net", "//sql", diff --git a/components/history/core/browser/url_database.cc b/components/history/core/browser/url_database.cc index 65ac67e..48847b4 100644 --- a/components/history/core/browser/url_database.cc +++ b/components/history/core/browser/url_database.cc @@ -12,7 +12,7 @@ #include "base/memory/scoped_vector.h" #include "base/strings/utf_string_conversions.h" #include "components/history/core/browser/keyword_search_term.h" -#include "net/base/net_util.h" +#include "components/url_formatter/url_formatter.h" #include "sql/statement.h" #include "url/gurl.h" @@ -372,7 +372,8 @@ bool URLDatabase::GetTextMatches(const base::string16& query, // |query_words| won't be shown to user - therefore we can use empty // |languages| to reduce dependency (no need to call PrefService). base::string16 ascii = base::ASCIIToUTF16(gurl.host()); - base::string16 utf = net::IDNToUnicode(gurl.host(), std::string()); + base::string16 utf = + url_formatter::IDNToUnicode(gurl.host(), std::string()); if (ascii != utf) query_parser_.ExtractQueryWords(utf, &query_words); } -- cgit v1.1