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

Unified Diff: chrome/browser/bookmarks/bookmark_utils.h

Issue 184663002: Omnibox: Make URLs of Bookmarks Searchable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ALL_MATCHES (in response to recent changes) Created 6 years, 8 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
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model_unittest.cc ('k') | chrome/browser/bookmarks/bookmark_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/bookmarks/bookmark_utils.h
diff --git a/chrome/browser/bookmarks/bookmark_utils.h b/chrome/browser/bookmarks/bookmark_utils.h
index a96be4ee7efcf4116c7cc7b0f366f84c740292c0..9eecedbb678318f2d3b6927ad12b366d4edade10 100644
--- a/chrome/browser/bookmarks/bookmark_utils.h
+++ b/chrome/browser/bookmarks/bookmark_utils.h
@@ -14,13 +14,15 @@
class BookmarkModel;
class BookmarkNode;
class Profile;
+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
+// systems that involve indexing and searching bookmarks.
namespace bookmark_utils {
// Fields to use when finding matching bookmarks.
@@ -107,6 +109,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,
+// 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
// Returns the node with |id|, or NULL if there is no node with |id|.
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model_unittest.cc ('k') | chrome/browser/bookmarks/bookmark_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698