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

Unified Diff: ios/chrome/browser/bookmarks/bookmarks_utils.h

Issue 1647903002: Moving bookmarks utility function to ios/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | ios/chrome/browser/bookmarks/bookmarks_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/bookmarks/bookmarks_utils.h
diff --git a/ios/chrome/browser/bookmarks/bookmarks_utils.h b/ios/chrome/browser/bookmarks/bookmarks_utils.h
index 39cd066a67d403e3f83e5e4fe136137b13b12b19..0684a8d4f0c5aa43b3ada30481ed52e61abf307c 100644
--- a/ios/chrome/browser/bookmarks/bookmarks_utils.h
+++ b/ios/chrome/browser/bookmarks/bookmarks_utils.h
@@ -5,8 +5,16 @@
#ifndef IOS_CHROME_BROWSER_BOOKMARKS_BOOKMARKS_UTILS_H_
#define IOS_CHROME_BROWSER_BOOKMARKS_BOOKMARKS_UTILS_H_
+#include <set>
+#include <vector>
+
#include "base/compiler_specific.h"
+namespace bookmarks {
+class BookmarkModel;
+class BookmarkNode;
+}
+
namespace ios {
class ChromeBrowserState;
}
@@ -32,4 +40,27 @@ void RecordBookmarkLaunch(BookmarkLaunchLocation launch_location);
bool RemoveAllUserBookmarksIOS(ios::ChromeBrowserState* browser_state)
WARN_UNUSED_RESULT;
+// Returns the permanent nodes whose url children are considered uncategorized
+// and whose folder children should be shown in the bookmark menu.
+// |model| must be loaded.
+std::vector<const bookmarks::BookmarkNode*> PrimaryPermanentNodes(
+ bookmarks::BookmarkModel* model);
+
+// Returns an unsorted vector of folders that are considered to be at the "root"
+// level of the bookmark hierarchy. Functionally, this means all direct
+// descendants of PrimaryPermanentNodes.
+std::vector<const bookmarks::BookmarkNode*> RootLevelFolders(
+ bookmarks::BookmarkModel* model);
+
+// Returns whether |node| is a primary permanent node in the sense of
+// |PrimaryPermanentNodes|.
+bool IsPrimaryPermanentNode(const bookmarks::BookmarkNode* node,
+ bookmarks::BookmarkModel* model);
+
+// Returns the root level folder in which this node is directly, or indirectly
+// via subfolders, located.
+const bookmarks::BookmarkNode* RootLevelFolderForNode(
+ const bookmarks::BookmarkNode* node,
+ bookmarks::BookmarkModel* model);
+
#endif // IOS_CHROME_BROWSER_BOOKMARKS_BOOKMARKS_UTILS_H_
« no previous file with comments | « no previous file | ios/chrome/browser/bookmarks/bookmarks_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698