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}

[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=486979

Review URL: https://codereview.chromium.org/1260033005

Cr-Commit-Position: refs/heads/master@{#341691}
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 0c9d657..6281b91a 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -23,7 +23,6 @@
     "//base",
     "//base:base_static",
     "//components/mime_util",
-    "//components/url_formatter",
     "//content:resources",
     "//content/browser/background_sync:background_sync_proto",
     "//content/browser/cache_storage:cache_storage_proto",
diff --git a/content/browser/DEPS b/content/browser/DEPS
index c3668d8..8baf02ef 100644
--- a/content/browser/DEPS
+++ b/content/browser/DEPS
@@ -4,7 +4,6 @@
   "+components/mime_util",
   "+components/scheduler/common",
   "+components/tracing",
-  "+components/url_formatter",
 
   "+content/app/strings/grit",  # For generated headers
   "+content/public/browser",
diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc
index 8b4fc11..f05c253 100644
--- a/content/browser/download/save_package.cc
+++ b/content/browser/download/save_package.cc
@@ -18,7 +18,6 @@
 #include "base/strings/sys_string_conversions.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/threading/thread.h"
-#include "components/url_formatter/url_formatter.h"
 #include "content/browser/download/download_item_impl.h"
 #include "content/browser/download/download_manager_impl.h"
 #include "content/browser/download/download_stats.h"
@@ -1215,7 +1214,7 @@
   // back to a URL, and if it matches the original page URL, we know the page
   // had no title (or had a title equal to its URL, which is fine to treat
   // similarly).
-  if (title_ == url_formatter::FormatUrl(page_url_, accept_langs)) {
+  if (title_ == net::FormatUrl(page_url_, accept_langs)) {
     std::string url_path;
     if (!page_url_.SchemeIs(url::kDataScheme)) {
       std::vector<std::string> url_parts;
diff --git a/content/browser/frame_host/navigation_entry_impl.cc b/content/browser/frame_host/navigation_entry_impl.cc
index 1e3b9e5..b51b7be0 100644
--- a/content/browser/frame_host/navigation_entry_impl.cc
+++ b/content/browser/frame_host/navigation_entry_impl.cc
@@ -9,10 +9,10 @@
 #include "base/metrics/histogram.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
-#include "components/url_formatter/url_formatter.h"
 #include "content/common/navigation_params.h"
 #include "content/public/common/content_constants.h"
 #include "content/public/common/url_constants.h"
+#include "net/base/net_util.h"
 #include "ui/gfx/text_elider.h"
 
 // Use this to get a new unique ID for a NavigationEntry during construction.
@@ -222,9 +222,9 @@
   // Use the virtual URL first if any, and fall back on using the real URL.
   base::string16 title;
   if (!virtual_url_.is_empty()) {
-    title = url_formatter::FormatUrl(virtual_url_, languages);
+    title = net::FormatUrl(virtual_url_, languages);
   } else if (!GetURL().is_empty()) {
-    title = url_formatter::FormatUrl(GetURL(), languages);
+    title = net::FormatUrl(GetURL(), languages);
   }
 
   // For file:// URLs use the filename as the title, not the full path.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 5de6232..f87a381 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -23,7 +23,6 @@
 #include "base/time/time.h"
 #include "base/trace_event/trace_event.h"
 #include "components/mime_util/mime_util.h"
-#include "components/url_formatter/url_formatter.h"
 #include "content/browser/accessibility/accessibility_mode_helper.h"
 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
 #include "content/browser/bad_message.h"
@@ -103,6 +102,7 @@
 #include "content/public/common/web_preferences.h"
 #include "mojo/common/url_type_converters.h"
 #include "mojo/converters/geometry/geometry_type_converters.h"
+#include "net/base/net_util.h"
 #include "net/http/http_cache.h"
 #include "net/http/http_transaction_factory.h"
 #include "net/url_request/url_request_context.h"
@@ -4289,9 +4289,9 @@
   load_state_ = load_state;
   upload_position_ = upload_position;
   upload_size_ = upload_size;
-  load_state_host_ = url_formatter::IDNToUnicode(
-      url.host(),
-      GetContentClient()->browser()->GetAcceptLangs(GetBrowserContext()));
+  load_state_host_ = net::IDNToUnicode(url.host(),
+      GetContentClient()->browser()->GetAcceptLangs(
+          GetBrowserContext()));
   if (load_state_.state == net::LOAD_STATE_READING_RESPONSE)
     SetNotWaitingForResponse();
   if (IsLoading()) {