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"
15 class ChromeBookmarkClient
;
22 namespace extensions
{
23 namespace bookmark_api_helpers
{
25 // The returned value is owned by the caller.
26 api::bookmarks::BookmarkTreeNode
* GetBookmarkTreeNode(
27 ChromeBookmarkClient
* client
,
28 const BookmarkNode
* node
,
32 // Add a JSON representation of |node| to the JSON |nodes|.
33 void AddNode(ChromeBookmarkClient
* client
,
34 const BookmarkNode
* node
,
35 std::vector
<linked_ptr
<api::bookmarks::BookmarkTreeNode
> >* nodes
,
38 void AddNodeFoldersOnly(ChromeBookmarkClient
* client
,
39 const BookmarkNode
* node
,
40 std::vector
<linked_ptr
<
41 api::bookmarks::BookmarkTreeNode
> >* nodes
,
44 bool RemoveNode(bookmarks::BookmarkModel
* model
,
45 ChromeBookmarkClient
* client
,
50 // Get meta info from |node| and all it's children recursively.
51 void GetMetaInfo(const BookmarkNode
& node
,
52 base::DictionaryValue
* id_to_meta_info_map
);
54 } // namespace bookmark_api_helpers
55 } // namespace extensions
57 #endif // CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARK_API_HELPERS_H_