diff options
author | jochen <jochen@chromium.org> | 2015-08-04 00:05:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-04 07:05:48 +0000 |
commit | 90437dd218ba09f01612ebfc47eda167d67fb368 (patch) | |
tree | 77d2fe1ff3c1830af96a8e03c32419c5b5634522 /components/bookmarks/browser/bookmark_utils.cc | |
parent | 31ad3e6a80c367c4f8ea0a921e8f2cfe555a5fd6 (diff) | |
download | chromium_src-90437dd218ba09f01612ebfc47eda167d67fb368.zip chromium_src-90437dd218ba09f01612ebfc47eda167d67fb368.tar.gz chromium_src-90437dd218ba09f01612ebfc47eda167d67fb368.tar.bz2 |
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}
TBR=droger@chromium.org,jam@chromium.org,mkwst@chromium.org,pkasting@chromium.org,sky@chromium.org,stuartmorgan@chromium.org,felt@chromium.org,rsleevi@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=486979
Review URL: https://codereview.chromium.org/1260033005
Cr-Commit-Position: refs/heads/master@{#341691}
Diffstat (limited to 'components/bookmarks/browser/bookmark_utils.cc')
-rw-r--r-- | components/bookmarks/browser/bookmark_utils.cc | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/components/bookmarks/browser/bookmark_utils.cc b/components/bookmarks/browser/bookmark_utils.cc index 6d60a4f..a815d1c 100644 --- a/components/bookmarks/browser/bookmark_utils.cc +++ b/components/bookmarks/browser/bookmark_utils.cc @@ -25,7 +25,7 @@ #include "components/bookmarks/common/bookmark_pref_names.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/query_parser/query_parser.h" -#include "components/url_formatter/url_formatter.h" +#include "net/base/net_util.h" #include "ui/base/clipboard/clipboard.h" #include "ui/base/models/tree_node_iterator.h" #include "url/gurl.h" @@ -96,14 +96,13 @@ bool DoesBookmarkTextContainWords(const base::string16& text, bool DoesBookmarkContainWords(const BookmarkNode* node, const std::vector<base::string16>& words, const std::string& languages) { - return DoesBookmarkTextContainWords(node->GetTitle(), words) || - DoesBookmarkTextContainWords(base::UTF8ToUTF16(node->url().spec()), - words) || - DoesBookmarkTextContainWords( - url_formatter::FormatUrl( - node->url(), languages, url_formatter::kFormatUrlOmitNothing, - net::UnescapeRule::NORMAL, NULL, NULL, NULL), - words); + return + DoesBookmarkTextContainWords(node->GetTitle(), words) || + DoesBookmarkTextContainWords( + base::UTF8ToUTF16(node->url().spec()), words) || + DoesBookmarkTextContainWords(net::FormatUrl( + node->url(), languages, net::kFormatUrlOmitNothing, + net::UnescapeRule::NORMAL, NULL, NULL, NULL), words); } // This is used with a tree iterator to skip subtrees which are not visible. @@ -517,11 +516,11 @@ base::string16 CleanUpUrlForMatching( const std::string& languages, base::OffsetAdjuster::Adjustments* adjustments) { base::OffsetAdjuster::Adjustments tmp_adjustments; - return base::i18n::ToLower(url_formatter::FormatUrlWithAdjustments( + return base::i18n::ToLower(net::FormatUrlWithAdjustments( GURL(TruncateUrl(gurl.spec())), languages, - url_formatter::kFormatUrlOmitUsernamePassword, - net::UnescapeRule::SPACES | net::UnescapeRule::URL_SPECIAL_CHARS, NULL, - NULL, adjustments ? adjustments : &tmp_adjustments)); + net::kFormatUrlOmitUsernamePassword, + net::UnescapeRule::SPACES | net::UnescapeRule::URL_SPECIAL_CHARS, + NULL, NULL, adjustments ? adjustments : &tmp_adjustments)); } base::string16 CleanUpTitleForMatching(const base::string16& title) { |