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