1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARK_API_HELPERS_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARK_API_HELPERS_H_
11 #include "base/basictypes.h"
12 #include "chrome/common/extensions/api/bookmarks.h"
17 class ManagedBookmarkService
;
21 namespace extensions
{
22 namespace bookmark_api_helpers
{
24 // The returned value is owned by the caller.
25 api::bookmarks::BookmarkTreeNode
* GetBookmarkTreeNode(
26 bookmarks::ManagedBookmarkService
* managed
,
27 const bookmarks::BookmarkNode
* node
,
31 // Adds a JSON representation of |node| to the JSON |nodes|.
32 void AddNode(bookmarks::ManagedBookmarkService
* managed
,
33 const bookmarks::BookmarkNode
* node
,
34 std::vector
<linked_ptr
<api::bookmarks::BookmarkTreeNode
>>* nodes
,
37 // Adds a JSON representation of |node| of folder type to the JSON |nodes|.
38 void AddNodeFoldersOnly(
39 bookmarks::ManagedBookmarkService
* managed
,
40 const bookmarks::BookmarkNode
* node
,
41 std::vector
<linked_ptr
<api::bookmarks::BookmarkTreeNode
>>* nodes
,
44 // Remove node of |id|.
45 bool RemoveNode(bookmarks::BookmarkModel
* model
,
46 bookmarks::ManagedBookmarkService
* managed
,
51 // Get meta info from |node| and all it's children recursively.
52 void GetMetaInfo(const bookmarks::BookmarkNode
& node
,
53 base::DictionaryValue
* id_to_meta_info_map
);
55 } // namespace bookmark_api_helpers
56 } // namespace extensions
58 #endif // CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARK_API_HELPERS_H_