Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(620)

Unified Diff: components/bookmarks/browser/bookmark_utils.cc

Issue 1171333003: Move net::FormatUrl and friends outside of //net and into //components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile fixes following rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/bookmarks/browser/bookmark_utils.cc
diff --git a/components/bookmarks/browser/bookmark_utils.cc b/components/bookmarks/browser/bookmark_utils.cc
index 28690f273777331c92a28110030cc415c3c8deb9..a32c9f2619d23820a1a1614ef2c16d3c5aca8400 100644
--- a/components/bookmarks/browser/bookmark_utils.cc
+++ b/components/bookmarks/browser/bookmark_utils.cc
@@ -24,7 +24,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 "net/base/net_util.h"
+#include "components/url_formatter/url_formatter.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/models/tree_node_iterator.h"
#include "url/gurl.h"
@@ -95,13 +95,14 @@ 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(net::FormatUrl(
- node->url(), languages, net::kFormatUrlOmitNothing,
- net::UnescapeRule::NORMAL, NULL, NULL, NULL), words);
+ 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);
}
// This is used with a tree iterator to skip subtrees which are not visible.
@@ -504,11 +505,11 @@ base::string16 CleanUpUrlForMatching(
const std::string& languages,
base::OffsetAdjuster::Adjustments* adjustments) {
base::OffsetAdjuster::Adjustments tmp_adjustments;
- return base::i18n::ToLower(net::FormatUrlWithAdjustments(
+ return base::i18n::ToLower(url_formatter::FormatUrlWithAdjustments(
GURL(TruncateUrl(gurl.spec())), languages,
- net::kFormatUrlOmitUsernamePassword,
- net::UnescapeRule::SPACES | net::UnescapeRule::URL_SPECIAL_CHARS,
- NULL, NULL, adjustments ? adjustments : &tmp_adjustments));
+ url_formatter::kFormatUrlOmitUsernamePassword,
+ net::UnescapeRule::SPACES | net::UnescapeRule::URL_SPECIAL_CHARS, NULL,
+ NULL, adjustments ? adjustments : &tmp_adjustments));
}
base::string16 CleanUpTitleForMatching(const base::string16& title) {

Powered by Google App Engine
This is Rietveld 408576698