Enable Enterprise enrollment on desktop builds.
[chromium-blink-merge.git] / chrome / common / extensions / api / webview.json
blobe274343865b377a8d33955774a1812f8539a01a8
1 // Copyright (c) 2013 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": "webview",
8     "description": "none",
9     "dependencies": ["contextMenusInternal"],
10     "types": [
11       {
12         "id": "DataTypeSet",
13         "type": "object",
14         "description": "A set of data types. Missing data types are interpreted as <code>false</code>.",
15         "properties": {
16           "appcache": {
17             "type": "boolean",
18             "optional": true,
19             "description": "Websites' appcaches."
20           },
21           "cookies": {
22             "type": "boolean",
23             "optional": true,
24             "description": "The browser's cookies."
25           },
26           "fileSystems": {
27             "type": "boolean",
28             "optional": true,
29             "description": "Websites' file systems."
30           },
31           "indexedDB": {
32             "type": "boolean",
33             "optional": true,
34             "description": "Websites' IndexedDB data."
35           },
36           "localStorage": {
37             "type": "boolean",
38             "optional": true,
39             "description": "Websites' local storage data."
40           },
41           "webSQL": {
42             "type": "boolean",
43             "optional": true,
44             "description": "Websites' WebSQL data."
45           }
46         }
47       },
48       {
49         "id": "RemovalOptions",
50         "type": "object",
51         "description": "Options that determine exactly what data will be removed.",
52         "properties": {
53           "since": {
54             "type": "number",
55             "optional": true,
56             "description": "Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the <code>getTime</code> method of the JavaScript <code>Date</code> object). If absent, defaults to 0 (which would remove all browsing data)."
57           }
58         }
59       }
60     ],
61     "functions": [
62       {
63         "name": "contextMenusCreate",
64         "type": "function",
65         "returns": {
66           "choices": [
67             { "type": "integer" },
68             { "type": "string" }
69           ],
70           "description": "The ID of the newly created item."
71         },
72         "parameters": [
73           {
74             "type": "integer",
75             "name": "instanceId",
76             "nodoc": true
77           },
78           {
79             "type": "object",
80             "name": "createProperties",
81             "properties": {
82               "type": {
83                 "type": "string",
84                 "enum": ["normal", "checkbox", "radio", "separator"],
85                 "optional": true,
86                 "description": "The type of menu item. Defaults to 'normal' if not specified."
87               },
88               "id": {
89                 "type": "string",
90                 "optional": true,
91                 "description": "The unique ID to assign to this item. Cannot be the same as another ID for this webview."
92               },
93               "title": {
94                 "type": "string",
95                 "optional": true,
96                 "description": "The text to be displayed in the item; this is <em>required</em> unless <em>type</em> is 'separator'. When the context is 'selection', you can use <code>%s</code> within the string to show the selected text. For example, if this parameter's value is \"Translate '%s' to Pig Latin\" and the user selects the word \"cool\", the context menu item for the selection is \"Translate 'cool' to Pig Latin\"."
97               },
98               "checked": {
99                 "type": "boolean",
100                 "optional": true,
101                 "description": "The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items."
102               },
103               "contexts": {
104                 "type": "array",
105                 "items": {
106                   "type": "string",
107                   // |launcher| isn't actually supported, this is listed here so that we can build |contexts| using the same code from chrome.contextMenus API.
108                   "enum": ["all", "page", "frame", "selection", "link", "editable", "image", "video", "audio", "launcher"]
109                 },
110                 "minItems": 1,
111                 "optional": true,
112                 "description": "List of contexts this menu item will appear in. Defaults to ['page'] if not specified. Specifying ['all'] is equivalent to the combination of all other contexts except for 'launcher'. The 'launcher' context is not supported for <webview>."
113               },
114               "onclick": {
115                 "type": "function",
116                 "optional": true,
117                 "description": "A function that will be called back when the menu item is clicked.",
118                 "parameters": [
119                   {
120                     "name": "info",
121                     "$ref": "contextMenusInternal.OnClickData",
122                     "description": "Information about the item clicked and the context where the click happened."
123                   }
124                 ]
125               },
126               "parentId": {
127                 "choices": [
128                   { "type": "integer" },
129                   { "type": "string" }
130                 ],
131                 "optional": true,
132                 "description": "The ID of a parent menu item; this makes the item a child of a previously added item."
133               },
134               "documentUrlPatterns": {
135                 "type": "array",
136                 "items": {"type": "string"},
137                 "optional": true,
138                 "description": "Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see <a href='match_patterns.html'>Match Patterns</a>."
139               },
140               "targetUrlPatterns": {
141                 "type": "array",
142                 "items": {"type": "string"},
143                 "optional": true,
144                 "description": "Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags."
145               },
146               "enabled": {
147                 "type": "boolean",
148                 "optional": true,
149                 "description": "Whether this context menu item is enabled or disabled. Defaults to true."
150               }
151             }
152           },
153           {
154             "type": "function",
155             "name": "callback",
156             "optional": true,
157             "description": "Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError.",
158             "parameters": []
159           }
160         ]
161       },
162       {
163         "name": "contextMenusUpdate",
164         "type": "function",
165         "description": "Updates a previously created context menu item.",
166         "parameters": [
167           {
168             "type": "integer",
169             "name": "instanceId",
170             "nodoc": true
171           },
172           {
173             "choices": [
174               { "type": "integer" },
175               { "type": "string" }
176             ],
177             "name": "id",
178             "description": "The ID of the item to update."
179           },
180           { "type": "object",
181             "name": "updateProperties",
182             "description": "The properties to update. Accepts the same values as the create function.",
183             "properties": {
184               "type": {
185                 "type": "string",
186                 "enum": ["normal", "checkbox", "radio", "separator"],
187                 "optional": true
188               },
189               "title": {
190                 "type": "string",
191                 "optional": true
192               },
193               "checked": {
194                 "type": "boolean",
195                 "optional": true
196               },
197               "contexts": {
198                 "type": "array",
199                 "items": {
200                   "type": "string",
201                   // |launcher| isn't actually supported, this is listed here so that we can build |contexts| using the same code from chrome.contextMenus API.
202                   "enum": ["all", "page", "frame", "selection", "link", "editable", "image", "video", "audio", "launcher"]
203                 },
204                 "minItems": 1,
205                 "optional": true,
206                 "description": "List of contexts this menu item will appear in. Defaults to ['page'] if not specified. Specifying ['all'] is equivalent to the combination of all other contexts except for 'launcher'. The 'launcher' context is not supported for <webview>."
207               },
208               "onclick": {
209                 "type": "function",
210                 "optional": true
211               },
212               "parentId": {
213                 "choices": [
214                   { "type": "integer" },
215                   { "type": "string" }
216                 ],
217                 "optional": true,
218                 "description": "Note: You cannot change an item to be a child of one of its own descendants."
219               },
220               "documentUrlPatterns": {
221                 "type": "array",
222                 "items": {"type": "string"},
223                 "optional": true
224               },
225               "targetUrlPatterns": {
226                 "type": "array",
227                 "items": {"type": "string"},
228                 "optional": true
229               },
230               "enabled": {
231                 "type": "boolean",
232                 "optional": true
233               }
234             }
235           },
236           {
237             "type": "function",
238             "name": "callback",
239             "optional": true,
240             "parameters": [],
241             "description": "Called when the context menu has been updated."
242           }
243         ]
244       },
245       {
246         "name": "contextMenusRemove",
247         "type": "function",
248         "description": "Removes a context menu item.",
249         "parameters": [
250           {
251             "type": "integer",
252             "name": "instanceId",
253             "nodoc": true
254           },
255           {
256             "choices": [
257               { "type": "integer" },
258               { "type": "string" }
259             ],
260             "name": "menuItemId",
261             "description": "The ID of the context menu item to remove."
262           },
263           {
264             "type": "function",
265             "name": "callback",
266             "optional": true,
267             "parameters": [],
268             "description": "Called when the context menu has been removed."
269           }
270         ]
271       },
272       {
273         "name": "contextMenusRemoveAll",
274         "type": "function",
275         "description": "Removes all context menu items added by this webview.",
276         "parameters": [
277           {
278             "type": "integer",
279             "name": "instanceId",
280             "nodoc": true
281           },
282           {
283             "type": "function",
284             "name": "callback",
285             "optional": true,
286             "parameters": [],
287             "description": "Called when removal is complete."
288           }
289         ]
290       },
291       {
292         "name": "clearData",
293         "type": "function",
294         "description": "Clears various types of browsing data stored in a storage partition of a <webview>.",
295         "parameters": [
296           {
297             "type": "integer",
298             "name": "instanceId",
299             "description": "The instance ID of the guest <webview> process."
300           },
301           {
302             "$ref": "RemovalOptions",
303             "name": "options"
304           },
305           {
306             "name": "dataToRemove",
307             "$ref": "DataTypeSet",
308             "description": "The set of data types to remove."
309           },
310           {
311             "name": "callback",
312             "type": "function",
313             "description": "Called when deletion has completed.",
314             "optional": true,
315             "parameters": []
316           }
317         ]
318       },
319       {
320         "name": "executeScript",
321         "type": "function",
322         "description": "Injects JavaScript code into a <webview> page.",
323         "parameters": [
324           {
325             "type": "integer",
326             "name": "instanceId",
327             "description": "The instance ID of the guest <webview> process."
328           },
329           {
330             "type": "string",
331             "name": "src",
332             "description": "The src of the guest <webview> process."
333           },
334           {
335             "$ref": "tabs.InjectDetails",
336             "name": "details",
337             "description": "Details of the script to run."
338           },
339           {
340             "type": "function",
341             "name": "callback",
342             "optional": true,
343             "description": "Called after all the JavaScript has been executed.",
344             "parameters": [
345               {
346                 "name": "result",
347                 "optional": true,
348                 "type": "array",
349                 "items": {"type": "any", "minimum": 0},
350                 "description": "The result of the script in every injected frame."
351               }
352             ]
353           }
354         ]
355       },
356       {
357         "name": "insertCSS",
358         "type": "function",
359         "description": "Injects JavaScript code into a <webview> page.",
360         "parameters": [
361           {
362             "type": "integer",
363             "name": "instanceId",
364             "description": "The instance ID of the guest <webview> process."
365           },
366           {
367             "type": "string",
368             "name": "src",
369             "description": "The src of the guest <webview> process."
370           },
371           {
372             "$ref": "tabs.InjectDetails",
373             "name": "details",
374             "description": "Details of the script to run."
375           },
376           {
377             "type": "function",
378             "name": "callback",
379             "optional": true,
380             "description": "Called after all the JavaScript has been executed.",
381             "parameters": [
382               {
383                 "name": "result",
384                 "optional": true,
385                 "type": "array",
386                 "items": {"type": "any", "minimum": 0},
387                 "description": "The result of the script in every injected frame."
388               }
389             ]
390           }
391         ]
392       },
393       {
394         "name": "captureVisibleRegion",
395         "type": "function",
396         "description": "Captures the visible area of the currently loaded page inside <webview>.",
397         "parameters": [
398           {
399             "type": "integer",
400             "name": "instanceId",
401             "description": "The instance ID of the guest <webview> process."
402           },
403           {
404             "$ref": "types.ImageDetails",
405             "name": "options",
406             "optional": true
407           },
408           {
409             "type": "function", "name": "callback", "parameters": [
410               {"type": "string", "name": "dataUrl", "description": "A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display."}
411             ]
412           }
413         ]
414       },
415       {
416         "name": "setZoom",
417         "type": "function",
418         "parameters": [
419           {
420             "type": "integer",
421             "name": "instanceId",
422             "description": "The instance ID of the guest <webview> process."
423           },
424           {
425             "type": "number",
426             "name": "zoomFactor",
427             "description" : "The new zoom factor."
428           },
429           {
430             "type": "function",
431             "name": "callback",
432             "description": "Called after the zoom message has been sent to the guest process.",
433             "optional": true,
434             "parameters": []
435           }
436         ]
437       },
438       {
439         "name": "getZoom",
440         "type": "function",
441         "parameters": [
442           {
443             "type": "integer",
444             "name": "instanceId",
445             "description": "The instance ID of the guest <webview> process."
446           },
447           {
448             "type": "function",
449             "name": "callback",
450             "description": "Called after the current zoom factor is retreived.",
451             "parameters": [
452               {
453                 "type": "number",
454                 "name": "zoomFactor",
455                 "description": "The current zoom factor."
456               }
457             ]
458           }
459         ]
460       },
461       {
462         "name": "find",
463         "type": "function",
464         "description": "Initiates a find-in-page request.",
465         "parameters": [
466           {
467             "type": "integer",
468             "name": "instanceId",
469             "description": "The instance ID of the guest <webview> process."
470           },
471           {
472             "type": "string",
473             "name": "searchText",
474             "description": "The string to find in the page."
475           },
476           {
477             "type": "object",
478             "name": "options",
479             "optional": true,
480             "properties": {
481               "backward": {
482                 "type": "boolean",
483                 "description": "Flag to find matches in reverse order.",
484                 "optional": true
485               },
486               "matchCase": {
487                 "type": "boolean",
488                 "description": "Flag to match |searchText| with case-sensitivity.",
489                 "optional": true
490               }
491             }
492           },
493           {
494             "type": "function",
495             "name": "callback",
496             "description": "Called after all find results have been returned for this find request.",
497             "optional": true,
498             "parameters": [
499               {
500                 "type": "object",
501                 "name": "results",
502                 "optional": true,
503                 "properties": {
504                   "numberOfMatches": {
505                     "type": "integer",
506                     "description": "The number of times |searchText| was matched on the page."
507                   },
508                   "activeMatchOrdinal": {
509                     "type": "integer",
510                     "description": "The ordinal number of the current match."
511                   },
512                   "selectionRect": {
513                     "type": "object",
514                     "description": "Describes a rectangle around the active match.",
515                     "properties": {
516                       "left": {
517                         "type": "integer"
518                       },
519                       "top": {
520                         "type": "integer"
521                       },
522                       "width": {
523                         "type": "integer"
524                       },
525                       "height": {
526                         "type": "integer"
527                       }
528                     }
529                   },
530                   "canceled": {
531                     "type": "boolean",
532                     "description": "Indicates whether this find request was canceled."
533                   }
534                 }
535               }
536             ]
537           }
538         ]
539       },
540       {
541         "name": "stopFinding",
542         "type": "function",
543         "description": "Ends the current find session (clearing all highlighting) and cancels all find requests in progress.",
544         "parameters": [
545           {
546             "type": "integer",
547             "name": "instanceId",
548             "description": "The instance ID of the guest <webview> process."
549           },
550           {
551             "type": "string",
552             "name": "action",
553             "description": "Determines what to do with the active match after the find session has ended. 'clear' will clear the highlighting over the active match; 'keep' will keep the active match highlighted; 'activate' will keep the active match highlighted and simulate a user click on that match.",
554             "optional": true,
555             "enum": ["clear", "keep", "activate"]
556           }
557         ]
558       },
559       {
560         "name": "go",
561         "type": "function",
562         "parameters": [
563           {
564             "type": "integer",
565             "name": "instanceId"
566           },
567           {
568             "type": "integer",
569             "name": "relativeIndex"
570           }
571         ]
572       },
573       {
574         "name": "overrideUserAgent",
575         "type": "function",
576         "parameters": [
577           {
578             "type": "integer",
579             "name": "instanceId"
580           },
581           {
582             "type": "string",
583             "name": "userAgentOverride"
584           }
585         ]
586       },
587       {
588         "name": "reload",
589         "type": "function",
590         "parameters": [
591           {
592             "type": "integer",
593             "name": "instanceId"
594           }
595         ]
596       },
597       {
598         "name": "setPermission",
599         "type": "function",
600         "parameters": [
601           {
602             "type": "integer",
603             "name": "instanceId"
604           },
605           {
606             "type": "integer",
607             "name": "requestId"
608           },
609           {
610             "type": "string",
611             "name": "action",
612             "enum": ["allow", "deny", "default"]
613           },
614           {
615             "type": "string",
616             "name": "userInput",
617             "optional": true
618           },
619           {
620             "type": "function",
621             "name": "callback",
622             "optional": true,
623             "parameters": [
624               {
625                 "name": "allowed",
626                 "type": "boolean"
627               }
628             ]
629           }
630         ]
631       },
632       {
633         "name": "stop",
634         "type": "function",
635         "parameters": [
636           {
637             "type": "integer",
638             "name": "instanceId"
639           }
640         ]
641       },
642       {
643         "name": "terminate",
644         "type": "function",
645         "parameters": [
646           {
647             "type": "integer",
648             "name": "instanceId"
649           }
650         ]
651       }
652     ],
653     "events": [
654       {
655         "name": "onClicked",
656         "type": "function",
657         "nodoc": true,
658         "$ref": "contextMenusInternal.onClicked"
659       }
660     ]
661   }