Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / common / extensions / api / bookmarks.json
blob81b3a2af0401d6b90b37ff7643a273b557f5ca54
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": "bookmarks",
8     "description": "Use the <code>chrome.bookmarks</code> API to create, organize, and otherwise manipulate bookmarks. Also see <a href='override'>Override Pages</a>, which you can use to create a custom Bookmark Manager page.",
9     "properties": {
10       "MAX_WRITE_OPERATIONS_PER_HOUR": {
11         "value": 1000000,
12         "deprecated": "Bookmark write operations are no longer limited by Chrome.",
13         "description": ""
14       },
15       "MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE": {
16         "value": 1000000,
17         "deprecated": "Bookmark write operations are no longer limited by Chrome.",
18         "description": ""
19       }
20     },
21     "types": [
22       {
23         "id": "BookmarkTreeNodeUnmodifiable",
24         "type": "string",
25         "enum": ["managed"],
26         "description": "Indicates the reason why this node is unmodifiable. The <var>managed</var> value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default)."
27       },
28       {
29         "id": "BookmarkTreeNode",
30         "type": "object",
31         "description": "A node (either a bookmark or a folder) in the bookmark tree.  Child nodes are ordered within their parent folder.",
32         "properties": {
33           "id": {
34             "type": "string",
35             "minimum": 0,
36             "description": "The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the browser is restarted."
37           },
38           "parentId": {
39             "type": "string",
40             "minimum": 0,
41             "optional": true,
42             "description": "The <code>id</code> of the parent folder.  Omitted for the root node."
43           },
44           "index": {
45             "type": "integer",
46             "optional": true,
47             "description": "The 0-based position of this node within its parent folder."
48           },
49           "url": {
50             "type": "string",
51             "optional": true,
52             "description": "The URL navigated to when a user clicks the bookmark. Omitted for folders."
53           },
54           "title": {
55             "type": "string",
56             "description": "The text displayed for the node."
57           },
58           "dateAdded": {
59             "type": "number",
60             "optional": true,
61             "description": "When this node was created, in milliseconds since the epoch (<code>new Date(dateAdded)</code>)."
62           },
63           "dateGroupModified": {
64             "type": "number",
65             "optional": true,
66             "description": "When the contents of this folder last changed, in milliseconds since the epoch."
67           },
68           "unmodifiable": {
69             "$ref": "BookmarkTreeNodeUnmodifiable",
70             "optional": true,
71             "description": "Indicates the reason why this node is unmodifiable. The <var>managed</var> value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default)."
72           },
73           "children": {
74             "type": "array",
75             "optional": true,
76             "items": { "$ref": "BookmarkTreeNode" },
77             "description": "An ordered list of children of this node."
78           }
79         }
80       },
81       {
82         "id": "CreateDetails",
83         "description": "Object passed to the create() function.",
84         "inline_doc": true,
85         "type": "object",
86         "properties": {
87           "parentId": {
88             "type": "string",
89             "serialized_type": "int64",
90             "optional": true,
91             "description": "Defaults to the Other Bookmarks folder."
92           },
93           "index": {
94             "type": "integer",
95             "minimum": 0,
96             "optional": true
97           },
98           "title": {
99             "type": "string",
100             "optional": true
101           },
102           "url": {
103             "type": "string",
104             "optional": true
105           }
106         }
107       }
108     ],
109     "functions": [
110       {
111         "name": "get",
112         "type": "function",
113         "description": "Retrieves the specified BookmarkTreeNode(s).",
114         "parameters": [
115           {
116             "name": "idOrIdList",
117             "description": "A single string-valued id, or an array of string-valued ids",
118             "choices": [
119               {
120                 "type": "string",
121                 "serialized_type": "int64"
122               },
123               {
124                 "type": "array",
125                 "items": {
126                   "type": "string",
127                   "serialized_type": "int64"
128                 },
129                 "minItems": 1
130               }
131             ]
132           },
133           {
134             "type": "function",
135             "name": "callback",
136             "parameters": [
137               {
138                 "name": "results",
139                 "type": "array",
140                 "items": { "$ref": "BookmarkTreeNode" }
141               }
142             ]
143           }
144         ]
145       },
146       {
147         "name": "getChildren",
148         "type": "function",
149         "description": "Retrieves the children of the specified BookmarkTreeNode id.",
150         "parameters": [
151           {
152             "type": "string",
153             "serialized_type": "int64",
154             "name": "id"
155           },
156           {
157             "type": "function",
158             "name": "callback",
159             "parameters": [
160               {
161                 "name": "results",
162                 "type": "array",
163                 "items": { "$ref": "BookmarkTreeNode"}
164               }
165             ]
166           }
167         ]
168       },
169       {
170         "name": "getRecent",
171         "type": "function",
172         "description": "Retrieves the recently added bookmarks.",
173         "parameters": [
174           {
175             "type": "integer",
176             "minimum": 1,
177             "name": "numberOfItems",
178             "description": "The maximum number of items to return."
179           },
180           {
181             "type": "function",
182             "name": "callback",
183             "parameters": [
184               {
185                 "name": "results",
186                 "type": "array",
187                 "items": { "$ref": "BookmarkTreeNode" }
188               }
189             ]
190           }
191         ]
192       },
193       {
194         "name": "getTree",
195         "type": "function",
196         "description": "Retrieves the entire Bookmarks hierarchy.",
197         "parameters": [
198           {
199             "type": "function",
200             "name": "callback",
201             "parameters": [
202               {
203                 "name": "results",
204                 "type": "array",
205                 "items": { "$ref": "BookmarkTreeNode" }
206               }
207             ]
208           }
209         ]
210       },
211       {
212         "name": "getSubTree",
213         "type": "function",
214         "description": "Retrieves part of the Bookmarks hierarchy, starting at the specified node.",
215         "parameters": [
216           {
217             "type": "string",
218             "serialized_type": "int64",
219             "name": "id",
220             "description": "The ID of the root of the subtree to retrieve."
221           },
222           {
223             "type": "function",
224             "name": "callback",
225             "parameters": [
226               {
227                 "name": "results",
228                 "type": "array",
229                 "items": { "$ref": "BookmarkTreeNode" }
230               }
231             ]
232           }
233         ]
234       },
235       {
236         "name": "search",
237         "type": "function",
238         "description": "Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.",
239         "parameters": [
240           {
241             "name": "query",
242             "description": "Either a string of words and quoted phrases that are matched against bookmark URLs and titles, or an object. If an object, the properties <code>query</code>, <code>url</code>, and <code>title</code> may be specified and bookmarks matching all specified properties will be produced.",
243             "choices": [
244               {
245                 "type": "string",
246                 "description": "A string of words and quoted phrases that are matched against bookmark URLs and titles."
247               },
248               {
249                 "type": "object",
250                 "description": "An object specifying properties and values to match when searching. Produces bookmarks matching all properties.",
251                 "properties": {
252                   "query": {
253                     "type": "string",
254                     "optional": true,
255                     "description": "A string of words and quoted phrases that are matched against bookmark URLs and titles."
256                   },
257                   "url": {
258                     "type": "string",
259                     "optional": true,
260                     "description": "The URL of the bookmark; matches verbatim. Note that folders have no URL."
261                   },
262                   "title": {
263                     "type": "string",
264                     "optional": true,
265                     "description": "The title of the bookmark; matches verbatim."
266                   }
267                 }
268               }
269             ]
270           },
271           {
272             "type": "function",
273             "name": "callback",
274             "parameters": [
275               {
276                 "name": "results",
277                 "type": "array",
278                 "items": { "$ref": "BookmarkTreeNode" }
279               }
280             ]
281           }
282         ]
283       },
284       {
285         "name": "create",
286         "type": "function",
287         "description": "Creates a bookmark or folder under the specified parentId.  If url is NULL or missing, it will be a folder.",
288         "parameters": [
289           {
290             "$ref": "CreateDetails",
291             "name": "bookmark"
292           },
293           {
294             "type": "function",
295             "name": "callback",
296             "optional": true,
297             "parameters": [
298               {
299                 "name": "result",
300                 "$ref": "BookmarkTreeNode"
301               }
302             ]
303           }
304         ]
305       },
306       {
307         "name": "move",
308         "type": "function",
309         "description": "Moves the specified BookmarkTreeNode to the provided location.",
310         "parameters": [
311           {
312             "type": "string",
313             "serialized_type": "int64",
314             "name": "id"
315           },
316           {
317             "type": "object",
318             "name": "destination",
319             "properties": {
320               "parentId": {
321                 "type": "string",
322                 "optional": true
323               },
324               "index": {
325                 "type": "integer",
326                 "minimum": 0,
327                 "optional": true
328               }
329             }
330           },
331           {
332             "type": "function",
333             "name": "callback",
334             "optional": true,
335             "parameters": [
336               {
337                 "name": "result",
338                 "$ref": "BookmarkTreeNode"
339               }
340             ]
341           }
342         ]
343       },
344       {
345         "name": "update",
346         "type": "function",
347         "description": "Updates the properties of a bookmark or folder. Specify only the properties that you want to change; unspecified properties will be left unchanged.  <b>Note:</b> Currently, only 'title' and 'url' are supported.",
348         "parameters": [
349           {
350             "type": "string",
351             "serialized_type": "int64",
352             "name": "id"
353           },
354           {
355             "type": "object",
356             "name": "changes",
357             "properties": {
358               "title": {
359                 "type": "string",
360                 "optional": true
361               },
362               "url": {
363                 "type": "string",
364                 "optional": true
365               }
366             }
367           },
368           {
369             "type": "function",
370             "name": "callback",
371             "optional": true,
372             "parameters": [
373               {
374                 "name": "result",
375                 "$ref": "BookmarkTreeNode"
376               }
377             ]
378           }
379         ]
380       },
381       {
382         "name": "remove",
383         "type": "function",
384         "description": "Removes a bookmark or an empty bookmark folder.",
385         "parameters": [
386           {
387             "type": "string",
388             "serialized_type": "int64",
389             "name": "id"
390           },
391           {
392             "type": "function",
393             "name": "callback",
394             "optional": true,
395             "parameters": []
396           }
397         ]
398       },
399       {
400         "name": "removeTree",
401         "type": "function",
402         "description": "Recursively removes a bookmark folder.",
403         "parameters": [
404           {
405             "type": "string",
406             "serialized_type": "int64",
407             "name": "id"
408           },
409           {
410             "type": "function",
411             "name": "callback",
412             "optional": true,
413             "parameters": []
414           }
415         ]
416       },
417       {
418         "name": "import",
419         "type": "function",
420         "description": "Imports bookmarks from a chrome html bookmark file",
421         "nodoc": "true",
422         "parameters": [
423           {
424             "type": "function",
425             "name": "callback",
426             "optional": true,
427             "parameters": []
428           }
429         ]
430       },
431       {
432         "name": "export",
433         "type": "function",
434         "description": "Exports bookmarks to a chrome html bookmark file",
435         "nodoc": "true",
436         "parameters": [
437           {
438             "type": "function",
439             "name": "callback",
440             "optional": true,
441             "parameters": []
442           }
443         ]
444       }
445     ],
446     "events": [
447       {
448         "name": "onCreated",
449         "type": "function",
450         "description": "Fired when a bookmark or folder is created.",
451         "parameters": [
452           {
453             "type": "string",
454             "name": "id"
455           },
456           {
457             "$ref": "BookmarkTreeNode",
458             "name": "bookmark"
459           }
460         ]
461       },
462       {
463         "name": "onRemoved",
464         "type": "function",
465         "description": "Fired when a bookmark or folder is removed.  When a folder is removed recursively, a single notification is fired for the folder, and none for its contents.",
466         "parameters": [
467           {
468             "type": "string",
469             "name": "id"
470           },
471           {
472             "type": "object",
473             "name": "removeInfo",
474             "properties": {
475               "parentId": { "type": "string" },
476               "index": { "type": "integer" }
477             }
478           }
479         ]
480       },
481       {
482         "name": "onChanged",
483         "type": "function",
484         "description": "Fired when a bookmark or folder changes.  <b>Note:</b> Currently, only title and url changes trigger this.",
485         "parameters": [
486           {
487             "type": "string",
488             "name": "id"
489           },
490           {
491             "type": "object",
492             "name": "changeInfo",
493             "properties": {
494               "title": { "type": "string" },
495               "url": {
496                 "type": "string",
497                 "optional": true
498               }
499             }
500           }
501         ]
502       },
503       {
504         "name": "onMoved",
505         "type": "function",
506         "description": "Fired when a bookmark or folder is moved to a different parent folder.",
507         "parameters": [
508           {
509             "type": "string",
510             "name": "id"
511           },
512           {
513             "type": "object",
514             "name": "moveInfo",
515             "properties": {
516               "parentId": { "type": "string" },
517               "index": { "type": "integer" },
518               "oldParentId": { "type": "string" },
519               "oldIndex": { "type": "integer" }
520             }
521           }
522         ]
523       },
524       {
525         "name": "onChildrenReordered",
526         "type": "function",
527         "description": "Fired when the children of a folder have changed their order due to the order being sorted in the UI.  This is not called as a result of a move().",
528         "parameters": [
529           {
530             "type": "string",
531             "name": "id"
532           },
533           {
534             "type": "object",
535             "name": "reorderInfo",
536             "properties": {
537               "childIds": {
538                 "type": "array",
539                 "items": { "type": "string" }
540               }
541             }
542           }
543         ]
544       },
545       {
546         "name": "onImportBegan",
547         "type": "function",
548         "description": "Fired when a bookmark import session is begun.  Expensive observers should ignore onCreated updates until onImportEnded is fired.  Observers should still handle other notifications immediately.",
549         "parameters": []
550       },
551       {
552         "name": "onImportEnded",
553         "type": "function",
554         "description": "Fired when a bookmark import session is ended.",
555         "parameters": []
556       }
557     ]
558   }