Chromium Code Reviews| Index: chrome/common/extensions/api/extension_api.json |
| diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json |
| index f3f855936fe4c5d5ecd28dda933c60f4ec0e96a7..9030ea9e5d5469da1e2e4746ea6ce5127806892e 100644 |
| --- a/chrome/common/extensions/api/extension_api.json |
| +++ b/chrome/common/extensions/api/extension_api.json |
| @@ -3054,6 +3054,267 @@ |
| ] |
| }, |
| { |
| + "namespace": "experimental.downloads", |
|
Mihai Parparita -not on Chrome
2011/07/27 16:28:08
It's probably a good idea to add the "nodoc": true
benjhayden
2011/07/27 18:40:31
Done.
|
| + "events": [ |
| + { |
| + "name": "onCreated", |
| + "type": "function", |
| + "unprivileged": true, |
| + "description": "Fires when a download begins.", |
| + "parameters": [ |
| + {"$ref": "DownloadItem"} |
| + ] |
| + }, |
| + { |
| + "name": "onChanged", |
| + "type": "function", |
| + "unprivileged": true, |
| + "description": "Fires when a property of a DownloadItem changes.", |
| + "parameters": [ |
| + {"$ref": "DownloadDelta"} |
| + ] |
| + }, |
| + { |
| + "name": "onErased", |
| + "type": "function", |
| + "unprivileged": true, |
| + "description": "Fires when a download is erased from history.", |
| + "parameters": [ |
| + {"type": "integer", "name": "download_id"} |
| + ] |
| + } |
| + ], |
| + "properties": { |
| + "STATE_IN_PROGRESS": { |
| + "type": "string", |
| + "value": "in progress", |
| + "description": "The download is currently receiving data from the server." |
| + }, |
| + "STATE_INTERRUPTED": { |
| + "type": "string", |
| + "value": "interrupted", |
| + "description": "An error broke the connection with the file host." |
| + }, |
| + "STATE_COMPLETE": { |
| + "type": "string", |
| + "value": "complete", |
| + "description": "The download has completed." |
| + }, |
| + "DANGER_SAFE": { |
| + "type": "string", |
| + "value": "safe", |
| + "description": "The file has been determined to present no known danger to the user's computer." |
| + }, |
| + "DANGER_FILE": { |
| + "type": "string", |
| + "value": "file", |
| + "description": "The download's filename is suspicious." |
| + }, |
| + "DANGER_URL": { |
| + "type": "string", |
| + "value": "url", |
| + "description": "The download's URL is suspicious." |
| + } |
| + }, |
| + "types": [ |
| + { |
| + "id": "DownloadItem", |
| + "type": "object", |
| + "description": "The state of a file as it is downloaded from the internet.", |
| + "properties": { |
| + "id": {"type": "integer", "description": "An identifier that is persistent across browser sessions."}, |
| + "url": {"type": "string", "description": "absolute URL"}, |
| + "filename": {"type": "string", "description": "absolute local path"}, |
| + "danger": {"type": "string", "description": "Safety", "enum": ["safe", "file", "url"]}, |
| + "dangerAccepted": {"type": "boolean", "description": "true if the user has accepted the download's danger."}, |
| + "mime": {"type": "string", "description": "The file's MIME type."}, |
| + "startTime": {"type": "integer", "description": "ms since epoch"}, |
| + "endTime": {"type": "integer", "description": "ms since epoch"}, |
| + "state": {"type": "string", "description": "", "enum": ["in progress", "complete", "interrupted"]}, |
| + "paused": {"type": "boolean", "description": "true if the download has stopped reading data"}, |
| + "error": {"type": "integer", "description": "net error code if state is interrupted"}, |
| + "bytesReceived": {"type": "integer", "description": "pre-decompression"}, |
| + "totalBytes": {"type": "integer", "description": "pre-decompression"}, |
| + "fileSize": {"type": "integer", "description": "post-decompression"} |
| + } |
| + }, |
| + { |
| + "id": "DownloadOptions", |
| + "type": "object", |
| + "properties": { |
| + "url": {"type": "string", "description": "The URL to download."}, |
| + "filename": {"type": "string", "description": "relative local path", "optional": true}, |
| + "saveAs": {"type": "boolean", "optional": true, "description": "Show the Save File As dialog."}, |
| + "method": {"type": "string", "description": "GET or POST", "optional": true}, |
| + "headers": {"type": "object", "description": "request headers", "optional": true, "properties": {}, "additionalProperties": { "type": "any" }}, |
| + "body": {"type": "string", "description": "post body", "optional": true} |
| + } |
| + }, |
| + { |
| + "id": "DownloadQuery", |
| + "type": "object", |
| + "description": "", |
| + "properties": { |
| + "query": {"type": "string", "description": "boolean search terms", "optional": true}, |
| + "startedBefore": {"type": "integer", "description": "ms since epoch", "optional": true}, |
| + "startedAfter": {"type": "integer", "description": "ms since epoch", "optional": true}, |
| + "endedBefore": {"type": "integer", "description": "ms since epoch", "optional": true}, |
| + "endedAfter": {"type": "integer", "description": "ms since epoch", "optional": true}, |
| + "totalBytesGreater": {"type": "integer", "description": "", "optional": true}, |
| + "totalBytesLess": {"type": "integer", "description": "", "optional": true}, |
| + "filenameRegex": {"type": "string", "description": "", "optional": true}, |
| + "urlRegex": {"type": "string", "description": "", "optional": true}, |
| + "limit": {"type": "integer", "optional": true, "description": ""}, |
| + "orderBy": {"type": "string", "optional": true, "description": ""}, |
| + "id": {"type": "integer", "description": "A persistent identifier", "optional": true}, |
| + "url": {"type": "string", "description": "absolute URL", "optional": true}, |
| + "filename": {"type": "string", "description": "absolute local path", "optional": true}, |
| + "danger": {"type": "string", "description": "Safety", "optional": true, "enum": ["safe", "file", "url"]}, |
| + "dangerAccepted": {"type": "boolean", "description": "true if the user has accepted the download's danger.", "optional": true}, |
| + "mime": {"type": "string", "description": "The file's MIME type.", "optional": true}, |
| + "startTime": {"type": "integer", "description": "ms since epoch", "optional": true}, |
| + "endTime": {"type": "integer", "description": "ms since epoch", "optional": true}, |
| + "state": {"type": "string", "description": "", "optional": true, "enum": ["in progress", "complete", "interrupted"]}, |
| + "paused": {"type": "boolean", "description": "true if the download has stopped reading data", "optional": true}, |
| + "error": {"type": "integer", "description": "net error code if state is interrupted", "optional": true}, |
| + "bytesReceived": {"type": "integer", "description": "pre-decompression", "optional": true}, |
| + "totalBytes": {"type": "integer", "description": "pre-decompression", "optional": true}, |
| + "fileSize": {"type": "integer", "description": "post-decompression", "optional": true} |
| + } |
| + }, |
| + { |
| + "id": "DownloadIntegerDiff", |
| + "type": "object", |
| + "description": "", |
| + "properties": { |
| + } |
| + }, |
| + { |
| + "id": "DownloadDelta", |
| + "type": "object", |
| + "description": "", |
| + "properties": { |
| + } |
| + }, |
| + { |
| + "id": "DownloadResponse", |
| + "type": "object", |
| + "description": "Result of download()", |
| + "properties": { |
| + "id": {"type": "integer", "optional": true}, |
| + "error": {"type": "integer", "optional": true} |
| + } |
| + } |
| + ], |
| + "functions": [ |
| + { |
| + "name": "download", |
| + "type": "function", |
| + "description": "Download a URL.", |
| + "parameters": [ |
| + {"$ref": "DownloadOptions"}, |
| + { |
| + "name": "callback", |
| + "type": "function", |
| + "optional": true, |
| + "parameters": [ |
| + {"$ref": "DownloadResponse"} |
| + ] |
| + } |
| + ] |
| + }, |
| + { |
| + "name": "search", |
| + "type": "function", |
| + "description": "Find DownloadItems", |
| + "parameters": [ |
| + {"$ref": "DownloadQuery"}, |
| + { |
| + "name": "callback", |
| + "type": "function", |
| + "optional": true, |
| + "parameters": [ |
| + {"name": "items", "type": "array"} |
| + ] |
| + } |
| + ] |
| + }, |
| + { |
| + "name": "erase", |
| + "type": "function", |
| + "description": "Erase DownloadItems from history", |
| + "parameters": [ |
| + {"$ref": "DownloadQuery"}, |
| + { |
| + "name": "callback", |
| + "type": "function", |
| + "optional": true, |
| + "parameters": [ |
| + {"name": "ids", "type": "array"} |
| + ] |
| + } |
| + ] |
| + }, |
| + { |
| + "name": "setDestination", |
| + "type": "function", |
| + "description": "Move a downloaded file", |
| + "parameters": [ |
| + {"name": "id", "type": "integer"}, |
| + {"name": "path", "type": "string"} |
| + ] |
| + }, |
| + { |
| + "name": "acceptDanger", |
| + "type": "function", |
| + "description": "Accept a dangerous download", |
| + "parameters": [ |
| + {"name": "id", "type": "integer"} |
| + ] |
| + }, |
| + { |
| + "name": "show", |
| + "type": "function", |
| + "description": "Show in folder", |
| + "parameters": [ |
| + {"name": "id", "type": "integer"} |
| + ] |
| + }, |
| + { |
| + "name": "drag", |
| + "type": "function", |
| + "description": "Drag the file to another application", |
| + "parameters": [ |
| + {"name": "id", "type": "integer"} |
| + ] |
| + }, |
| + { |
| + "name": "pause", |
| + "type": "function", |
| + "description": "Pause the download", |
| + "parameters": [ |
| + {"name": "id", "type": "integer"} |
| + ] |
| + }, |
| + { |
| + "name": "resume", |
| + "type": "function", |
| + "description": "Resume a paused download", |
| + "parameters": [ |
| + {"name": "id", "type": "integer"} |
| + ] |
| + }, |
| + { |
| + "name": "cancel", |
| + "type": "function", |
| + "description": "Cancel a download", |
| + "parameters": [ |
| + {"name": "id", "type": "integer"} |
| + ] |
| + } |
| + ] |
| + }, |
| + { |
| "namespace": "devtools", |
| "nodoc": "true", |
| "types": [], |