Chromium Code Reviews| Index: chrome/common/extensions/api/file_browser_private.json |
| diff --git a/chrome/common/extensions/api/file_browser_private.json b/chrome/common/extensions/api/file_browser_private.json |
| index ad3ab6bdc6d096e087d68fecf69b37db0b65c0f5..d940e1fc36904d4788ae1fc8af47030f661537c4 100644 |
| --- a/chrome/common/extensions/api/file_browser_private.json |
| +++ b/chrome/common/extensions/api/file_browser_private.json |
| @@ -320,6 +320,33 @@ |
| } |
| }, |
| { |
| + "id": "CopyProgressStatus", |
| + "type": "object", |
| + "description": "Payload data for copy status progress updates.", |
| + "properties": { |
| + "type": { |
| + "type": "string", |
| + "enum": ["BEGIN_ENTRY_COPY", "END_ENTRY_COPY", "PROGRESS", "SUCCESS", "ERROR"], |
| + "description": "The type of the progress event. BEGIN_ENTRY_COPY is fired for each entry (file or directory) before starting the copy operation, END_ENTRY_COPY is fired for each entry (file or directory) after ending the copy operation. PROGRESS is fired periodically to report progress of a file copy (not directory). SUCCESS is fired after all entries are copied. ERROR is fired when an error occurs." |
| + }, |
| + "url": { |
| + "type": "string", |
| + "optional": true, |
| + "description": "URL for the entry currently being copied. This field is particularly useful when a directory copy is initiated with startCopy(). The field tells what file/directory in that directory is now being copied." |
| + }, |
| + "size": { |
| + "type": "number", |
| + "optional": true, |
| + "description": "Number of processed bytes for the file currently being copied. Available only for PROGRESS event. To show the progress bar, a caller needs to pre-compute the size of files being copied for the file (not directory)." |
| + }, |
| + "error": { |
| + "type": "integer", |
| + "optional": true, |
| + "description": "FileError's code of the error. Available only for ERROR event." |
| + } |
| + } |
| + }, |
| + { |
| "id": "FileTransferCancelStatus", |
| "type": "object", |
| "description": "Payload data for file transfer cancel response.", |
| @@ -792,6 +819,57 @@ |
| ] |
| }, |
| { |
| + "name": "startCopy", |
| + "description": "Starts to copy an entry. If the source is directory, the copy is done recursively.", |
|
asargent_no_longer_on_chrome
2013/08/30 05:22:10
nit: "source is directory" -> "source is a directo
hidehiko
2013/08/30 06:35:43
Done.
|
| + "parameters": [ |
| + { |
| + "name": "sourceUrl", |
| + "type": "string", |
| + "description": "URL of the source entry to be copied." |
| + }, |
| + { |
| + "name": "parent", |
| + "type": "string", |
| + "description": "URL of the destination directory." |
| + }, |
| + { |
| + "name": "newName", |
| + "type": "string", |
| + "description": "Name of the new entry. It shouldn't contain '/'." |
| + }, |
| + { |
| + "name": "callback", |
| + "type": "function", |
|
asargent_no_longer_on_chrome
2013/08/30 05:22:10
Consider making this optional
hidehiko
2013/08/30 06:35:43
Thank you for your feedback. Currently our client
|
| + "description": "Completion callback.", |
| + "parameters": [ |
| + { |
| + "name": "copyId", |
| + "type": "integer", |
| + "description": "ID of the copy task. Can be used to identify the progress, and to cancel the task." |
| + } |
| + ] |
| + } |
| + ] |
| + }, |
| + { |
| + "name": "cancelCopy", |
| + "description": "Cancels the running copy task.", |
| + "parameters": [ |
| + { |
| + "name": "copyId", |
| + "type": "integer", |
| + "description": "ID of the copy task to be cancelled." |
| + }, |
| + { |
| + "name": "callback", |
| + "type": "function", |
| + "optional": true, |
| + "description": "Completion callback of the cancel.", |
| + "parameters": [] |
| + } |
| + ] |
| + }, |
| + { |
| "name": "setLastModified", |
| "description": "Updates last modified to specified time in seconds", |
| "parameters": [ |
| @@ -1158,6 +1236,50 @@ |
| } |
| ] |
| }, |
| + // Here is an example of onCopyProgress: |
| + // Suppose a/b/c.txt (100bytes) and a/b/d.txt (200bytes), and trying to |
| + // copy a to x recursively. The events will be: |
| + // |
| + // BEGIN_ENTRY_COPY a |
| + // <create empty directory x/a> |
| + // END_ENTRY_COPY a |
| + // |
| + // BEGIN_ENTRY_COPY a/b |
| + // <create empty directory x/a/b> |
| + // END_ENTRY_COPY a/b |
| + // |
| + // BEGIN_ENTRY_COPY a/b/c.txt |
| + // PROGRESS a/b/c.txt 0 |
| + // PROGRESS a/b/c.txt 10 |
| + // : |
| + // PROGRESS a/b/c.txt 100 |
| + // END_ENTRY_COPY a/b/c.txt |
| + // |
| + // BEGIN_ENTRY_COPY a/b/d.txt |
| + // PROGRESS a/b/d.txt 0 |
| + // PROGRESS a/b/d.txt 10 |
| + // : |
| + // PROGRESS a/b/d.txt 200 |
| + // END_ENTRY_COPY a/b/d.txt |
| + // |
| + // SUCCESS x/a |
| + { |
| + "name": "onCopyProgress", |
| + "type": "function", |
| + "description": "Periodically fired during a copy task to report its progress update.", |
| + "parameters": [ |
| + { |
| + "type": "integer", |
| + "name": "copyId", |
| + "description": "Id of the copy task of this progress update." |
| + }, |
| + { |
| + "$ref": "CopyProgressStatus", |
| + "name": "status", |
| + "description": "Progress update status." |
| + } |
| + ] |
| + }, |
| { |
| "name": "onDirectoryChanged", |
| "type": "function", |