Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / common / extensions / api / webstore_private.json
bloba24198ee231fa62b5a3b806ca5c441083964c122
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": "installBundle",
187         "description": "Initiates the install process for the given bundle of extensions.",
188         "parameters": [
189           {
190             "name": "details",
191             "type": "object",
192             "properties": {
193               "localizedName": {
194                 "type": "string",
195                 "description": "A title to use for display in a confirmation dialog."
196               },
197               "iconUrl": {
198                 "type": "string",
199                 "optional": true,
200                 "desciption": "A URL for the image to display in the confirmation dialog"
201               },
202               "authuser": {
203                 "type": "string",
204                 "optional": true,
205                 "description": "The authuser index to be included with CRX download requests in multi-login sessions."
206               }
207             },
208             "additionalProperties": { "type": "any" }
209           },
210           {
211             "name": "contents",
212             "description": "An array of extension details to be installed.",
213             "type": "array",
214             "items": {
215               "type": "object",
216               "properties": {
217                 "id": {
218                   "type": "string",
219                   "description": "The id of the extension to be installed.",
220                   "minLength": 32,
221                   "maxLength": 32
222                 },
223                 "manifest": {
224                   "type": "string",
225                   "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.",
226                   "minLength": 1
227                 },
228                 "iconUrl": {
229                   "type": "string",
230                   "optional": true,
231                   "desciption": "A URL for the image to display in the confirmation dialog"
232                 },
233                 "localizedName": {
234                   "type": "string",
235                   "description": "A string to use instead of the raw value of the 'name' key from manifest.json."
236                 }
237               }
238             }
239           },
240           {
241             "name": "callback",
242             "type": "function",
243             "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'.",
244             "optional": true,
245             "parameters": []
246           }
247         ]
248       },
249       {
250         "name": "enableAppLauncher",
251         "description": "",
252         "parameters": [
253           {
254             "name": "callback",
255             "type": "function",
256             "optional": true,
257             "parameters": []
258           }
259         ]
260       },
261       {
262         "name": "getBrowserLogin",
263         "description": "Returns the logged-in sync user login if there is one, or the empty string otherwise.",
264         "parameters": [
265           {
266             "name": "callback",
267             "type": "function",
268             "optional": false,
269             "parameters": [
270               {
271                 "name": "info",
272                 "type": "object",
273                 "properties": {
274                   "login": { "type": "string" }
275                 }
276               }
277             ]
278           }
279         ]
280       },
281       {
282         "name": "getStoreLogin",
283         "description": "Returns the previous value set by setStoreLogin, or the empty string if there is none.",
284         "parameters": [
285           {
286             "name": "callback",
287             "type": "function",
288             "optional": false,
289             "parameters": [
290               { "name": "login", "type": "string" }
291             ]
292           }
293         ]
294       },
295       {
296         "name": "setStoreLogin",
297         "description": "Sets a preference value with the store login.",
298         "parameters": [
299           { "name": "login", "type": "string" },
300           {
301             "name": "callback",
302             "type": "function",
303             "optional": true,
304             "parameters": []
305           }
306         ]
307       },
308       {
309         "name": "getWebGLStatus",
310         "description": "Invokes a callback that returns whether WebGL is blacklisted or not.",
311         "parameters": [
312           {
313             "name": "callback",
314             "type": "function",
315             "optional": false,
316             "parameters": [
317               {
318                 "name": "webgl_status",
319                 "$ref": "WebGlStatus"
320               }
321             ]
322           }
323         ]
324       },
325       {
326         "name": "getIsLauncherEnabled",
327         "description": "Returns whether the apps launcher is enabled or not.",
328         "parameters": [
329           {
330             "name": "callback",
331             "type": "function",
332             "optional": false,
333             "parameters": [
334               { "name": "is_enabled", "type": "boolean" }
335             ]
336           }
337         ]
338       },
339       {
340         "name": "isInIncognitoMode",
341         "description": "Returns whether the browser is in incognito mode or not.",
342         "parameters": [
343           {
344             "name": "callback",
345             "type": "function",
346             "optional": false,
347             "parameters": [
348               { "name": "is_incognito", "type": "boolean" }
349             ]
350           }
351         ]
352       },
353       {
354         "name": "getEphemeralAppsEnabled",
355         "description": "Returns whether the ephemeral apps feature is enabled.",
356         "parameters": [
357           {
358             "name": "callback",
359             "type": "function",
360             "optional": false,
361             "parameters": [
362               { "name": "is_enabled", "type": "boolean" }
363             ]
364           }
365         ]
366       },
367       {
368         "name": "launchEphemeralApp",
369         "description": "Installs an app ephemerally in Chrome (if not already fully installed) and launches the app. A user gesture is required.",
370         "parameters": [
371           {
372             "name": "id",
373             "type": "string",
374             "description": "The extension id of the app to launch."
375           },
376           {
377             "name": "callback",
378             "type": "function",
379             "optional": true,
380             "parameters": [
381               {
382                 "name": "result",
383                 "$ref": "Result",
384                 "description": "Whether an attempt to launch an app succeeded, or the reason for failure."
385               }
386             ]
387           }
388         ]
389       }
390     ]
391   }