Add a webstorePrivate API to show a permission prompt for delegated bundle installs...
[chromium-blink-merge.git] / chrome / common / extensions / api / webstore_private.json
blob81463883873ebca0ca69c3e4ed86dab86dfd029b
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":"webstorePrivate",
8     "description": "none",
9     "types": [
10       {
11         "id": "Result",
12         "type": "string",
13         "enum": [{
14           "name": "",
15           "description": "Empty string, used to indicate success by beginInstallWithManifest3"
16         }, {
17           "name": "success",
18           "description": "Installation was successful"
19         }, {
20           "name": "user_gesture_required",
21           "description": "Function was called without a user gesture"
22         }, {
23           "name": "unknown_error",
24           "description": "An unknown error occured"
25         }, {
26           "name": "feature_disabled",
27           "description": "The requested feature is not available"
28         }, {
29           "name": "unsupported_extension_type",
30           "description": "The requested feature is not availabe for this type of extension"
31         }, {
32           "name": "missing_dependencies",
33           "description": "There were unsatisfied dependencies, such as shared modules"
34         }, {
35           "name": "install_error",
36           "description": "An error occured during installation"
37         }, {
38           "name": "user_cancelled",
39           "description": "The user canceled the operation"
40         }, {
41           "name": "invalid_id",
42           "description": "An invalid Chrome Web Store item ID was provided"
43         }, {
44           "name": "blacklisted",
45           "description": "The given extension is blacklisted"
46         }, {
47           "name": "blocked_by_policy",
48           "description": "The given extension is blocked by management policy"
49         }, {
50           "name": "install_in_progress",
51           "description": "An installation of the same extension is already in progress"
52         }, {
53           "name": "launch_in_progress",
54           "description": "A launch of the same extension is already in progress"
55         }, {
56           "name": "manifest_error",
57           "description": "Parsing of the extension manifest failed"
58         }, {
59           "name": "icon_error",
60           "description": "Failed to retrieve the extension's icon from the Web Store, or the icon was invalid"
61         }, {
62           "name": "invalid_icon_url",
63           "description": "An invalid icon URL was provided"
64         }, {
65           "name": "already_installed",
66           "description": "The extension is already installed"
67         }],
68         "description": "Whether the API call succeeded, or the reason for failure."
69       },
70       {
71         "id": "WebGlStatus",
72         "type": "string",
73         "enum": ["webgl_allowed", "webgl_blocked"]
74       }
75     ],
76     "functions": [
77       {
78         "name": "install",
79         "nocompile": true,
80         "description": "Installs the extension corresponding to the given id",
81         "parameters": [
82           {
83             "name": "expected_id",
84             "type": "string",
85             "description": "The id of the extension to install."
86           },
87           {
88             "name": "callback",
89             "type": "function",
90             "optional": true,
91             "parameters": []
92           }
93         ]
94       },
95       {
96         "name": "beginInstallWithManifest3",
97         "description": "Initiates the install process for the given extension.",
98         "parameters": [
99           {
100             "name": "details",
101             "type": "object",
102             "properties": {
103               "id": {
104                 "type": "string",
105                 "description": "The id of the extension to be installed.",
106                 "minLength": 32,
107                 "maxLength": 32
108               },
109               "manifest": {
110                 "type": "string",
111                 "description": "A string with the contents of the extension's manifest.json file. During the install process, the browser will check that the downloaded extension's manifest matches what was passed in here.",
112                 "minLength": 1
113               },
114               "iconUrl": {
115                 "type": "string",
116                 "optional": true,
117                 "desciption": "A URL for the image to display in the confirmation dialog"
118               },
119               "iconData": {
120                 "type": "string",
121                 "optional": true,
122                 "description": "An icon as a base64-encoded image, displayed in a confirmation dialog."
123               },
124               "localizedName": {
125                 "type": "string",
126                 "optional": true,
127                 "description": "A string to use instead of the raw value of the 'name' key from manifest.json."
128               },
129               "locale": {
130                 "type": "string",
131                 "optional": true,
132                 "description": "The name of the locale used for generating localizedName. This should be the name of one of the directories in the _locales folder of the extension, or the default_locale setting from the manifest."
133               },
134               "appInstallBubble": {
135                 "type": "boolean",
136                 "optional": true,
137                 "description": "A flag to change the UI we show when an app is installed - a value of true means to show a bubble pointing at the new tab button (instead of the default behavior of opening the new tab page and animating the app icon)."
138               },
139               "enableLauncher": {
140                 "type": "boolean",
141                 "optional": true,
142                 "description": "A flag to cause the app launcher to be installed before installing the extension, if it isn't installed already."
143               },
144               "authuser": {
145                 "type": "string",
146                 "optional": true,
147                 "description": "The authuser index to be included with CRX download requests in multi-login sessions."
148               }
149             },
150             "additionalProperties": { "type": "any" }
151           },
152           {
153             "name": "callback",
154             "type": "function",
155             "description": "Called when the user has either accepted/rejected the dialog, or some error occurred (such as invalid manifest or icon image data).",
156             "optional": true,
157             "parameters": [
158               {
159                 "name": "result",
160                 "$ref": "Result",
161                 "description": "A string result code, which will be empty upon success. The possible values in the case of errors include 'unknown_error', 'user_cancelled', 'manifest_error', 'icon_error', 'invalid_id', 'permission_denied', 'invalid_icon_url' and 'already_installed'."
162               }
163             ]
164           }
165         ]
167       },
168       {
169         "name": "completeInstall",
170         "description": "",
171         "parameters": [
172           {
173             "name": "expected_id",
174             "type": "string",
175             "description": "The id of the extension to be installed. This should match a previous call to beginInstallWithManifest3."
176           },
177           {
178             "name": "callback",
179             "type": "function",
180             "optional": true,
181             "parameters": []
182           }
183         ]
184       },
185       {
186         "name": "showPermissionPromptForDelegatedInstall",
187         "description": "Shows a permission prompt for the given extension, for installing to a different account.",
188         "parameters": [
189           {
190             "name": "details",
191             "type": "object",
192             "properties": {
193               "id": {
194                 "type": "string",
195                 "description": "The id of the extension to be installled.",
196                 "minLength": 32,
197                 "maxLength": 32
198               },
199               "manifest": {
200                 "type": "string",
201                 "description": "A string with the contents of the extension's manifest.json file. During the install process, the browser will check that the downloaded extension's manifest matches what was passed in here.",
202                 "minLength": 1
203               },
204               "delegatedUser": {
205                 "type": "string",
206                 "description": "The display name of the user for whom the extension should be installed."
207               },
208               "iconUrl": {
209                 "type": "string",
210                 "optional": true,
211                 "desciption": "A URL for the image to display in the confirmation dialog"
212               },
213               "iconData": {
214                 "type": "string",
215                 "optional": true,
216                 "description": "An icon as a base64-encoded image, displayed in a confirmation dialog."
217               },
218               "localizedName": {
219                 "type": "string",
220                 "optional": true,
221                 "description": "A string to use instead of the raw value of the 'name' key from manifest.json."
222               }
223             }
224           },
225           {
226             "name": "callback",
227             "type": "function",
228             "description": "Called when the user has either accepted/rejected the dialog, or some error occurred (such as invalid manifest or icon image data).",
229             "optional": true,
230             "parameters": [
231               {
232                 "name": "result",
233                 "$ref": "Result",
234                 "description": "A string result code, which will be empty upon success. The possible values in the case of errors include 'unknown_error', 'user_cancelled', 'manifest_error', 'icon_error', 'invalid_id', and 'invalid_icon_url'."
235               }
236             ]
237           }
238         ]
239       },
240       {
241         "name": "installBundle",
242         "description": "Initiates the install process for the given bundle of extensions.",
243         "parameters": [
244           {
245             "name": "details",
246             "type": "object",
247             "properties": {
248               "localizedName": {
249                 "type": "string",
250                 "description": "A title to use for display in a confirmation dialog."
251               },
252               "iconUrl": {
253                 "type": "string",
254                 "optional": true,
255                 "desciption": "A URL for the image to display in the confirmation dialog"
256               },
257               "authuser": {
258                 "type": "string",
259                 "optional": true,
260                 "description": "The authuser index to be included with CRX download requests in multi-login sessions."
261               }
262             },
263             "additionalProperties": { "type": "any" }
264           },
265           {
266             "name": "contents",
267             "description": "An array of extension details to be installed.",
268             "type": "array",
269             "items": {
270               "type": "object",
271               "properties": {
272                 "id": {
273                   "type": "string",
274                   "description": "The id of the extension to be installed.",
275                   "minLength": 32,
276                   "maxLength": 32
277                 },
278                 "manifest": {
279                   "type": "string",
280                   "description": "A string with the contents of the extension's manifest.json file. During the install process, the browser will check that the downloaded extension's manifest matches what was passed in here.",
281                   "minLength": 1
282                 },
283                 "iconUrl": {
284                   "type": "string",
285                   "optional": true,
286                   "desciption": "A URL for the image to display in the confirmation dialog"
287                 },
288                 "localizedName": {
289                   "type": "string",
290                   "description": "A string to use instead of the raw value of the 'name' key from manifest.json."
291                 }
292               }
293             }
294           },
295           {
296             "name": "callback",
297             "type": "function",
298             "description": "Called when the install process completes. Upon failures, chrome.runtime.lastError will be set to 'Invalid bundle', 'Invalid icon url', 'This item is already installed', or 'User cancelled install'.",
299             "optional": true,
300             "parameters": []
301           }
302         ]
303       },
304       {
305         "name": "showPermissionPromptForDelegatedBundleInstall",
306         "description": "Shows a permission prompt for the given bundle, for installing to a different account.",
307         "parameters": [
308           {
309             "name": "details",
310             "type": "object",
311             "properties": {
312               "localizedName": {
313                 "type": "string",
314                 "description": "A title to use for display in a confirmation dialog."
315               },
316               "delegatedUser": {
317                 "type": "string",
318                 "description": "The display name of the user for whom the extension should be installed."
319               },
320               "iconUrl": {
321                 "type": "string",
322                 "optional": true,
323                 "desciption": "A URL for the image to display in the confirmation dialog"
324               }
325             },
326             "additionalProperties": { "type": "any" }
327           },
328           {
329             "name": "contents",
330             "description": "An array of extension details to be installed.",
331             "type": "array",
332             "items": {
333               "type": "object",
334               "properties": {
335                 "id": {
336                   "type": "string",
337                   "description": "The id of the extension to be installed.",
338                   "minLength": 32,
339                   "maxLength": 32
340                 },
341                 "manifest": {
342                   "type": "string",
343                   "description": "A string with the contents of the extension's manifest.json file. During the install process, the browser will check that the downloaded extension's manifest matches what was passed in here.",
344                   "minLength": 1
345                 },
346                 "iconUrl": {
347                   "type": "string",
348                   "optional": true,
349                   "desciption": "A URL for the image to display in the confirmation dialog"
350                 },
351                 "localizedName": {
352                   "type": "string",
353                   "description": "A string to use instead of the raw value of the 'name' key from manifest.json."
354                 }
355               }
356             }
357           },
358           {
359             "name": "callback",
360             "type": "function",
361             "description": "Called when the install process completes. Upon failures, chrome.runtime.lastError will be set to 'Invalid bundle', 'Invalid icon url', or 'User cancelled install'.",
362             "optional": true,
363             "parameters": []
364           }
365         ]
366       },
367       {
368         "name": "enableAppLauncher",
369         "description": "",
370         "parameters": [
371           {
372             "name": "callback",
373             "type": "function",
374             "optional": true,
375             "parameters": []
376           }
377         ]
378       },
379       {
380         "name": "getBrowserLogin",
381         "description": "Returns the logged-in sync user login if there is one, or the empty string otherwise.",
382         "parameters": [
383           {
384             "name": "callback",
385             "type": "function",
386             "optional": false,
387             "parameters": [
388               {
389                 "name": "info",
390                 "type": "object",
391                 "properties": {
392                   "login": { "type": "string" }
393                 }
394               }
395             ]
396           }
397         ]
398       },
399       {
400         "name": "getStoreLogin",
401         "description": "Returns the previous value set by setStoreLogin, or the empty string if there is none.",
402         "parameters": [
403           {
404             "name": "callback",
405             "type": "function",
406             "optional": false,
407             "parameters": [
408               { "name": "login", "type": "string" }
409             ]
410           }
411         ]
412       },
413       {
414         "name": "setStoreLogin",
415         "description": "Sets a preference value with the store login.",
416         "parameters": [
417           { "name": "login", "type": "string" },
418           {
419             "name": "callback",
420             "type": "function",
421             "optional": true,
422             "parameters": []
423           }
424         ]
425       },
426       {
427         "name": "getWebGLStatus",
428         "description": "Invokes a callback that returns whether WebGL is blacklisted or not.",
429         "parameters": [
430           {
431             "name": "callback",
432             "type": "function",
433             "optional": false,
434             "parameters": [
435               {
436                 "name": "webgl_status",
437                 "$ref": "WebGlStatus"
438               }
439             ]
440           }
441         ]
442       },
443       {
444         "name": "getIsLauncherEnabled",
445         "description": "Returns whether the apps launcher is enabled or not.",
446         "parameters": [
447           {
448             "name": "callback",
449             "type": "function",
450             "optional": false,
451             "parameters": [
452               { "name": "is_enabled", "type": "boolean" }
453             ]
454           }
455         ]
456       },
457       {
458         "name": "isInIncognitoMode",
459         "description": "Returns whether the browser is in incognito mode or not.",
460         "parameters": [
461           {
462             "name": "callback",
463             "type": "function",
464             "optional": false,
465             "parameters": [
466               { "name": "is_incognito", "type": "boolean" }
467             ]
468           }
469         ]
470       },
471       {
472         "name": "getEphemeralAppsEnabled",
473         "description": "Returns whether the ephemeral apps feature is enabled.",
474         "parameters": [
475           {
476             "name": "callback",
477             "type": "function",
478             "optional": false,
479             "parameters": [
480               { "name": "is_enabled", "type": "boolean" }
481             ]
482           }
483         ]
484       },
485       {
486         "name": "launchEphemeralApp",
487         "description": "Installs an app ephemerally in Chrome (if not already fully installed) and launches the app. A user gesture is required.",
488         "parameters": [
489           {
490             "name": "id",
491             "type": "string",
492             "description": "The extension id of the app to launch."
493           },
494           {
495             "name": "callback",
496             "type": "function",
497             "optional": true,
498             "parameters": [
499               {
500                 "name": "result",
501                 "$ref": "Result",
502                 "description": "Whether an attempt to launch an app succeeded, or the reason for failure."
503               }
504             ]
505           }
506         ]
507       }
508     ]
509   }