diff options
author | rsleevi <rsleevi@chromium.org> | 2015-08-07 14:39:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-07 21:39:50 +0000 |
commit | 24f64dc221628032b7843f1af6b277a7f0d6c562 (patch) | |
tree | ba2c4bb1d37847b2cd76a4d8d243d1f000e0284e /components/error_page | |
parent | d9773981c8733eb55314efad66398350f862c8be (diff) | |
download | chromium_src-24f64dc221628032b7843f1af6b277a7f0d6c562.zip chromium_src-24f64dc221628032b7843f1af6b277a7f0d6c562.tar.gz chromium_src-24f64dc221628032b7843f1af6b277a7f0d6c562.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@{#342445}
Diffstat (limited to 'components/error_page')
-rw-r--r-- | components/error_page/renderer/BUILD.gn | 1 | ||||
-rw-r--r-- | components/error_page/renderer/DEPS | 1 | ||||
-rw-r--r-- | components/error_page/renderer/net_error_helper_core.cc | 10 |
3 files changed, 7 insertions, 5 deletions
diff --git a/components/error_page/renderer/BUILD.gn b/components/error_page/renderer/BUILD.gn index e47fd69..bafaada 100644 --- a/components/error_page/renderer/BUILD.gn +++ b/components/error_page/renderer/BUILD.gn @@ -12,6 +12,7 @@ static_library("renderer") { "//base", "//components/error_page/common", "//components/strings", + "//components/url_formatter", "//content/public/common", "//net", "//third_party/WebKit/public:blink", diff --git a/components/error_page/renderer/DEPS b/components/error_page/renderer/DEPS index 5d271a9..3238bc4 100644 --- a/components/error_page/renderer/DEPS +++ b/components/error_page/renderer/DEPS @@ -1,4 +1,5 @@ include_rules = [ + "+components/url_formatter", "+content/public/common", "+grit/components_strings.h", "+net", diff --git a/components/error_page/renderer/net_error_helper_core.cc b/components/error_page/renderer/net_error_helper_core.cc index be7be7d..e5f3dc3 100644 --- a/components/error_page/renderer/net_error_helper_core.cc +++ b/components/error_page/renderer/net_error_helper_core.cc @@ -23,11 +23,11 @@ #include "base/strings/string_util.h" #include "base/values.h" #include "components/error_page/common/error_page_params.h" +#include "components/url_formatter/url_formatter.h" #include "content/public/common/url_constants.h" #include "grit/components_strings.h" #include "net/base/escape.h" #include "net/base/net_errors.h" -#include "net/base/net_util.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebURLError.h" #include "ui/base/l10n/l10n_util.h" @@ -146,7 +146,7 @@ GURL SanitizeURL(const GURL& url) { // Sanitizes and formats a URL for upload to the error correction service. std::string PrepareUrlForUpload(const GURL& url) { - // TODO(yuusuke): Change to net::FormatUrl when Link Doctor becomes + // TODO(yuusuke): Change to url_formatter::FormatUrl when Link Doctor becomes // unicode-capable. std::string spec_to_send = SanitizeURL(url).spec(); @@ -265,9 +265,9 @@ std::string CreateClickTrackingUrlRequestBody( base::string16 FormatURLForDisplay(const GURL& url, bool is_rtl, const std::string accept_languages) { // Translate punycode into UTF8, unescape UTF8 URLs. - base::string16 url_for_display(net::FormatUrl( - url, accept_languages, net::kFormatUrlOmitNothing, - net::UnescapeRule::NORMAL, NULL, NULL, NULL)); + base::string16 url_for_display(url_formatter::FormatUrl( + url, accept_languages, url_formatter::kFormatUrlOmitNothing, + net::UnescapeRule::NORMAL, nullptr, nullptr, nullptr)); // URLs are always LTR. if (is_rtl) base::i18n::WrapStringWithLTRFormatting(&url_for_display); |