OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_UTILS_H_ | 5 #ifndef COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_UTILS_H_ |
6 #define COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_UTILS_H_ | 6 #define COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_UTILS_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 11 matching lines...) Expand all Loading... |
22 void SortBookmarksByName(std::vector<const BookmarkNode*>& nodes); | 22 void SortBookmarksByName(std::vector<const BookmarkNode*>& nodes); |
23 | 23 |
24 // Returns the permanent nodes whose url children are considered uncategorized | 24 // Returns the permanent nodes whose url children are considered uncategorized |
25 // and whose folder children should be shown in the bookmark menu. | 25 // and whose folder children should be shown in the bookmark menu. |
26 // |model| must be loaded. | 26 // |model| must be loaded. |
27 std::vector<const BookmarkNode*> PrimaryPermanentNodes( | 27 std::vector<const BookmarkNode*> PrimaryPermanentNodes( |
28 bookmarks::BookmarkModel* model); | 28 bookmarks::BookmarkModel* model); |
29 | 29 |
30 // Returns an unsorted vector of folders that are considered to be at the "root" | 30 // Returns an unsorted vector of folders that are considered to be at the "root" |
31 // level of the bookmark hierarchy. Functionally, this means all direct | 31 // level of the bookmark hierarchy. Functionally, this means all direct |
32 // descendants of PrimaryPermanentNodes, and possibly a node for the bookmarks | 32 // descendants of PrimaryPermanentNodes. |
33 // bar. | |
34 std::vector<const BookmarkNode*> RootLevelFolders( | 33 std::vector<const BookmarkNode*> RootLevelFolders( |
35 bookmarks::BookmarkModel* model); | 34 bookmarks::BookmarkModel* model); |
36 | 35 |
37 // Returns whether |node| is a primary permanent node in the sense of | 36 // Returns whether |node| is a primary permanent node in the sense of |
38 // |PrimaryPermanentNodes|. | 37 // |PrimaryPermanentNodes|. |
39 bool IsPrimaryPermanentNode(const BookmarkNode* node, | 38 bool IsPrimaryPermanentNode(const BookmarkNode* node, |
40 bookmarks::BookmarkModel* model); | 39 bookmarks::BookmarkModel* model); |
41 | 40 |
42 // Returns the root level folder in which this node is directly, or indirectly | 41 // Returns the root level folder in which this node is directly, or indirectly |
43 // via subfolders, located. | 42 // via subfolders, located. |
44 const BookmarkNode* RootLevelFolderForNode(const BookmarkNode* node, | 43 const BookmarkNode* RootLevelFolderForNode(const BookmarkNode* node, |
45 bookmarks::BookmarkModel* model); | 44 bookmarks::BookmarkModel* model); |
46 | 45 |
47 } // namespace enhanced_bookmarks | 46 } // namespace enhanced_bookmarks |
48 | 47 |
49 #endif // COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_UTILS_H_ | 48 #endif // COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_UTILS_H_ |
OLD | NEW |