Upstream version 11.40.277.0
[platform/framework/web/crosswalk.git] / src / extensions / common / api / web_view_internal.json
1 // Copyright 2014 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": "webViewInternal",
8     "description": "none",
9     "compiler_options": {
10       "implemented_in": "extensions/browser/api/web_view/web_view_internal_api.h"
11     },
12     "types": [
13       {
14         "id": "DataTypeSet",
15         "type": "object",
16         "description": "A set of data types. Missing data types are interpreted as <code>false</code>.",
17         "properties": {
18           "appcache": {
19             "type": "boolean",
20             "optional": true,
21             "description": "Websites' appcaches."
22           },
23           "cookies": {
24             "type": "boolean",
25             "optional": true,
26             "description": "The browser's cookies."
27           },
28           "fileSystems": {
29             "type": "boolean",
30             "optional": true,
31             "description": "Websites' file systems."
32           },
33           "indexedDB": {
34             "type": "boolean",
35             "optional": true,
36             "description": "Websites' IndexedDB data."
37           },
38           "localStorage": {
39             "type": "boolean",
40             "optional": true,
41             "description": "Websites' local storage data."
42           },
43           "webSQL": {
44             "type": "boolean",
45             "optional": true,
46             "description": "Websites' WebSQL data."
47           }
48         }
49       },
50       {
51         "id": "RemovalOptions",
52         "type": "object",
53         "description": "Options that determine exactly what data will be removed.",
54         "properties": {
55           "since": {
56             "type": "number",
57             "optional": true,
58             "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)."
59           }
60         }
61       }
62     ],
63     "functions": [
64       {
65         "name": "executeScript",
66         "type": "function",
67         "description": "Injects JavaScript code into a <webview> page.",
68         "parameters": [
69           {
70             "type": "integer",
71             "name": "instanceId",
72             "description": "The instance ID of the guest <webview> process."
73           },
74           {
75             "type": "string",
76             "name": "src",
77             "description": "The src of the guest <webview> tag."
78           },
79           {
80             "$ref": "extensionTypes.InjectDetails",
81             "name": "details",
82             "description": "Details of the script to run."
83           },
84           {
85             "type": "function",
86             "name": "callback",
87             "optional": true,
88             "description": "Called after all the JavaScript has been executed.",
89             "parameters": [
90               {
91                 "name": "result",
92                 "optional": true,
93                 "type": "array",
94                 "items": {"type": "any", "minimum": 0},
95                 "description": "The result of the script in every injected frame."
96               }
97             ]
98           }
99         ]
100       },
101       {
102         "name": "insertCSS",
103         "type": "function",
104         "description": "Injects CSS into a <webview> page. For details, see the <a href='/extensions/content_scripts#pi'>programmatic injection</a> section of the content scripts doc.",
105         "parameters": [
106           {
107             "type": "integer",
108             "name": "instanceId",
109             "description": "The instance ID of the guest <webview> process."
110           },
111           {
112             "type": "string",
113             "name": "src",
114             "description": "The src of the guest <webview> tag."
115           },
116           {
117             "$ref": "extensionTypes.InjectDetails",
118             "name": "details",
119             "description": "Details of the CSS text to insert."
120           },
121           {
122             "type": "function",
123             "name": "callback",
124             "optional": true,
125             "description": "Called when all the CSS has been inserted.",
126             "parameters": []
127           }
128         ]
129       },
130       {
131         "name": "setZoom",
132         "type": "function",
133         "parameters": [
134           {
135             "type": "integer",
136             "name": "instanceId",
137             "description": "The instance ID of the guest <webview> process."
138           },
139           {
140             "type": "number",
141             "name": "zoomFactor",
142             "description" : "The new zoom factor."
143           },
144           {
145             "type": "function",
146             "name": "callback",
147             "description": "Called after the zoom message has been sent to the guest process.",
148             "optional": true,
149             "parameters": []
150           }
151         ]
152       },
153       {
154         "name": "getZoom",
155         "type": "function",
156         "parameters": [
157           {
158             "type": "integer",
159             "name": "instanceId",
160             "description": "The instance ID of the guest <webview> process."
161           },
162           {
163             "type": "function",
164             "name": "callback",
165             "description": "Called after the current zoom factor is retrieved.",
166             "parameters": [
167               {
168                 "type": "number",
169                 "name": "zoomFactor",
170                 "description": "The current zoom factor."
171               }
172             ]
173           }
174         ]
175       },
176       {
177         "name": "find",
178         "type": "function",
179         "description": "Initiates a find-in-page request.",
180         "parameters": [
181           {
182             "type": "integer",
183             "name": "instanceId",
184             "description": "The instance ID of the guest <webview> process."
185           },
186           {
187             "type": "string",
188             "name": "searchText",
189             "description": "The string to find in the page."
190           },
191           {
192             "type": "object",
193             "name": "options",
194             "optional": true,
195             "properties": {
196               "backward": {
197                 "type": "boolean",
198                 "description": "Flag to find matches in reverse order.",
199                 "optional": true
200               },
201               "matchCase": {
202                 "type": "boolean",
203                 "description": "Flag to match |searchText| with case-sensitivity.",
204                 "optional": true
205               }
206             }
207           },
208           {
209             "type": "function",
210             "name": "callback",
211             "description": "Called after all find results have been returned for this find request.",
212             "optional": true,
213             "parameters": [
214               {
215                 "type": "object",
216                 "name": "results",
217                 "optional": true,
218                 "properties": {
219                   "numberOfMatches": {
220                     "type": "integer",
221                     "description": "The number of times |searchText| was matched on the page."
222                   },
223                   "activeMatchOrdinal": {
224                     "type": "integer",
225                     "description": "The ordinal number of the current match."
226                   },
227                   "selectionRect": {
228                     "type": "object",
229                     "description": "Describes a rectangle around the active match.",
230                     "properties": {
231                       "left": {
232                         "type": "integer"
233                       },
234                       "top": {
235                         "type": "integer"
236                       },
237                       "width": {
238                         "type": "integer"
239                       },
240                       "height": {
241                         "type": "integer"
242                       }
243                     }
244                   },
245                   "canceled": {
246                     "type": "boolean",
247                     "description": "Indicates whether this find request was canceled."
248                   }
249                 }
250               }
251             ]
252           }
253         ]
254       },
255       {
256         "name": "stopFinding",
257         "type": "function",
258         "description": "Ends the current find session (clearing all highlighting) and cancels all find requests in progress.",
259         "parameters": [
260           {
261             "type": "integer",
262             "name": "instanceId",
263             "description": "The instance ID of the guest <webview> process."
264           },
265           {
266             "type": "string",
267             "name": "action",
268             "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.",
269             "optional": true,
270             "enum": ["clear", "keep", "activate"]
271           }
272         ]
273       },
274       {
275         "name": "loadDataWithBaseUrl",
276         "type": "function",
277         "description": "Loads a data URL with a specified base URL used for relative links. Optionally, a virtual URL can be provided to be shown to the user instead of the data URL.",
278         "parameters": [
279           {
280             "type": "integer",
281             "name": "instanceId",
282             "description": "The instance ID of the guest <webview> process."
283           },
284           {
285             "type": "string",
286             "name": "dataUrl",
287             "description" : "The data URL to load."
288           },
289           {
290             "type": "string",
291             "name": "baseUrl",
292             "description": "The base URL that will be used for relative links."
293           },
294           {
295             "type": "string",
296             "name": "virtualUrl",
297             "description": "The URL that will be displayed to the user.",
298             "optional": true
299           },
300           {
301             "type": "function",
302             "name": "callback",
303             "description": "Called internally for the purpose of reporting errors to console.error().",
304             "parameters": []
305           }
306         ]
307       },
308       {
309         "name": "go",
310         "type": "function",
311         "parameters": [
312           {
313             "type": "integer",
314             "name": "instanceId"
315           },
316           {
317             "type": "integer",
318             "name": "relativeIndex"
319           },
320           {
321             "type": "function",
322             "name": "callback",
323             "optional": true,
324             "parameters": [
325               {
326                 "name": "success",
327                 "type": "boolean",
328                 "description": "Indicates whether the navigation was successful."
329               }
330             ]
331           }
332         ]
333       },
334       {
335         "name": "overrideUserAgent",
336         "type": "function",
337         "parameters": [
338           {
339             "type": "integer",
340             "name": "instanceId"
341           },
342           {
343             "type": "string",
344             "name": "userAgentOverride"
345           }
346         ]
347       },
348       {
349         "name": "reload",
350         "type": "function",
351         "parameters": [
352           {
353             "type": "integer",
354             "name": "instanceId"
355           }
356         ]
357       },
358       {
359         "name": "setAllowTransparency",
360         "type": "function",
361         "parameters": [
362           {
363             "type": "integer",
364             "name": "instanceId"
365           },
366           {
367             "type": "boolean",
368             "name": "allow"
369           }
370         ]
371       },
372       {
373         "name": "setName",
374         "type": "function",
375         "parameters": [
376           {
377             "type": "integer",
378             "name": "instanceId"
379           },
380           {
381             "type": "string",
382             "name": "frameName"
383           }
384         ]
385       },
386       {
387         "name": "setPermission",
388         "type": "function",
389         "parameters": [
390           {
391             "type": "integer",
392             "name": "instanceId"
393           },
394           {
395             "type": "integer",
396             "name": "requestId"
397           },
398           {
399             "type": "string",
400             "name": "action",
401             "enum": ["allow", "deny", "default"]
402           },
403           {
404             "type": "string",
405             "name": "userInput",
406             "optional": true
407           },
408           {
409             "type": "function",
410             "name": "callback",
411             "optional": true,
412             "parameters": [
413               {
414                 "name": "allowed",
415                 "type": "boolean"
416               }
417             ]
418           }
419         ]
420       },
421       {
422         "name": "navigate",
423         "type": "function",
424         "parameters": [
425           {
426             "type": "integer",
427             "name": "instanceId"
428           },
429           {
430             "type": "string",
431             "name": "src"
432           }
433         ]
434       },
435       {
436         "name": "stop",
437         "type": "function",
438         "parameters": [
439           {
440             "type": "integer",
441             "name": "instanceId"
442           }
443         ]
444       },
445       {
446         "name": "terminate",
447         "type": "function",
448         "parameters": [
449           {
450             "type": "integer",
451             "name": "instanceId"
452           }
453         ]
454       },
455       {
456         "name": "clearData",
457         "type": "function",
458         "description": "Clears various types of browsing data stored in a storage partition of a <webview>.",
459         "parameters": [
460           {
461             "type": "integer",
462             "name": "instanceId",
463             "description": "The instance ID of the guest <webview> process."
464           },
465           {
466             "$ref": "RemovalOptions",
467             "name": "options"
468           },
469           {
470             "name": "dataToRemove",
471             "$ref": "DataTypeSet",
472             "description": "The set of data types to remove."
473           },
474           {
475             "name": "callback",
476             "type": "function",
477             "description": "Called when deletion has completed.",
478             "optional": true,
479             "parameters": []
480           }
481         ]
482       }
483     ]
484   }
485 ]