OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 [ | 5 [ |
6 { | 6 { |
7 "namespace":"fileBrowserPrivate", | 7 "namespace":"fileBrowserPrivate", |
8 "description": "none", | 8 "description": "none", |
9 "platforms": ["chromeos"], | 9 "platforms": ["chromeos"], |
10 "types": [ | 10 "types": [ |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
315 "description": "Approximated completed portion of the transfer opera tion." | 315 "description": "Approximated completed portion of the transfer opera tion." |
316 }, | 316 }, |
317 "total": { | 317 "total": { |
318 "type": "number", | 318 "type": "number", |
319 "optional": true, | 319 "optional": true, |
320 "description": "Approximated total size of transfer operation." | 320 "description": "Approximated total size of transfer operation." |
321 } | 321 } |
322 } | 322 } |
323 }, | 323 }, |
324 { | 324 { |
325 "id": "CopyProgressStatus", | |
326 "type": "object", | |
327 "description": "Payload data for copy status progress updates.", | |
328 "properties": { | |
329 "type": { | |
330 "type": "string", | |
331 "enum": ["BEGIN_ENTRY_COPY", "END_ENTRY_COPY", "PROGRESS", "SUCCESS" , "ERROR"], | |
kinuko
2013/08/30 06:59:23
nit: afaik most APIs use lower-letters for enum. I
hidehiko
2013/08/30 08:20:10
Done.
| |
332 "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 op eration. PROGRESS is fired periodically to report progress of a file copy (not d irectory). SUCCESS is fired after all entries are copied. ERROR is fired when an error occurs." | |
333 }, | |
334 "url": { | |
335 "type": "string", | |
336 "optional": true, | |
337 "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." | |
338 }, | |
339 "size": { | |
340 "type": "number", | |
341 "optional": true, | |
342 "description": "Number of processed bytes for the file currently bei ng 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 )." | |
343 }, | |
344 "error": { | |
345 "type": "integer", | |
346 "optional": true, | |
347 "description": "FileError's code of the error. Available only for ER ROR event." | |
348 } | |
349 } | |
350 }, | |
351 { | |
325 "id": "FileTransferCancelStatus", | 352 "id": "FileTransferCancelStatus", |
326 "type": "object", | 353 "type": "object", |
327 "description": "Payload data for file transfer cancel response.", | 354 "description": "Payload data for file transfer cancel response.", |
328 "properties": { | 355 "properties": { |
329 "fileUrl": { | 356 "fileUrl": { |
330 "type": "string", | 357 "type": "string", |
331 "description": "URL of file that is being transfered." | 358 "description": "URL of file that is being transfered." |
332 }, | 359 }, |
333 "canceled": { | 360 "canceled": { |
334 "type": "boolean", | 361 "type": "boolean", |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
787 "name" : "fileTransferCancelStatuses", | 814 "name" : "fileTransferCancelStatuses", |
788 "type": "array", | 815 "type": "array", |
789 "items": {"$ref": "FileTransferCancelStatus"}, | 816 "items": {"$ref": "FileTransferCancelStatus"}, |
790 "description": "The list of FileTransferCancelStatus." | 817 "description": "The list of FileTransferCancelStatus." |
791 } | 818 } |
792 ] | 819 ] |
793 } | 820 } |
794 ] | 821 ] |
795 }, | 822 }, |
796 { | 823 { |
824 "name": "startCopy", | |
825 "description": "Starts to copy an entry. If the source is a directory, t he copy is done recursively.", | |
826 "parameters": [ | |
827 { | |
828 "name": "sourceUrl", | |
829 "type": "string", | |
830 "description": "URL of the source entry to be copied." | |
831 }, | |
832 { | |
833 "name": "parent", | |
834 "type": "string", | |
835 "description": "URL of the destination directory." | |
836 }, | |
837 { | |
838 "name": "newName", | |
839 "type": "string", | |
840 "description": "Name of the new entry. It shouldn't contain '/'." | |
841 }, | |
842 { | |
843 "name": "callback", | |
844 "type": "function", | |
845 "description": "Completion callback.", | |
846 "parameters": [ | |
847 { | |
848 "name": "copyId", | |
849 "type": "integer", | |
850 "description": "ID of the copy task. Can be used to identify the progress, and to cancel the task." | |
851 } | |
852 ] | |
853 } | |
854 ] | |
855 }, | |
856 { | |
857 "name": "cancelCopy", | |
858 "description": "Cancels the running copy task.", | |
859 "parameters": [ | |
860 { | |
861 "name": "copyId", | |
862 "type": "integer", | |
863 "description": "ID of the copy task to be cancelled." | |
864 }, | |
865 { | |
866 "name": "callback", | |
867 "type": "function", | |
868 "optional": true, | |
869 "description": "Completion callback of the cancel.", | |
870 "parameters": [] | |
871 } | |
872 ] | |
873 }, | |
874 { | |
797 "name": "setLastModified", | 875 "name": "setLastModified", |
798 "description": "Updates last modified to specified time in seconds", | 876 "description": "Updates last modified to specified time in seconds", |
799 "parameters": [ | 877 "parameters": [ |
800 { | 878 { |
801 "name": "fileUrl", | 879 "name": "fileUrl", |
802 "type": "string", | 880 "type": "string", |
803 "description": "File url from the local file system." | 881 "description": "File url from the local file system." |
804 }, | 882 }, |
805 { | 883 { |
806 "name": "lastModified", | 884 "name": "lastModified", |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1153 "description": "Fired when file transfers with remote file system are in progress.", | 1231 "description": "Fired when file transfers with remote file system are in progress.", |
1154 "parameters": [ | 1232 "parameters": [ |
1155 { | 1233 { |
1156 "type": "array", | 1234 "type": "array", |
1157 "items": {"$ref": "FileTransferStatus"}, | 1235 "items": {"$ref": "FileTransferStatus"}, |
1158 "name": "event", | 1236 "name": "event", |
1159 "description": "List of ongoing file statuses for ongoing transfer o perations." | 1237 "description": "List of ongoing file statuses for ongoing transfer o perations." |
1160 } | 1238 } |
1161 ] | 1239 ] |
1162 }, | 1240 }, |
1241 // Here is an example of onCopyProgress: | |
1242 // Suppose a/b/c.txt (100bytes) and a/b/d.txt (200bytes), and trying to | |
1243 // copy a to x recursively. The events will be: | |
1244 // | |
1245 // BEGIN_ENTRY_COPY a | |
1246 // <create empty directory x/a> | |
1247 // END_ENTRY_COPY a | |
1248 // | |
1249 // BEGIN_ENTRY_COPY a/b | |
1250 // <create empty directory x/a/b> | |
1251 // END_ENTRY_COPY a/b | |
1252 // | |
1253 // BEGIN_ENTRY_COPY a/b/c.txt | |
1254 // PROGRESS a/b/c.txt 0 | |
1255 // PROGRESS a/b/c.txt 10 | |
1256 // : | |
1257 // PROGRESS a/b/c.txt 100 | |
1258 // END_ENTRY_COPY a/b/c.txt | |
1259 // | |
1260 // BEGIN_ENTRY_COPY a/b/d.txt | |
1261 // PROGRESS a/b/d.txt 0 | |
1262 // PROGRESS a/b/d.txt 10 | |
1263 // : | |
1264 // PROGRESS a/b/d.txt 200 | |
1265 // END_ENTRY_COPY a/b/d.txt | |
1266 // | |
1267 // SUCCESS x/a | |
1268 { | |
1269 "name": "onCopyProgress", | |
1270 "type": "function", | |
1271 "description": "Periodically fired during a copy task to report its prog ress update.", | |
1272 "parameters": [ | |
1273 { | |
1274 "type": "integer", | |
1275 "name": "copyId", | |
1276 "description": "Id of the copy task of this progress update." | |
1277 }, | |
1278 { | |
1279 "$ref": "CopyProgressStatus", | |
1280 "name": "status", | |
1281 "description": "Progress update status." | |
1282 } | |
1283 ] | |
1284 }, | |
1163 { | 1285 { |
1164 "name": "onDirectoryChanged", | 1286 "name": "onDirectoryChanged", |
1165 "type": "function", | 1287 "type": "function", |
1166 "description": "Fired when watched file change event is detected in a wa tched directory.", | 1288 "description": "Fired when watched file change event is detected in a wa tched directory.", |
1167 "parameters": [ | 1289 "parameters": [ |
1168 { | 1290 { |
1169 "$ref": "FileWatchEvent", | 1291 "$ref": "FileWatchEvent", |
1170 "name": "event", | 1292 "name": "event", |
1171 "description": "File watch event information." | 1293 "description": "File watch event information." |
1172 } | 1294 } |
1173 ] | 1295 ] |
1174 }, | 1296 }, |
1175 { | 1297 { |
1176 "name": "onPreferencesChanged", | 1298 "name": "onPreferencesChanged", |
1177 "type": "function", | 1299 "type": "function", |
1178 "description": "Fired when file manager preferences change. The preferen ces can be retrieved via 'getPreferences'.", | 1300 "description": "Fired when file manager preferences change. The preferen ces can be retrieved via 'getPreferences'.", |
1179 "parameters": [] | 1301 "parameters": [] |
1180 }, | 1302 }, |
1181 { | 1303 { |
1182 "name": "onDriveConnectionStatusChanged", | 1304 "name": "onDriveConnectionStatusChanged", |
1183 "type": "function", | 1305 "type": "function", |
1184 "description": "Fired when the active network connection state changes. The network connection state can be retrieved via 'getDriveConnectionState'.", | 1306 "description": "Fired when the active network connection state changes. The network connection state can be retrieved via 'getDriveConnectionState'.", |
1185 "parameters": [] | 1307 "parameters": [] |
1186 } | 1308 } |
1187 ] | 1309 ] |
1188 } | 1310 } |
1189 ] | 1311 ] |
OLD | NEW |