Upstream version 11.39.266.0
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / api / management.json
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.
4
5 [
6   {
7     "namespace":"management",
8     "description": "The <code>chrome.management</code> API provides ways to manage the list of extensions/apps that are installed and running. It is particularly useful for extensions that <a href='override'>override</a> the built-in New Tab page.",
9     "types": [
10       {
11         "id": "IconInfo",
12         "description": "Information about an icon belonging to an extension, app, or theme.",
13         "type": "object",
14         "properties": {
15           "size": { "type": "integer", "description": "A number representing the width and height of the icon. Likely values include (but are not limited to) 128, 48, 24, and 16."  },
16           "url": { "type": "string", "description": "The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, for example), append <code>?grayscale=true</code> to the URL." }
17         }
18       },
19       {
20         "id": "LaunchType",
21         "type": "string",
22         "enum": ["OPEN_AS_REGULAR_TAB", "OPEN_AS_PINNED_TAB", "OPEN_AS_WINDOW", "OPEN_FULL_SCREEN"],
23         "description": "These are all possible app launch types."
24       },
25       {
26         "id": "ExtensionInfo",
27         "description": "Information about an installed extension, app, or theme.",
28         "type": "object",
29         "properties": {
30           "id": {
31             "description": "The extension's unique identifier.",
32             "type": "string"
33           },
34           "name": {
35             "description": "The name of this extension, app, or theme.",
36             "type": "string"
37           },
38           "shortName": {
39             "description": "A short version of the name of this extension, app, or theme.",
40             "type": "string"
41           },
42           "description": {
43             "description": "The description of this extension, app, or theme.",
44             "type": "string"
45           },
46           "version": {
47             "description": "The <a href='manifest/version'>version</a> of this extension, app, or theme.",
48             "type": "string"
49           },
50           "mayDisable": {
51             "description": "Whether this extension can be disabled or uninstalled by the user.",
52             "type": "boolean"
53           },
54           "enabled": {
55             "description": "Whether it is currently enabled or disabled.",
56             "type": "boolean"
57           },
58           "disabledReason": {
59             "description": "A reason the item is disabled.",
60             "type": "string",
61             "enum": ["unknown", "permissions_increase"],
62             "optional": true
63           },
64           "isApp": {
65             "description": "True if this is an app.",
66             "type": "boolean",
67             "deprecated": "Please use $(ref:management.ExtensionInfo.type)."
68           },
69           "type": {
70             "description": "The type of this extension, app, or theme.",
71             "type": "string",
72             "enum": ["extension", "hosted_app", "packaged_app", "legacy_packaged_app", "theme"]
73           },
74           "appLaunchUrl": {
75             "description": "The launch url (only present for apps).",
76             "type": "string",
77             "optional": true
78           },
79           "homepageUrl": {
80             "description": "The URL of the homepage of this extension, app, or theme.",
81             "type": "string",
82             "optional": true
83           },
84           "updateUrl": {
85             "description": "The update URL of this extension, app, or theme.",
86             "type": "string",
87             "optional": true
88           },
89           "offlineEnabled": {
90             "description": "Whether the extension, app, or theme declares that it supports offline.",
91             "type": "boolean"
92           },
93           "optionsUrl": {
94             "description": "The url for the item's options page, if it has one.",
95             "type": "string"
96           },
97           "icons": {
98             "description": "A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the <a href='manifest/icons'>manifest documentation on icons</a> for more details.",
99             "type": "array",
100             "optional": true,
101             "items": {
102               "$ref": "IconInfo"
103             }
104           },
105           "permissions": {
106             "description": "Returns a list of API based permissions.",
107             "type": "array",
108             "items" : {
109               "type": "string"
110             }
111           },
112           "hostPermissions": {
113             "description": "Returns a list of host based permissions.",
114             "type": "array",
115             "items" : {
116               "type": "string"
117             }
118           },
119           "installType": {
120             "description": "How the extension was installed. One of<br><var>admin</var>: The extension was installed because of an administrative policy,<br><var>development</var>: The extension was loaded unpacked in developer mode,<br><var>normal</var>: The extension was installed normally via a .crx file,<br><var>sideload</var>: The extension was installed by other software on the machine,<br><var>other</var>: The extension was installed by other means.",
121             "type": "string",
122             "enum": ["admin", "development", "normal", "sideload", "other"]
123           },
124           "launchType": {
125             "description": "The app launch type (only present for apps).",
126             "$ref": "LaunchType",
127             "optional": true
128           },
129           "availableLaunchTypes": {
130             "description": "The currently available launch types (only present for apps).",
131             "type": "array",
132             "optional": true,
133             "items": {
134               "$ref": "LaunchType"
135             }
136           }
137         }
138       }
139     ],
140     "functions": [
141       {
142         "name": "getAll",
143         "description": "Returns a list of information about installed extensions and apps.",
144         "parameters": [
145           {
146             "type": "function",
147             "name": "callback",
148             "optional": true,
149             "parameters": [
150               {
151                 "type": "array",
152                 "name": "result",
153                 "items": {
154                   "$ref": "ExtensionInfo"
155                 }
156               }
157             ]
158           }
159         ]
160       },
161       {
162         "name": "get",
163         "description": "Returns information about the installed extension, app, or theme that has the given ID.",
164         "parameters": [
165           {
166             "name": "id",
167             "type": "string",
168             "description": "The ID from an item of $(ref:management.ExtensionInfo)."
169           },
170           {
171             "type": "function",
172             "name": "callback",
173             "optional": true,
174             "parameters": [
175               {
176                 "name": "result",
177                 "$ref": "ExtensionInfo"
178               }
179             ]
180           }
181         ]
182       },
183       {
184         "name": "getSelf",
185         "description": "Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest.",
186         "parameters": [
187           {
188             "type": "function",
189             "name": "callback",
190             "optional": true,
191             "parameters": [
192               {
193                 "name": "result",
194                 "$ref": "ExtensionInfo"
195               }
196             ]
197           }
198         ]
199       },
200       {
201         "name": "getPermissionWarningsById",
202         "description": "Returns a list of <a href='permission_warnings'>permission warnings</a> for the given extension id.",
203         "parameters": [
204           { "name": "id",
205             "type": "string",
206             "description": "The ID of an already installed extension."
207           },
208           {
209             "name": "callback",
210             "type": "function",
211             "optional": true,
212             "parameters": [
213               {
214                 "name": "permissionWarnings",
215                 "type": "array",
216                 "items": { "type": "string" }
217               }
218             ]
219           }
220         ]
221       },
222       {
223         "name": "getPermissionWarningsByManifest",
224         "description": "Returns a list of <a href='permission_warnings'>permission warnings</a> for the given extension manifest string. Note: This function can be used without requesting the 'management' permission in the manifest.",
225         "parameters": [
226           {
227             "name": "manifestStr",
228             "type": "string",
229             "description": "Extension manifest JSON string."
230           },
231           {
232             "name": "callback",
233             "type": "function",
234             "optional": true,
235             "parameters": [
236               {
237                 "name": "permissionWarnings",
238                 "type": "array",
239                 "items": { "type": "string" }
240               }
241             ]
242           }
243         ]
244       },
245       {
246         "name": "setEnabled",
247         "description": "Enables or disables an app or extension.",
248         "parameters": [
249           {
250             "name": "id",
251             "type": "string",
252             "description": "This should be the id from an item of $(ref:management.ExtensionInfo)."
253           },
254           {
255             "name": "enabled",
256             "type": "boolean",
257             "description": "Whether this item should be enabled or disabled."
258           },
259           {
260             "name": "callback",
261             "type": "function",
262             "optional": true,
263             "parameters": []
264           }
265         ]
266       },
267       {
268         "name": "uninstall",
269         "description": "Uninstalls a currently installed app or extension.",
270         "parameters": [
271           {
272             "name": "id",
273             "type": "string",
274             "description": "This should be the id from an item of $(ref:management.ExtensionInfo)."
275           },
276           {
277             "type": "object",
278             "name": "options",
279             "optional": true,
280             "properties": {
281               "showConfirmDialog": {
282                 "type": "boolean",
283                 "optional": true,
284                 "description": "Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false for self uninstalls. If an extension uninstalls another extension, this parameter is ignored and the dialog is always shown."
285               }
286             }
287           },
288           {
289             "name": "callback",
290             "type": "function",
291             "optional": true,
292             "parameters": []
293           }
294         ]
295       },
296       {
297         "name": "uninstallSelf",
298         "description": "Uninstalls the calling extension. Note: This function can be used without requesting the 'management' permission in the manifest.",
299         "parameters": [
300           {
301             "type": "object",
302             "name": "options",
303             "optional": true,
304             "properties": {
305               "showConfirmDialog": {
306                 "type": "boolean",
307                 "optional": true,
308                 "description": "Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false."
309               }
310             }
311           },
312           {
313             "name": "callback",
314             "type": "function",
315             "optional": true,
316             "parameters": []
317           }
318         ]
319       },
320       {
321         "name": "launchApp",
322         "description": "Launches an application.",
323         "parameters": [
324           {
325             "name": "id",
326             "type": "string",
327             "description": "The extension id of the application."
328           },
329           {
330             "name": "callback",
331             "type": "function",
332             "optional": true,
333             "parameters": []
334           }
335         ]
336       },
337       {
338         "name": "createAppShortcut",
339         "description": "Display options to create shortcuts for an app. On Mac, only packaged app shortcuts can be created.",
340         "parameters": [
341           {
342             "name": "id",
343             "type": "string",
344             "description": "This should be the id from an app item of $(ref:management.ExtensionInfo)."
345           },
346           {
347             "name": "callback",
348             "type": "function",
349             "optional": true,
350             "parameters": []
351           }
352         ]
353       },
354       {
355         "name": "setLaunchType",
356         "description": "Set the launch type of an app.",
357         "parameters": [
358           {
359             "name": "id",
360             "type": "string",
361             "description": "This should be the id from an app item of $(ref:management.ExtensionInfo)."
362           },
363           {
364             "name": "launchType",
365             "$ref": "LaunchType",
366             "description": "The target launch type. Always check and make sure this launch type is in $(ref:ExtensionInfo.availableLaunchTypes), because the available launch types vary on different platforms and configurations."
367           },
368           {
369             "name": "callback",
370             "type": "function",
371             "optional": true,
372             "parameters": []
373           }
374         ]
375       },
376       {
377         "name": "generateAppForLink",
378         "description": "Generate an app for a URL. Returns the generated bookmark app.",
379         "parameters": [
380           {
381             "name": "url",
382             "type": "string",
383             "description": "The URL of a web page. The scheme of the URL can only be \"http\" or \"https\"."
384           },
385           {
386             "name": "title",
387             "type": "string",
388             "description": "The title of the generated app."
389           },
390           {
391             "name": "callback",
392             "type": "function",
393             "optional": true,
394             "parameters":  [
395               {
396                 "name": "result",
397                 "$ref": "ExtensionInfo"
398               }
399             ]
400           }
401         ]
402       }
403     ],
404     "events": [
405       {
406         "name": "onInstalled",
407         "description": "Fired when an app or extension has been installed.",
408         "type": "function",
409         "parameters": [{"name": "info", "$ref":"ExtensionInfo"}]
410       },
411       {
412         "name": "onUninstalled",
413         "description": "Fired when an app or extension has been uninstalled.",
414         "type": "function",
415         "parameters": [
416           {
417            "name": "id",
418            "type": "string",
419            "description": "The id of the extension, app, or theme that was uninstalled."
420           }
421         ]
422       },
423       {
424         "name": "onEnabled",
425         "description": "Fired when an app or extension has been enabled.",
426         "type": "function",
427         "parameters": [{"name": "info", "$ref":"ExtensionInfo"}]
428       },
429       {
430         "name": "onDisabled",
431         "description": "Fired when an app or extension has been disabled.",
432         "type": "function",
433         "parameters": [{"name": "info", "$ref":"ExtensionInfo"}]
434       }
435     ]
436   }
437 ]