Enable Enterprise enrollment on desktop builds.
[chromium-blink-merge.git] / chrome / common / extensions / api / bookmark_manager_private.json
bloba965d17f9e17e37d082ffcb58f15165053a99c98
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.
6   {
7     "namespace": "bookmarkManagerPrivate",
8     "description": "none",
9     "types": [
10       {
11         "id": "BookmarkNodeDataElement",
12         "type": "object",
13         "properties": {
14           "id": {
15             "type": "string",
16             "optional": true,
17             "description": "The ID of the bookmark. This is only provided if the data is from the same profile."
18           },
19           "parentId": {
20             "type": "string",
21             "optional": true,
22             "description": "The ID of the parent of the bookmark. This is only provided if the data is from the same profile."
23           },
24           "title": {"type": "string"},
25           "url": {
26             "type": "string",
27             "optional": true
28           },
29           "children": {
30             "type": "array",
31             "items": {"$ref": "BookmarkNodeDataElement"}
32           }
33         }
34       },
35       {
36         "id": "BookmarkNodeData",
37         "type": "object",
38         "description": "Information about the drag and drop data for use with drag and drop events.",
39         "properties": {
40           "sameProfile": {"type": "boolean"},
41           "elements": {
42             "type": "array",
43             "items": {"$ref": "BookmarkNodeDataElement"}
44           }
45         }
46       },
47       {
48         "id": "MetaInfoFields",
49         "type": "object",
50         "description": "Collection of meta info fields.",
51         "additionalProperties": {"type": "string"}
52       }
53     ],
54     "functions": [
55       {
56         "name": "copy",
57         "type": "function",
58         "description": "Copies the given bookmarks into the clipboard",
59         "parameters": [
60           {
61             "name": "idList",
62             "description": "An array of string-valued ids",
63             "type": "array",
64             "items": {"type": "string"},
65             "minItems": 1
66           },
67           {"type": "function", "name": "callback", "optional": true, "parameters": []}
68         ]
69       },
70       {
71         "name": "cut",
72         "type": "function",
73         "description": "Cuts the given bookmarks into the clipboard",
74         "parameters": [
75           {
76             "name": "idList",
77             "description": "An array of string-valued ids",
78             "type": "array",
79             "items": {"type": "string"},
80             "minItems": 1
81           },
82           {"type": "function", "name": "callback", "optional": true, "parameters": []}
83         ]
84       },
85       {
86         "name": "paste",
87         "type": "function",
88         "description": "Pastes bookmarks from the clipboard into the parent folder after the last selected node",
89         "parameters": [
90           {"type": "string", "name": "parentId"},
91           {
92             "name": "selectedIdList",
93             "description": "An array of string-valued ids for selected bookmarks",
94             "optional": true,
95             "type": "array",
96             "items": {"type": "string"},
97             "minItems": 0
98           },
99           {"type": "function", "name": "callback", "optional": true, "parameters": []}
100         ]
101       },
102       {
103         "name": "canPaste",
104         "type": "function",
105         "description": "Whether there are any bookmarks that can be pasted",
106         "parameters": [
107           {"type": "string", "name": "parentId", "description": "The ID of the folder to paste into"},
108           {"type": "function", "name": "callback", "parameters": [
109             {"name": "result", "type": "boolean"}
110           ]}
111         ]
112       },
113       {
114         "name": "sortChildren",
115         "type": "function",
116         "description": "Sorts the children of a given folder",
117         "parameters": [
118           {"type": "string", "name": "parentId", "description": "The ID of the folder to sort the children of"}
119         ]
120       },
121       {
122         "name": "getStrings",
123         "type": "function",
124         "description": "Gets the i18n strings for the bookmark manager",
125         "parameters": [
126           {
127             "type": "function",
128              "name": "callback",
129              "parameters": [
130               {
131                 "name": "result",
132                 "type": "object",
133                 "additionalProperties": {"type": "string"}
134               }
135             ]
136           }
137         ]
138       },
139       {
140         "name": "startDrag",
141         "type": "function",
142         "description": "Begins dragging a set of bookmarks",
143         "parameters": [
144           {
145             "name": "idList",
146             "description": "An array of string-valued ids",
147             "type": "array",
148             "items": {"type": "string"},
149             "minItems": 1
150           },
151           {
152             "name": "isFromTouch",
153             "type": "boolean",
154             "description": "True if the drag was initiated from touch"
155           }
156         ]
157       },
158       {
159         "name": "drop",
160         "type": "function",
161         "description": "Performs the drop action of the drag and drop session",
162         "parameters": [
163           {
164             "name": "parentId",
165             "description": "The ID of the folder that the drop was made",
166             "type": "string"
167           },
168           {
169             "name": "index",
170             "description": "The index of the position to drop at. If left out the dropped items will be placed at the end of the existing children",
171             "type": "integer",
172             "minimum": 0,
173             "optional": true
174           }
175         ]
176       },
177       {
178         "name": "getSubtree",
179         "type": "function",
180         "description": "Retrieves a bookmark hierarchy from the given node.  If the node id is empty, it is the full tree.  If foldersOnly is true, it will only return folders, not actual bookmarks.",
181         "parameters": [
182           {
183             "name": "id",
184             "type": "string",
185             "description": "ID of the root of the tree to pull.  If empty, the entire tree will be returned."
186           },
187           {
188             "name": "foldersOnly",
189             "type": "boolean",
190             "description": "Pass true to only return folders."
191           },
192           {
193             "name": "callback",
194             "type": "function",
195             "parameters": [
196               {"name": "results", "type": "array", "items": { "$ref": "bookmarks.BookmarkTreeNode"} }
197             ]
198           }
199         ]
200       },
201       {
202         "name": "canEdit",
203         "type": "function",
204         "description": "Whether bookmarks can be modified",
205         "parameters": [
206           {"type": "function", "name": "callback", "parameters": [
207             {"name": "result", "type": "boolean"}
208           ]}
209         ]
210       },
211       {
212         "name": "canOpenNewWindows",
213         "type": "function",
214         "description": "Whether bookmarks can be opened in new windows",
215         "parameters": [
216           {"type": "function", "name": "callback", "parameters": [
217             {"name": "result", "type": "boolean"}
218           ]}
219         ]
220       },
221       {
222         "name": "removeTrees",
223         "type": "function",
224         "description": "Recursively removes list of bookmarks nodes.",
225         "parameters": [
226           {
227             "name": "idList",
228             "description": "An array of string-valued ids",
229             "type": "array",
230             "items": {"type": "string"},
231             "minItems": 1
232           },
233           {"type": "function", "name": "callback", "optional": true, "parameters": []}
234         ]
235       },
236       {
237         "name": "recordLaunch",
238         "type": "function",
239         "description": "",
240         "parameters": []
241       },
242       {
243         "name": "createWithMetaInfo",
244         "type": "function",
245         "description": "Mimics the functionality of bookmarks.create, but will additionally set the given meta info fields.",
246         "parameters": [
247           {
248             "name": "bookmark",
249             "$ref": "bookmarks.CreateDetails"
250           },
251           {
252             "name": "metaInfo",
253             "$ref": "MetaInfoFields"
254           },
255           {
256             "type": "function",
257             "name": "callback",
258             "optional": true,
259             "parameters": [
260               {
261                 "name": "result",
262                 "$ref": "bookmarks.BookmarkTreeNode"
263               }
264             ]
265           }
266         ]
267       },
268       {
269         "name": "getMetaInfo",
270         "type": "function",
271         "description": "Gets meta info from a bookmark node",
272         "parameters": [
273           {
274             "name": "id",
275             "description": "The id of the bookmark to retrieve meta info from",
276             "type": "string"
277           },
278           {
279             "name": "key",
280             "description": "The key for the meta info to retrieve. If omitted, all fields are returned",
281             "optional": true,
282             "type": "string"
283           },
284           {
285             "type": "function",
286             "name": "callback",
287             "parameters": [
288               {
289                 "name": "value",
290                 "description": "If a key was given, the value of the specified field, if present. Otherwise an object containing all meta info fields for the node.",
291                 "optional": true,
292                 // TODO(rfevang): Convert this to always return MetaInfoFields
293                 // if the API is made public.
294                 "choices": [
295                   {"type": "string"},
296                   {"$ref": "MetaInfoFields"}
297                 ]
298               }
299             ]
300           }
301         ]
302       },
303       {
304         "name": "setMetaInfo",
305         "type": "function",
306         "description": "Sets a meta info value for a bookmark node",
307         "parameters": [
308           {
309             "name": "id",
310             "description": "The id of the bookmark node to set the meta info on",
311             "type": "string"
312           },
313           {
314             "name": "key",
315             "description": "The key of the meta info to set",
316             "type": "string"
317           },
318           {
319             "name": "value",
320             "description": "The meta info to set",
321             "type": "string"
322           },
323           {
324             "name": "callback",
325             "type": "function",
326             "optional": true,
327             "parameters": []
328           }
329         ]
330       },
331       {
332         "name": "updateMetaInfo",
333         "type": "function",
334         "description": "Updates a set of meta info values for a bookmark node.",
335         "parameters": [
336           {
337             "name": "id",
338             "description": "The id of the bookmark node to update the meta info of.",
339             "type": "string"
340           },
341           {
342             "name": "metaInfoChanges",
343             "description": "A set of meta info key/value pairs to update.",
344             "$ref": "MetaInfoFields"
345           },
346           {
347             "name": "callback",
348             "type": "function",
349             "optional": true,
350             "parameters": []
351           }
352         ]
353       },
354       {
355         "name": "undo",
356         "type": "function",
357         "description": "Performs an undo of the last change to the bookmark model",
358         "parameters": []
359       },
360       {
361         "name": "redo",
362         "type": "function",
363         "description": "Performs a redo of last undone change to the bookmark model",
364         "parameters": []
365       },
366       {
367         "name": "getUndoInfo",
368         "type": "function",
369         "description": "Gets the information for the undo if available",
370         "parameters": [
371           {
372             "type": "function",
373             "name": "callback",
374             "parameters": [
375               {
376                 "name": "result",
377                 "type": "object",
378                 "properties": {
379                   "enabled" : {"type": "boolean", "description": "Whether there is an action to undo"},
380                   "label" : {"type": "string", "description": "The i18n label to use for the undo action"}
381                                 }
382               }
383             ]
384           }
385         ]
386       },
387       {
388         "name": "getRedoInfo",
389         "type": "function",
390         "description": "Gets the information for the redo if available",
391         "parameters": [
392           {
393             "type": "function",
394             "name": "callback",
395             "parameters": [
396               {
397                 "name": "result",
398                 "type": "object",
399                 "properties": {
400                   "enabled" : {"type": "boolean", "description": "Whether there is an action to redo"},
401                   "label" : {"type": "string", "description": "The i18n label to use for the redo action"}
402                                 }
403               }
404             ]
405           }
406         ]
407       }
408     ],
409     "events": [
410       {
411         "name": "onDragEnter",
412         "type": "function",
413         "description": "Fired when dragging bookmarks over the document",
414         "parameters": [
415           {"name": "bookmarkNodeData", "$ref": "BookmarkNodeData"}
416         ]
417       },
418       {
419         "name": "onDragLeave",
420         "type": "function",
421         "description": "Fired when the drag and drop leaves the document",
422         "parameters": [
423           {"name": "bookmarkNodeData", "$ref": "BookmarkNodeData"}
424         ]
425       },
426       {
427         "name": "onDrop",
428         "type": "function",
429         "description": "Fired when the user drops bookmarks on the document",
430         "parameters": [
431           {"name": "bookmarkNodeData", "$ref": "BookmarkNodeData"}
432         ]
433       },
434       {
435         "name": "onMetaInfoChanged",
436         "type": "function",
437         "description": "Fired when the meta info of a node changes.",
438         "parameters": [
439           {"name": "id", "type": "string"},
440           {"name": "metaInfoChanges", "$ref": "MetaInfoFields"}
441         ]
442       }
443     ]
444   }