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> |
11 | 11 |
12 namespace bookmarks { | 12 namespace bookmarks { |
13 class BookmarkModel; | 13 class BookmarkModel; |
14 class BookmarkNode; | 14 class BookmarkNode; |
15 } | 15 } |
16 | 16 |
17 namespace enhanced_bookmarks { | 17 namespace enhanced_bookmarks { |
18 | 18 |
19 extern const char kFieldTrialName[]; | |
20 | |
19 // Possible locations where a bookmark can be opened from. | 21 // Possible locations where a bookmark can be opened from. |
20 // Please sync with the corresponding histograms.xml. | 22 // Please sync with the corresponding histograms.xml. |
21 // | 23 // |
22 // A Java counterpart will be generated for this enum. | 24 // A Java counterpart will be generated for this enum. |
23 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.enhanced_bookmarks | 25 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.enhanced_bookmarks |
24 enum LaunchLocation { | 26 enum LaunchLocation { |
25 ALL_ITEMS = 0, | 27 ALL_ITEMS = 0, |
26 UNCATEGORIZED = 1, // Deprecated. | 28 UNCATEGORIZED = 1, // Deprecated. |
27 FOLDER = 2, | 29 FOLDER = 2, |
28 FILTER = 3, | 30 FILTER = 3, |
29 SEARCH = 4, | 31 SEARCH = 4, |
30 BOOKMARK_EDITOR = 5, | 32 BOOKMARK_EDITOR = 5, |
31 COUNT = 6, | 33 COUNT = 6, |
32 }; | 34 }; |
33 | 35 |
36 // View modes of enhanced bookmarks' main items UI. | |
37 // | |
38 // A Java counterpart will be generated for this enum. | |
39 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.enhanced_bookmarks | |
40 enum ViewMode { | |
41 DEFAULT = 0, | |
42 LIST = 1, | |
43 GRID = 2, | |
44 }; | |
45 | |
34 // Returns the permanent nodes whose url children are considered uncategorized | 46 // Returns the permanent nodes whose url children are considered uncategorized |
35 // and whose folder children should be shown in the bookmark menu. | 47 // and whose folder children should be shown in the bookmark menu. |
36 // |model| must be loaded. | 48 // |model| must be loaded. |
37 std::vector<const bookmarks::BookmarkNode*> PrimaryPermanentNodes( | 49 std::vector<const bookmarks::BookmarkNode*> PrimaryPermanentNodes( |
38 bookmarks::BookmarkModel* model); | 50 bookmarks::BookmarkModel* model); |
39 | 51 |
40 // Returns an unsorted vector of folders that are considered to be at the "root" | 52 // 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 | 53 // level of the bookmark hierarchy. Functionally, this means all direct |
42 // descendants of PrimaryPermanentNodes. | 54 // descendants of PrimaryPermanentNodes. |
43 std::vector<const bookmarks::BookmarkNode*> RootLevelFolders( | 55 std::vector<const bookmarks::BookmarkNode*> RootLevelFolders( |
44 bookmarks::BookmarkModel* model); | 56 bookmarks::BookmarkModel* model); |
45 | 57 |
46 // Returns whether |node| is a primary permanent node in the sense of | 58 // Returns whether |node| is a primary permanent node in the sense of |
47 // |PrimaryPermanentNodes|. | 59 // |PrimaryPermanentNodes|. |
48 bool IsPrimaryPermanentNode(const bookmarks::BookmarkNode* node, | 60 bool IsPrimaryPermanentNode(const bookmarks::BookmarkNode* node, |
49 bookmarks::BookmarkModel* model); | 61 bookmarks::BookmarkModel* model); |
50 | 62 |
51 // Returns the root level folder in which this node is directly, or indirectly | 63 // Returns the root level folder in which this node is directly, or indirectly |
52 // via subfolders, located. | 64 // via subfolders, located. |
53 const bookmarks::BookmarkNode* RootLevelFolderForNode( | 65 const bookmarks::BookmarkNode* RootLevelFolderForNode( |
54 const bookmarks::BookmarkNode* node, | 66 const bookmarks::BookmarkNode* node, |
55 bookmarks::BookmarkModel* model); | 67 bookmarks::BookmarkModel* model); |
56 | 68 |
69 // Returns the default view mode for main items UI. | |
70 // It doesn't return ViewMode::DEFAULT. | |
Theresa
2015/05/28 20:13:08
Can you elaborate with what is returned; e.g. the
Kibeom Kim (inactive)
2015/05/29 00:11:04
Done.
| |
71 ViewMode GetDefaultViewMode(); | |
72 | |
57 } // namespace enhanced_bookmarks | 73 } // namespace enhanced_bookmarks |
58 | 74 |
59 #endif // COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_UTILS_H_ | 75 #endif // COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_UTILS_H_ |
60 | 76 |
OLD | NEW |