| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_BOOKMARKS_BOOKMARK_EXTENSION_HELPERS_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_EXTENSION_HELPERS_H_ |
| 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_EXTENSION_HELPERS_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_EXTENSION_HELPERS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "chrome/common/extensions/api/bookmarks.h" |
| 11 | 13 |
| 12 class BookmarkModel; | 14 class BookmarkModel; |
| 13 class BookmarkNode; | 15 class BookmarkNode; |
| 14 | 16 |
| 15 namespace base { | |
| 16 class DictionaryValue; | |
| 17 class ListValue; | |
| 18 } | |
| 19 | |
| 20 // Helper functions. | 17 // Helper functions. |
| 21 namespace bookmark_extension_helpers { | 18 namespace bookmark_extension_helpers { |
| 22 | 19 |
| 23 // The returned value is owned by the caller. | 20 // The returned value is owned by the caller. |
| 21 extensions::api::bookmarks::BookmarkTreeNode* GetBookmarkTreeNode( |
| 22 const BookmarkNode* node, |
| 23 bool recurse, |
| 24 bool only_folders); |
| 25 |
| 26 // TODO(mwrosen): Remove this function once chrome.experimental.bookmarkManager |
| 27 // is refactored to use the JSON schema compiler. |
| 24 base::DictionaryValue* GetNodeDictionary(const BookmarkNode* node, | 28 base::DictionaryValue* GetNodeDictionary(const BookmarkNode* node, |
| 25 bool recurse, | 29 bool recurse, |
| 26 bool only_folders); | 30 bool only_folders); |
| 27 | 31 |
| 28 // Add a JSON representation of |node| to the JSON |list|. | 32 // Add a JSON representation of |node| to the JSON |nodes|. |
| 29 void AddNode(const BookmarkNode* node, base::ListValue* list, bool recurse); | 33 void AddNode(const BookmarkNode* node, |
| 34 std::vector<linked_ptr< |
| 35 extensions::api::bookmarks::BookmarkTreeNode> >* nodes, |
| 36 bool recurse); |
| 30 | 37 |
| 31 void AddNodeFoldersOnly(const BookmarkNode* node, | 38 void AddNodeFoldersOnly(const BookmarkNode* node, |
| 39 std::vector<linked_ptr< |
| 40 extensions::api::bookmarks::BookmarkTreeNode> >* |
| 41 nodes, |
| 42 bool recurse); |
| 43 |
| 44 // TODO(mwrosen): Remove this function once chrome.experimental.bookmarkManager |
| 45 // is refactored to use the JSON schema compiler. |
| 46 void AddNode(const BookmarkNode* node, |
| 47 base::ListValue* list, |
| 48 bool recurse); |
| 49 |
| 50 // TODO(mwrosen): Remove this function once chrome.experimental.bookmarkManager |
| 51 // is refactored to use the JSON schema compiler. |
| 52 void AddNodeFoldersOnly(const BookmarkNode* node, |
| 32 base::ListValue* list, | 53 base::ListValue* list, |
| 33 bool recurse); | 54 bool recurse); |
| 34 | 55 |
| 35 bool RemoveNode(BookmarkModel* model, | 56 bool RemoveNode(BookmarkModel* model, |
| 36 int64 id, | 57 int64 id, |
| 37 bool recursive, | 58 bool recursive, |
| 38 std::string* error); | 59 std::string* error); |
| 39 | 60 |
| 40 } // namespace bookmark_extension_helpers | 61 } // namespace bookmark_extension_helpers |
| 41 | 62 |
| 42 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_EXTENSION_HELPERS_H_ | 63 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_EXTENSION_HELPERS_H_ |
| OLD | NEW |