Index: chrome/browser/bookmarks/bookmark_utils.h |
diff --git a/chrome/browser/bookmarks/bookmark_utils.h b/chrome/browser/bookmarks/bookmark_utils.h |
index fa5086dc8d36df2c5fba606fbbe4a392f39b9574..b5ced819809eab5a5fbaba5c2d638d86149b2e31 100644 |
--- a/chrome/browser/bookmarks/bookmark_utils.h |
+++ b/chrome/browser/bookmarks/bookmark_utils.h |
@@ -13,13 +13,15 @@ |
class BookmarkModel; |
class BookmarkNode; |
+class GURL; |
namespace user_prefs { |
class PrefRegistrySyncable; |
} |
// A collection of bookmark utility functions used by various parts of the UI |
-// that show bookmarks: bookmark manager, bookmark bar view ... |
+// that show bookmarks (bookmark manager, bookmark bar view, ...) and other |
+// system that involve indexing and searching bookmarks. |
namespace bookmark_utils { |
// Fields to use when finding matching bookmarks. |
@@ -106,6 +108,21 @@ void AddIfNotBookmarked(BookmarkModel* model, |
// Removes all bookmarks for the given |url|. |
void RemoveAllBookmarks(BookmarkModel* model, const GURL& url); |
+// Truncates an overly-long URL, unescapes it, and lower-cases it, |
Mark P
2014/02/28 15:48:03
this is a simple move of these functions from the
|
+// returning the result. This unescaping makes it possible to match |
+// substrings that were originally escaped for navigation; for |
+// example, if the user searched for "a&p", the query would be escaped |
+// as "a%26p", so without unescaping, an input string of "a&p" would |
+// no longer match this URL. Note that the resulting unescaped URL |
+// may not be directly navigable (which is why we escaped it to begin |
+// with). |languages| is passed to net::FormatUrl(). |
+base::string16 CleanUpUrlForMatching(const GURL& gurl, |
+ const std::string& languages); |
+ |
+// Returns the lower-cased title, possibly truncated if the original title |
+// is overly-long. |
+base::string16 CleanUpTitleForMatching(const base::string16& title); |
+ |
} // namespace bookmark_utils |
#endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ |