app_list: Re-enable people search.
[chromium-blink-merge.git] / chrome / browser / extensions / api / bookmarks / bookmark_api_helpers.h
blob43557f0a8eb99f3e5e7529f6c37270bd009adcfa
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_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "chrome/common/extensions/api/bookmarks.h"
14 class BookmarkNode;
15 class ChromeBookmarkClient;
17 namespace bookmarks {
18 class BookmarkModel;
21 // Helper functions.
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,
29 bool recurse,
30 bool only_folders);
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,
36 bool recurse);
38 void AddNodeFoldersOnly(ChromeBookmarkClient* client,
39 const BookmarkNode* node,
40 std::vector<linked_ptr<
41 api::bookmarks::BookmarkTreeNode> >* nodes,
42 bool recurse);
44 bool RemoveNode(bookmarks::BookmarkModel* model,
45 ChromeBookmarkClient* client,
46 int64 id,
47 bool recursive,
48 std::string* error);
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_