Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1455)

Side by Side Diff: chrome/common/extensions/api/experimental.downloads.json

Issue 9452019: experimental.downloads extension api docs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: just download Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/common/extensions/docs/experimental.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 [ 1 [
2 { 2 {
3 "namespace": "experimental.downloads", 3 "namespace": "experimental.downloads",
4 "nodoc": "true",
5 "events": [ 4 "events": [
6 { 5 {
7 "name": "onCreated", 6 "name": "onCreated",
8 "type": "function", 7 "type": "function",
8 "nodoc": "true",
9 "description": "This event fires with the DownloadItem object when a dow nload begins.", 9 "description": "This event fires with the DownloadItem object when a dow nload begins.",
10 "parameters": [ 10 "parameters": [
11 {"name": "downloadItem", "$ref": "DownloadItem"} 11 {"name": "downloadItem", "$ref": "DownloadItem"}
12 ] 12 ]
13 }, 13 },
14 { 14 {
15 "name": "onChanged", 15 "name": "onChanged",
16 "type": "function", 16 "type": "function",
17 "nodoc": "true",
17 "description": "When any of a DownloadItem's properties except |bytesRec eived| changes, this event fires with the download id and an object containing t he properties that changed.", 18 "description": "When any of a DownloadItem's properties except |bytesRec eived| changes, this event fires with the download id and an object containing t he properties that changed.",
18 "parameters": [ 19 "parameters": [
19 {"name": "downloadDelta", "$ref": "DownloadDelta"} 20 {"name": "downloadDelta", "$ref": "DownloadDelta"}
20 ] 21 ]
21 }, 22 },
22 { 23 {
23 "name": "onErased", 24 "name": "onErased",
24 "type": "function", 25 "type": "function",
26 "nodoc": "true",
25 "description": "Fires with the download id when a download is erased fro m history.", 27 "description": "Fires with the download id when a download is erased fro m history.",
26 "parameters": [ 28 "parameters": [
27 {"type": "integer", "name": "downloadId"} 29 {"type": "integer", "name": "downloadId"}
28 ] 30 ]
29 } 31 }
30 ], 32 ],
31 "properties": { 33 "properties": {
32 "STATE_IN_PROGRESS": { 34 "STATE_IN_PROGRESS": {
33 "type": "string", 35 "type": "string",
36 "nodoc": "true",
34 "value": "in_progress", 37 "value": "in_progress",
35 "description": "The download is currently receiving data from the server ." 38 "description": "The download is currently receiving data from the server ."
36 }, 39 },
37 "STATE_INTERRUPTED": { 40 "STATE_INTERRUPTED": {
38 "type": "string", 41 "type": "string",
42 "nodoc": "true",
39 "value": "interrupted", 43 "value": "interrupted",
40 "description": "An error broke the connection with the file host." 44 "description": "An error broke the connection with the file host."
41 }, 45 },
42 "STATE_COMPLETE": { 46 "STATE_COMPLETE": {
43 "type": "string", 47 "type": "string",
48 "nodoc": "true",
44 "value": "complete", 49 "value": "complete",
45 "description": "The download has completed." 50 "description": "The download has completed."
46 }, 51 },
47 "DANGER_SAFE": { 52 "DANGER_SAFE": {
48 "type": "string", 53 "type": "string",
54 "nodoc": "true",
49 "value": "safe", 55 "value": "safe",
50 "description": "The file has been determined to present no known danger to the user's computer." 56 "description": "The file has been determined to present no known danger to the user's computer."
51 }, 57 },
52 "DANGER_FILE": { 58 "DANGER_FILE": {
53 "type": "string", 59 "type": "string",
60 "nodoc": "true",
54 "value": "file", 61 "value": "file",
55 "description": "The download's filename is suspicious." 62 "description": "The download's filename is suspicious."
56 }, 63 },
57 "DANGER_URL": { 64 "DANGER_URL": {
58 "type": "string", 65 "type": "string",
66 "nodoc": "true",
59 "value": "url", 67 "value": "url",
60 "description": "The download's URL is malicious." 68 "description": "The download's URL is malicious."
61 }, 69 },
62 "DANGER_CONTENT": { 70 "DANGER_CONTENT": {
63 "type": "string", 71 "type": "string",
72 "nodoc": "true",
64 "value": "content", 73 "value": "content",
65 "description": "The download's content is malicious." 74 "description": "The download's content is malicious."
66 }, 75 },
67 "ERROR_GENERIC": { 76 "ERROR_GENERIC": {
68 "type": "string", 77 "type": "string",
69 "value": "I'm afraid I can't do that.", 78 "value": "I'm afraid I can't do that.",
70 "description": "Generic error." 79 "description": "Generic error."
71 }, 80 },
72 "ERROR_INVALID_URL": { 81 "ERROR_INVALID_URL": {
73 "type": "string", 82 "type": "string",
74 "value": "Invalid URL.", 83 "value": "Invalid URL.",
75 "description": "The URL was invalid." 84 "description": "The URL was invalid."
76 }, 85 },
77 "ERROR_INVALID_OPERATION": { 86 "ERROR_INVALID_OPERATION": {
78 "type": "string", 87 "type": "string",
88 "nodoc": "true",
79 "value": "Invalid operation.", 89 "value": "Invalid operation.",
80 "description": "The requested operation cannot be performed at this time . This maybe due to the download being in a state where the requested operation is not allowed." 90 "description": "The requested operation cannot be performed at this time . This maybe due to the download being in a state where the requested operation is not allowed."
81 } 91 }
82 }, 92 },
83 "types": [ 93 "types": [
84 { 94 {
85 "id": "HttpHeaders", 95 "id": "HttpHeaders",
86 "type": "array", 96 "type": "array",
87 "description": "An array of HTTP headers. Each header is represented as a dictionary containing the keys <code>name</code> and either <code>value</code> or <code>binaryValue</code>.", 97 "description": "An array of HTTP headers. Each header is represented as a dictionary containing the keys <code>name</code> and either <code>value</code> or <code>binaryValue</code>.",
88 "items": { 98 "items": {
89 "type": "object", 99 "type": "object",
90 "properties": { 100 "properties": {
91 "name": {"type": "string", "description": "Name of the HTTP header." }, 101 "name": {"type": "string", "description": "Name of the HTTP header." },
92 "value": {"type": "string", "optional": true, "description": "Value of the HTTP header if it can be represented by UTF-8."}, 102 "value": {"type": "string", "optional": true, "description": "Value of the HTTP header if it can be represented by UTF-8."},
93 "binaryValue": { 103 "binaryValue": {
94 "type": "array", 104 "type": "array",
95 "optional": true, 105 "optional": true,
96 "description": "Value of the HTTP header if it cannot be represent ed by UTF-8, stored as individual byte values (0..255).", 106 "description": "Value of the HTTP header if it cannot be represent ed by UTF-8, stored as individual byte values (0..255).",
97 "items": {"type": "integer"} 107 "items": {"type": "integer"}
98 } 108 }
99 } 109 }
100 } 110 }
101 }, 111 },
102 { 112 {
103 "id": "DownloadItem", 113 "id": "DownloadItem",
104 "type": "object", 114 "type": "object",
115 "nodoc": "true",
105 "description": "The state of a file as it is downloaded from the interne t.", 116 "description": "The state of a file as it is downloaded from the interne t.",
106 "properties": { 117 "properties": {
107 "id": { 118 "id": {
108 "type": "integer", 119 "type": "integer",
109 "description": "An identifier that is persistent across browser sess ions." 120 "description": "An identifier that is persistent across browser sess ions."
110 }, 121 },
111 "url": { 122 "url": {
112 "type": "string", 123 "type": "string",
113 "description": "absolute URL" 124 "description": "absolute URL"
114 }, 125 },
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 "type": "integer", 173 "type": "integer",
163 "description": "Number of bytes in the whole file, without consideri ng file compression, or -1 if unknown." 174 "description": "Number of bytes in the whole file, without consideri ng file compression, or -1 if unknown."
164 }, 175 },
165 "fileSize": { 176 "fileSize": {
166 "type": "integer", 177 "type": "integer",
167 "description": "Number of bytes in the whole file post-decompression , or -1 if unknown." 178 "description": "Number of bytes in the whole file post-decompression , or -1 if unknown."
168 } 179 }
169 } 180 }
170 }, 181 },
171 { 182 {
172 "id": "DownloadOptions",
173 "type": "object",
174 "properties": {
175 "url": {
176 "type": "string",
177 "description": "The URL to download.",
178 "minLength": 1
179 },
180 "filename": {
181 "type": "string",
182 "description": "A file path relative to the Downloads directory to c ontain the downloaded file.",
183 "optional": true
184 },
185 "saveAs": {
186 "type": "boolean",
187 "optional": true,
188 "description": "Use a file-chooser to allow the user to select a fil ename."
189 },
190 "method": {
191 "type": "string",
192 "description": "The HTTP method to use if the URL uses the HTTP[S] p rotocol.",
193 "optional": true,
194 "enum": ["GET", "POST"]
195 },
196 "headers": {
197 "$ref": "HttpHeaders",
198 "description": "Extra HTTP headers to send with the request if the U RL uses the HTTP[s] protocol, restricted to those allowed by XMLHttpRequest.",
199 "optional": true
200 },
201 "body": {
202 "type": "string",
203 "description": "post body",
204 "optional": true
205 }
206 }
207 },
208 {
209 "id": "DownloadQuery", 183 "id": "DownloadQuery",
210 "type": "object", 184 "type": "object",
185 "nodoc": "true",
211 "description": "", 186 "description": "",
212 "properties": { 187 "properties": {
213 "query": { 188 "query": {
214 "type": "string", 189 "type": "string",
215 "description": "This space-separated string of search terms that may be grouped using quotation marks limits results to downloads whose filename or url contain all of the search terms that do not begin with a dash ‘-’ and none o f the search terms that do begin with a dash.", 190 "description": "This space-separated string of search terms that may be grouped using quotation marks limits results to downloads whose filename or url contain all of the search terms that do not begin with a dash ‘-’ and none o f the search terms that do begin with a dash.",
216 "optional": true 191 "optional": true
217 }, 192 },
218 "startedBefore": { 193 "startedBefore": {
219 "type": "integer", 194 "type": "integer",
220 "description": "Limits results to downloads that started before the given ms since the epoch.", 195 "description": "Limits results to downloads that started before the given ms since the epoch.",
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 "fileSize": { 310 "fileSize": {
336 "type": "integer", 311 "type": "integer",
337 "optional": true, 312 "optional": true,
338 "description": "Number of bytes in the whole file post-decompression , or -1 if unknown." 313 "description": "Number of bytes in the whole file post-decompression , or -1 if unknown."
339 } 314 }
340 } 315 }
341 }, 316 },
342 { 317 {
343 "id": "DownloadBooleanDiff", 318 "id": "DownloadBooleanDiff",
344 "type": "object", 319 "type": "object",
320 "nodoc": "true",
345 "description": "Encapsulates a change in a boolean DownloadItem field.", 321 "description": "Encapsulates a change in a boolean DownloadItem field.",
346 "properties": { 322 "properties": {
347 "old": { 323 "old": {
348 "type": "boolean", 324 "type": "boolean",
349 "optional": true 325 "optional": true
350 }, 326 },
351 "new": { 327 "new": {
352 "type": "boolean", 328 "type": "boolean",
353 "optional": true 329 "optional": true
354 } 330 }
355 } 331 }
356 }, 332 },
357 { 333 {
358 "id": "DownloadIntegerDiff", 334 "id": "DownloadIntegerDiff",
359 "type": "object", 335 "type": "object",
336 "nodoc": "true",
360 "description": "Encapsulates a change in an integer DownloadItem field." , 337 "description": "Encapsulates a change in an integer DownloadItem field." ,
361 "properties": { 338 "properties": {
362 "old": { 339 "old": {
363 "type": "integer", 340 "type": "integer",
364 "optional": true 341 "optional": true
365 }, 342 },
366 "new": { 343 "new": {
367 "type": "integer", 344 "type": "integer",
368 "optional": true 345 "optional": true
369 } 346 }
370 } 347 }
371 }, 348 },
372 { 349 {
373 "id": "DownloadStringDiff", 350 "id": "DownloadStringDiff",
374 "type": "object", 351 "type": "object",
352 "nodoc": "true",
375 "description": "Encapsulates a change in a string DownloadItem field.", 353 "description": "Encapsulates a change in a string DownloadItem field.",
376 "properties": { 354 "properties": {
377 "old": { 355 "old": {
378 "type": "string", 356 "type": "string",
379 "optional": true 357 "optional": true
380 }, 358 },
381 "new": { 359 "new": {
382 "type": "string", 360 "type": "string",
383 "optional": true 361 "optional": true
384 } 362 }
385 } 363 }
386 }, 364 },
387 { 365 {
388 "id": "DownloadDelta", 366 "id": "DownloadDelta",
389 "type": "object", 367 "type": "object",
368 "nodoc": "true",
390 "description": "Encapsulates a change in a DownloadItem.", 369 "description": "Encapsulates a change in a DownloadItem.",
391 "properties": { 370 "properties": {
392 "id": { 371 "id": {
393 "type": "integer", 372 "type": "integer",
394 "description": "An identifier that is persistent across browser sess ions." 373 "description": "An identifier that is persistent across browser sess ions."
395 }, 374 },
396 "url": { 375 "url": {
397 "$ref": "DownloadStringDiff", 376 "$ref": "DownloadStringDiff",
398 "optional": true 377 "optional": true
399 }, 378 },
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 "$ref": "DownloadIntegerDiff", 420 "$ref": "DownloadIntegerDiff",
442 "optional": true 421 "optional": true
443 }, 422 },
444 "fileSize": { 423 "fileSize": {
445 "$ref": "DownloadIntegerDiff", 424 "$ref": "DownloadIntegerDiff",
446 "optional": true 425 "optional": true
447 } 426 }
448 } 427 }
449 }, 428 },
450 { 429 {
451 "id": "DownloadFileIconOptions", 430 "id": "DownloadFileIconOptions",
asanka 2012/02/28 21:56:48 This isn't used anymore.
benjhayden 2012/02/28 22:25:39 Done.
452 "type": "object", 431 "type": "object",
432 "nodoc": "true",
453 "description": "Options for fetching the file icon for a download. See c hrome.experimental.downloads.getFileIcon.", 433 "description": "Options for fetching the file icon for a download. See c hrome.experimental.downloads.getFileIcon.",
454 "properties": { 434 "properties": {
455 "size": { 435 "size": {
456 "type": "integer", 436 "type": "integer",
457 "description": "The size of the icon. The returned icon will be squ are with dimensions size * size pixels. The default size for the icon is 32x32 pixels.", 437 "description": "The size of the icon. The returned icon will be squ are with dimensions size * size pixels. The default size for the icon is 32x32 pixels.",
458 "enum": [16, 32], 438 "enum": [16, 32],
459 "optional": true 439 "optional": true
460 } 440 }
461 } 441 }
462 } 442 }
463 ], 443 ],
464 "functions": [ 444 "functions": [
465 { 445 {
466 "name": "download", 446 "name": "download",
467 "type": "function", 447 "type": "function",
468 "description": "Download a URL. If the URL uses the HTTP[S] protocol, th en the request will include all cookies currently set for its hostname. If the d ownload started successfully, |callback| will be called with the new DownloadIte m’s |id|. If there was an error starting the download, then |callback| will be c alled with |downloadId|=undefined and chrome.extension.lastError will be set. If the URL’s hostname is not specified in the |permissions| section of the extensi on’s manifest, then the |chrome.extensions.lastError| object will indicate that the extension does not have permission to access that hostname.", 448 "description": "Download a URL. If the URL uses the HTTP[S] protocol, th en the request will include all cookies currently set for its hostname. If the d ownload started successfully, |callback| will be called with the new DownloadIte m’s |id|. If there was an error starting the download, then |callback| will be c alled with |downloadId|=undefined and chrome.extension.lastError will be set. If the URL’s hostname is not specified in the |permissions| section of the extensi on’s manifest, then the |chrome.extensions.lastError| object will indicate that the extension does not have permission to access that hostname.",
469 "parameters": [ 449 "parameters": [
470 {"name": "options", "$ref": "DownloadOptions"},
471 { 450 {
451 "type": "object",
452 "name": "options",
453 "properties": {
454 "url": {
455 "type": "string",
456 "description": "The URL to download.",
457 "minLength": 1
458 },
459 "filename": {
460 "type": "string",
461 "description": "A file path relative to the Downloads directory to contain the downloaded file.",
462 "optional": true
463 },
464 "saveAs": {
465 "type": "boolean",
466 "optional": true,
467 "description": "Use a file-chooser to allow the user to select a filename."
468 },
469 "method": {
470 "type": "string",
471 "description": "The HTTP method to use if the URL uses the HTTP[ S] protocol.",
472 "optional": true,
473 "enum": ["GET", "POST"]
474 },
475 "headers": {
476 "$ref": "HttpHeaders",
477 "description": "Extra HTTP headers to send with the request if t he URL uses the HTTP[s] protocol, restricted to those allowed by XMLHttpRequest. ",
478 "optional": true
479 },
480 "body": {
481 "type": "string",
482 "description": "post body",
483 "optional": true
484 }
485 }
486 },
487 {
488 "type": "function",
472 "name": "callback", 489 "name": "callback",
473 "type": "function",
474 "optional": true, 490 "optional": true,
475 "parameters": [ 491 "parameters": [
476 {"name": "id", "type": "integer"} 492 {"name": "id", "type": "integer"}
477 ] 493 ]
478 } 494 }
479 ] 495 ]
480 }, 496 },
481 { 497 {
482 "name": "search", 498 "name": "search",
483 "type": "function", 499 "type": "function",
500 "nodoc": "true",
484 "description": "Find DownloadItems. Set |query| to the empty object to g et all DownloadItems. To get a specific DownloadItem, set only the |id| field.", 501 "description": "Find DownloadItems. Set |query| to the empty object to g et all DownloadItems. To get a specific DownloadItem, set only the |id| field.",
485 "parameters": [ 502 "parameters": [
486 {"name": "query", "$ref": "DownloadQuery"}, 503 {"name": "query", "$ref": "DownloadQuery"},
487 { 504 {
488 "name": "callback", 505 "name": "callback",
489 "type": "function", 506 "type": "function",
490 "optional": true, 507 "optional": true,
491 "parameters": [ 508 "parameters": [
492 {"name": "items", "type": "array"} 509 {"name": "items", "type": "array"}
493 ] 510 ]
494 } 511 }
495 ] 512 ]
496 }, 513 },
497 { 514 {
498 "name": "erase", 515 "name": "erase",
499 "type": "function", 516 "type": "function",
517 "nodoc": "true",
500 "description": "Erase matching DownloadItems from history", 518 "description": "Erase matching DownloadItems from history",
501 "parameters": [ 519 "parameters": [
502 {"name": "query", "$ref": "DownloadQuery"}, 520 {"name": "query", "$ref": "DownloadQuery"},
503 { 521 {
504 "name": "callback", 522 "name": "callback",
505 "type": "function", 523 "type": "function",
506 "optional": true, 524 "optional": true,
507 "parameters": [ 525 "parameters": [
508 {"name": "ids", "type": "array"} 526 {"name": "ids", "type": "array"}
509 ] 527 ]
510 } 528 }
511 ] 529 ]
512 }, 530 },
513 { 531 {
514 "name": "setDestination", 532 "name": "setDestination",
515 "type": "function", 533 "type": "function",
534 "nodoc": "true",
516 "description": "Move the file to Downloads/relativePath instead of the D ownloads directory if it has completed and pass true to callback. If |relativePa th| specifies a directory that does not exist then it will be created. If it has not completed, store |relativePath| such that the file will be moved there when it completes and pass true to callback without waiting for the download to comp lete. Does nothing if the download is cancelled or if |downloadId| does not refe rence an existing DownloadItem, but pass false to callback. If the file could no t be moved, then the DownloadItem will transition to STATE_INTERRUPTED, its |err or| property will be set accordingly, false will be passed to callback, and the OnChanged event will fire.", 535 "description": "Move the file to Downloads/relativePath instead of the D ownloads directory if it has completed and pass true to callback. If |relativePa th| specifies a directory that does not exist then it will be created. If it has not completed, store |relativePath| such that the file will be moved there when it completes and pass true to callback without waiting for the download to comp lete. Does nothing if the download is cancelled or if |downloadId| does not refe rence an existing DownloadItem, but pass false to callback. If the file could no t be moved, then the DownloadItem will transition to STATE_INTERRUPTED, its |err or| property will be set accordingly, false will be passed to callback, and the OnChanged event will fire.",
517 "parameters": [ 536 "parameters": [
518 {"name": "id", "type": "integer"}, 537 {"name": "id", "type": "integer"},
519 {"name": "relativePath", "type": "string"} 538 {"name": "relativePath", "type": "string"}
520 ] 539 ]
521 }, 540 },
522 { 541 {
523 "name": "acceptDanger", 542 "name": "acceptDanger",
524 "type": "function", 543 "type": "function",
544 "nodoc": "true",
525 "description": "Accept a dangerous download. If a download is dangerous, then it will not transition to the completed state until this function is calle d.", 545 "description": "Accept a dangerous download. If a download is dangerous, then it will not transition to the completed state until this function is calle d.",
526 "parameters": [ 546 "parameters": [
527 {"name": "id", "type": "integer"} 547 {"name": "id", "type": "integer"}
528 ] 548 ]
529 }, 549 },
530 { 550 {
531 "name": "show", 551 "name": "show",
532 "type": "function", 552 "type": "function",
553 "nodoc": "true",
533 "description": "Show the downloaded file in its folder.", 554 "description": "Show the downloaded file in its folder.",
534 "parameters": [ 555 "parameters": [
535 {"name": "id", "type": "integer"} 556 {"name": "id", "type": "integer"}
536 ] 557 ]
537 }, 558 },
538 { 559 {
539 "name": "drag", 560 "name": "drag",
540 "type": "function", 561 "type": "function",
562 "nodoc": "true",
541 "description": "Drag the file to another application", 563 "description": "Drag the file to another application",
542 "parameters": [ 564 "parameters": [
543 {"name": "id", "type": "integer"} 565 {"name": "id", "type": "integer"}
544 ] 566 ]
545 }, 567 },
546 { 568 {
547 "name": "pause", 569 "name": "pause",
548 "type": "function", 570 "type": "function",
571 "nodoc": "true",
549 "description": "Pause the download.", 572 "description": "Pause the download.",
550 "parameters": [ 573 "parameters": [
551 {"name": "id", "type": "integer"}, 574 {"name": "id", "type": "integer"},
552 { 575 {
553 "name": "callback", 576 "name": "callback",
554 "type": "function", 577 "type": "function",
555 "optional": true, 578 "optional": true,
556 "parameters": [], 579 "parameters": [],
557 "description": "Called when the pause request is completed. If the r equest was successful the download is in a paused state. Otherwise chrome.extens ion.lastError contains an error message. The request will fail if the download i s not active." 580 "description": "Called when the pause request is completed. If the r equest was successful the download is in a paused state. Otherwise chrome.extens ion.lastError contains an error message. The request will fail if the download i s not active."
558 } 581 }
559 ] 582 ]
560 }, 583 },
561 { 584 {
562 "name": "resume", 585 "name": "resume",
563 "type": "function", 586 "type": "function",
587 "nodoc": "true",
564 "description": "Resume a paused download.", 588 "description": "Resume a paused download.",
565 "parameters": [ 589 "parameters": [
566 {"name": "id", "type": "integer"}, 590 {"name": "id", "type": "integer"},
567 { 591 {
568 "name": "callback", 592 "name": "callback",
569 "type": "function", 593 "type": "function",
570 "optional": true, 594 "optional": true,
571 "parameters": [], 595 "parameters": [],
572 "description": "Called when the resume request is completed. If the request was successful the download is in progress and unpaused. Otherwise chrom e.extension.lastError contains an error message. The request will fail if the do wnload is not active." 596 "description": "Called when the resume request is completed. If the request was successful the download is in progress and unpaused. Otherwise chrom e.extension.lastError contains an error message. The request will fail if the do wnload is not active."
573 } 597 }
574 ] 598 ]
575 }, 599 },
576 { 600 {
577 "name": "cancel", 601 "name": "cancel",
578 "type": "function", 602 "type": "function",
603 "nodoc": "true",
579 "description": "Cancel a download.", 604 "description": "Cancel a download.",
580 "parameters": [ 605 "parameters": [
581 {"name": "id", "type": "integer"}, 606 {"name": "id", "type": "integer"},
582 { 607 {
583 "name": "callback", 608 "name": "callback",
584 "type": "function", 609 "type": "function",
585 "optional": true, 610 "optional": true,
586 "parameters": [], 611 "parameters": [],
587 "description": "Called when the request is completed. The download i s cancelled, completed, interrupted or doesn't exist anymore." 612 "description": "Called when the request is completed. The download i s cancelled, completed, interrupted or doesn't exist anymore."
588 } 613 }
589 ] 614 ]
590 }, 615 },
591 { 616 {
592 "name": "getFileIcon", 617 "name": "getFileIcon",
593 "type": "function", 618 "type": "function",
619 "nodoc": "true",
594 "description": "Retrieve an icon for the specified download. For new dow nloads, file icons are available after the onCreated event has been received. Th e image returned by this function while a download is in progress may be differe nt from the image returned after the download is complete. Icon retrieval is don e by querying the underlying operating system or toolkit depending on the platfo rm. The icon that is returned will therefore depend on a number of factors inclu ding state of the download, platform, registered file types and visual theme.", 620 "description": "Retrieve an icon for the specified download. For new dow nloads, file icons are available after the onCreated event has been received. Th e image returned by this function while a download is in progress may be differe nt from the image returned after the download is complete. Icon retrieval is don e by querying the underlying operating system or toolkit depending on the platfo rm. The icon that is returned will therefore depend on a number of factors inclu ding state of the download, platform, registered file types and visual theme.",
595 "parameters": [ 621 "parameters": [
596 { 622 {
623 "type": "integer",
597 "name": "id", 624 "name": "id",
598 "type": "integer",
599 "description": "The identifier for the download." 625 "description": "The identifier for the download."
600 }, 626 },
601 { 627 {
628 "type": "object",
602 "name": "options", 629 "name": "options",
603 "$ref": "DownloadFileIconOptions", 630 "description": "Options for fetching the file icon for a download. S ee chrome.experimental.downloads.getFileIcon.",
604 "description": "Options for the returned image." 631 "properties": {
632 "size": {
633 "type": "integer",
634 "description": "The size of the icon. The returned icon will be square with dimensions size * size pixels. The default size for the icon is 32 x32 pixels.",
635 "enum": [16, 32],
636 "optional": true
637 }
638 }
605 }, 639 },
606 { 640 {
607 "name": "callback", 641 "name": "callback",
608 "type": "function", 642 "type": "function",
609 "parameters": [ 643 "parameters": [
610 { 644 {
611 "name": "iconURL", 645 "name": "iconURL",
612 "type": "string", 646 "type": "string",
613 "description": "A URL to an image that represents the download. If a file icon cannot be determined, chrome.extension.lastError will contain an error message." 647 "description": "A URL to an image that represents the download. If a file icon cannot be determined, chrome.extension.lastError will contain an error message."
614 } 648 }
615 ] 649 ]
616 } 650 }
617 ] 651 ]
618 } 652 }
619 ] 653 ]
620 } 654 }
621 ] 655 ]
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/docs/experimental.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698