diff options
author | rsleevi <rsleevi@chromium.org> | 2015-08-03 13:47:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-03 20:47:42 +0000 |
commit | 1659865c3eb47166c82378bb840801135b057a09 (patch) | |
tree | 7cd31e008e6097a080a0c6d2f879fc880c3a475b /components/history | |
parent | 16f99512ca431c0d2f21cf94f3a7997bbd64d8c0 (diff) | |
download | chromium_src-1659865c3eb47166c82378bb840801135b057a09.zip chromium_src-1659865c3eb47166c82378bb840801135b057a09.tar.gz chromium_src-1659865c3eb47166c82378bb840801135b057a09.tar.bz2 |
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}
Diffstat (limited to 'components/history')
-rw-r--r-- | components/history/core/DEPS | 2 | ||||
-rw-r--r-- | components/history/core/browser/BUILD.gn | 1 | ||||
-rw-r--r-- | components/history/core/browser/url_database.cc | 5 |
3 files changed, 6 insertions, 2 deletions
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); } |