summaryrefslogtreecommitdiffstats
path: root/chrome/browser/bookmarks/bookmark_extension_helpers.h
blob: e363271773b9d10d0f3b5a735cf28225e6bc96bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_EXTENSION_HELPERS_H_
#define CHROME_BROWSER_BOOKMARKS_BOOKMARK_EXTENSION_HELPERS_H_
#pragma once

#include <string>

#include "base/basictypes.h"

class BookmarkModel;
class BookmarkNode;

namespace base {
class DictionaryValue;
class ListValue;
}

// Helper functions.
namespace bookmark_extension_helpers {

// The returned value is owned by the caller.
base::DictionaryValue* GetNodeDictionary(const BookmarkNode* node,
                                         bool recurse,
                                         bool only_folders);

// Add a JSON representation of |node| to the JSON |list|.
void AddNode(const BookmarkNode* node, base::ListValue* list, bool recurse);

void AddNodeFoldersOnly(const BookmarkNode* node,
                        base::ListValue* list,
                        bool recurse);

bool RemoveNode(BookmarkModel* model,
                int64 id,
                bool recursive,
                std::string* error);

}  // namespace bookmark_extension_helpers

#endif  // CHROME_BROWSER_BOOKMARKS_BOOKMARK_EXTENSION_HELPERS_H_