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

Unified Diff: chrome/common/extensions/api/file_browser_private.json

Issue 23537002: Adds new private API manifest for Files.app copy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 98fb729224ec85660984670e94cf192f1b20e66a..9ab063845f8c0450ab8bf35cb65acfeecaed5c8b 100644
--- a/chrome/common/extensions/api/file_browser_private.json
+++ b/chrome/common/extensions/api/file_browser_private.json
@@ -343,6 +343,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 before starting the copy operation, END_ENTRY_COPY is fired for each entry after ending the copy operation. PROGRESS is fired periodically during copy. SUCCESS is fired after all entries are copied. ERROR is fired when an error occurs."
satorux1 2013/08/29 08:32:32 Some clarification: BEGIN_ENTRY_COPY is fired for
hidehiko 2013/08/29 09:00:58 Done.
+ },
+ "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."
satorux1 2013/08/29 08:32:32 for the file (not directory) it's redundant but a
hidehiko 2013/08/29 09:00:58 Done.
+ },
+ "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.",
@@ -837,6 +864,52 @@
]
},
{
+ "name": "startCopy",
+ "description": "Starts to copy an entry. If the source is directory, the copy is done recursively.",
satorux1 2013/08/29 08:32:32 Starts to copy an entry to another directory
hidehiko 2013/08/29 09:00:58 The destination directory can be same. E.g. copy t
+ "parameters": [
+ {
+ "name": "sourceUrl",
+ "type": "string",
+ "description": "URL of the source entry to be copied."
+ },
+ {
+ "name": "targetUrl",
+ "type": "string",
+ "description": "URL of the destination location."
satorux1 2013/08/29 08:32:32 URL of the destination directory. (to make it cle
hidehiko 2013/08/29 09:00:58 Per offline discussion, I split the url into two;
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "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."
satorux1 2013/08/29 08:32:32 I thought it's canceled but cancelled seems to be
hidehiko 2013/08/29 09:00:58 IIRC, cancelled for UK and canceled for US. I actu
+ },
+ {
+ "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": [
@@ -1201,6 +1274,45 @@
}
]
},
+ // 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:
satorux1 2013/08/29 08:32:32 remoe the trailing /? to be precise, the trailing
hidehiko 2013/08/29 09:00:58 Done.
+ // BEGIN_ENTRY_COPY a/
+ // <create empty directory x/a/>
+ // END_ENTRY_COPY a/
satorux1 2013/08/29 08:32:32 add a blank line between each entry?
hidehiko 2013/08/29 09:00:58 Done.
+ // 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",
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698