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.
5 #ifndef COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_UTILS_H_
6 #define COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_UTILS_H_
17 namespace enhanced_bookmarks
{
19 // Possible locations where a bookmark can be opened from.
20 // Please sync with the corresponding histograms.xml.
22 // A Java counterpart will be generated for this enum.
23 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.enhancedbookmarks
26 UNCATEGORIZED
= 1, // Deprecated.
34 // Returns the permanent nodes whose url children are considered uncategorized
35 // and whose folder children should be shown in the bookmark menu.
36 // |model| must be loaded.
37 std::vector
<const bookmarks::BookmarkNode
*> PrimaryPermanentNodes(
38 bookmarks::BookmarkModel
* model
);
40 // Returns an unsorted vector of folders that are considered to be at the "root"
41 // level of the bookmark hierarchy. Functionally, this means all direct
42 // descendants of PrimaryPermanentNodes.
43 std::vector
<const bookmarks::BookmarkNode
*> RootLevelFolders(
44 bookmarks::BookmarkModel
* model
);
46 // Returns whether |node| is a primary permanent node in the sense of
47 // |PrimaryPermanentNodes|.
48 bool IsPrimaryPermanentNode(const bookmarks::BookmarkNode
* node
,
49 bookmarks::BookmarkModel
* model
);
51 // Returns the root level folder in which this node is directly, or indirectly
52 // via subfolders, located.
53 const bookmarks::BookmarkNode
* RootLevelFolderForNode(
54 const bookmarks::BookmarkNode
* node
,
55 bookmarks::BookmarkModel
* model
);
57 } // namespace enhanced_bookmarks
59 #endif // COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_UTILS_H_