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

Side by Side Diff: components/enhanced_bookmarks/enhanced_bookmark_utils.h

Issue 452913002: First implementation of enhanced_bookmark_utils. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_UTILS_H_
6 #define COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_UTILS_H_
7
8 #include <set>
9 #include <string>
10 #include <vector>
11
12 class BookmarkModel;
13 class BookmarkNode;
14
15 namespace enhanced_bookmark_utils {
blundell 2014/08/08 13:39:09 oops, I had missed that this namespace should just
16
17 // Returns an ordered vector of bookmarks that are urls that match |query|.
18 // |query| must be UTF8 encoded.
19 std::vector<const BookmarkNode*> FindBookmarksWithQuery(
20 BookmarkModel* bookmark_model,
21 const std::string& query);
22
23 // The vector is sorted in place.
24 // All of the bookmarks in |nodes| must be urls.
25 void SortBookmarksByName(std::vector<const BookmarkNode*>& nodes);
26
27 // Returns the permanent nodes whose url children are considered uncategorized
28 // and whose folder children should be shown in the bookmark menu.
29 // |model| must be loaded.
30 std::vector<const BookmarkNode*> PrimaryPermanentNodes(BookmarkModel* model);
31
32 // Returns an unsorted vector of folders that are considered to be at the "root"
33 // level of the bookmark hierarchy. Functionally, this means all direct
34 // descendants of PrimaryPermanentNodes, and possibly a node for the bookmarks
35 // bar.
36 std::vector<const BookmarkNode*> RootLevelFolders(BookmarkModel* model);
37
38 // Returns whether |node| is a primary permanent node in the sense of
39 // |PrimaryPermanentNodes|.
40 bool IsPrimaryPermanentNode(const BookmarkNode* node, BookmarkModel* model);
41
42 // Returns the root level folder in which this node is directly, or indirectly
43 // via subfolders, located.
44 const BookmarkNode* RootLevelFolderForNode(const BookmarkNode* node,
45 BookmarkModel* model);
46
47 } // namespace enhanced_bookmark_utils
48
49 #endif // COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_UTILS_H_
OLDNEW
« no previous file with comments | « components/enhanced_bookmarks.gypi ('k') | components/enhanced_bookmarks/enhanced_bookmark_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698