Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <h2 id="manifest">Manifest</h2> | 1 <h2 id="manifest">Manifest</h2> |
| 2 <p>You must declare the "fileSystemProvider" permission | 2 <p>You must declare the "fileSystemProvider" permission and section |
| 3 in the <a href="manifest">extension manifest</a> | 3 in the <a href="manifest">extension manifest</a> |
| 4 to use the File System Provider API. | 4 to use the File System Provider API. |
| 5 For example:</p> | 5 For example:</p> |
| 6 <pre data-filename="manifest.json"> | 6 <pre data-filename="manifest.json"> |
| 7 { | 7 { |
| 8 "name": "My extension", | 8 "name": "My {{?is_apps}}app{{:is_apps}}extension{{/is_apps}}", |
|
not at google - send to devlin
2015/05/12 00:08:51
you should be able to use {{platform}} for this, i
mtomasz
2015/05/12 08:01:19
Done.
| |
| 9 ... | 9 ... |
| 10 <b>"permissions": [ | 10 "permissions": [ |
| 11 "fileSystemProvider" | 11 "fileSystemProvider" |
| 12 ]</b>, | 12 ], |
| 13 ... | |
| 14 "file_system_provider": [ | |
| 15 "configurable": true, | |
| 16 "multiple_mounts": true, | |
| 17 "source": "network" | |
| 18 ], | |
| 13 ... | 19 ... |
| 14 } | 20 } |
| 15 </pre> | 21 </pre> |
| 16 | 22 |
| 23 <p class="api_reference"> | |
| 24 The <code>file_system_provider</code> section must be declared as follows: | |
| 25 {{+partials.manifest_type | |
| 26 type:apis.extensions.manifestTypes.byName.FileSystemProviderCapabilities /}} | |
| 27 </p> | |
|
not at google - send to devlin
2015/05/12 00:08:51
It would be nice to mention somewhere what the dif
mtomasz
2015/05/12 08:01:19
UI is still evolving. Currently I added some short
| |
| 28 | |
| 17 <h2 id="overview">Overview</h2> | 29 <h2 id="overview">Overview</h2> |
| 18 <p> | 30 <p> |
| 19 File System Provider API allows extensions to support virtual file systems, | 31 File System Provider API allows extensions to support virtual file systems, |
| 20 which are available in the file manager on Chrome OS. | 32 which are available in the file manager on Chrome OS. |
| 21 Use cases include decompressing archives and accessing files in a cloud | 33 Use cases include decompressing archives and accessing files in a cloud |
| 22 service other than Drive. | 34 service other than Drive. |
| 23 </p> | 35 </p> |
| 24 | 36 |
| 25 <h2 id="archives">File handlers</h2> | 37 <h2 id="archives">Mounting file systems</h2> |
| 26 <p> | 38 <p> |
| 27 Provided file systems can either provide file system contents from an external | 39 Providing extensions can either provide file system contents from an external |
| 28 source (such as a remote server), or using a local file (such as an archive) as | 40 source (such as a remote server or a USB device), or using a local file (such as |
| 29 its input. | 41 an archive) as its input. |
| 30 </p> | 42 </p> |
| 31 <p> | 43 <p> |
| 32 In the second case, the providing extension should have a | 44 {{?is_apps}} |
| 45 For file handlers, the providing extension should have a | |
| 33 <a href="manifest/file_handlers">file_handlers</a> manifest entry in order | 46 <a href="manifest/file_handlers">file_handlers</a> manifest entry in order |
| 34 to be launched when the file is selected in the file manager. | 47 to be launched when the file is selected in the file manager. |
| 35 When the extension is executed with a file to be handled, it has to mount a | 48 When the extension is executed with a file to be handled, it has to mount a |
| 36 file system and start serving contents from the provided file. | 49 file system and start serving contents from the provided file. |
| 50 {{:is_apps}} | |
| 51 In order to write file systems which are file handlers (source is <code>"file" | |
|
not at google - send to devlin
2015/05/12 00:08:51
Try to get the "file" part on a single line, like
| |
| 52 </code>) the provider must be a packaged app, as the <code>onLaunched</code> | |
|
not at google - send to devlin
2015/05/12 00:08:51
provide the full path to onLaunched, to make it cl
mtomasz
2015/05/12 08:01:19
Could you clarify?
not at google - send to devlin
2015/05/12 20:58:34
I mean that onLaunched is an event in chrome.app.r
| |
| 53 event is not available to extensions. | |
| 54 {{/is_apps}} | |
| 55 </p> | |
| 56 <p> | |
| 57 If the source is network or a device, then the file system should be mounted | |
| 58 when $(ref:onMountRequested) event is called. | |
| 59 </p> | |
| 60 <p> | |
| 61 <table id="source-table"> | |
| 62 <tr> | |
| 63 <th> | |
| 64 <a href="#property-options-source">Source</a> of the file system data | |
| 65 </th> | |
| 66 <th>Entry point</th> | |
| 67 </tr> | |
| 68 <tr> | |
| 69 <td> | |
| 70 <code>"file"</code> | |
| 71 </td> | |
| 72 <td> | |
| 73 {{?is_apps}} | |
| 74 $(ref:app.runtime.onLaunched) | |
| 75 {{:is_apps}} | |
| 76 Available to <a href="/apps/fileSystemProvider#source-table">packaged | |
| 77 apps</a> only. | |
| 78 {{/is_apps}} | |
| 79 </td> | |
| 80 </tr> | |
| 81 <tr> | |
| 82 <td> | |
| 83 <code>"device"</code> or <code>"network"</code> | |
| 84 </td> | |
| 85 <td> | |
| 86 $(ref:onMountRequested) | |
| 87 </td> | |
| 88 </tr> | |
| 89 </table> | |
| 90 </p> | |
| 91 | |
| 92 <h2 id="archives">Configuring file systems</h2> | |
| 93 <p> | |
| 94 Provided file systems once mounted can be configured via the | |
| 95 $(ref:onConfigureRequested) event. It's especially useful for file systems which | |
| 96 provide contents via network in order to set proper credentials. Handling this | |
| 97 event is optional. | |
| 37 </p> | 98 </p> |
| 38 | 99 |
| 39 <h2 id="archives">Life cycle</h2> | 100 <h2 id="archives">Life cycle</h2> |
| 40 <p> | 101 <p> |
| 41 Provided file systems once mounted are remembered by Chrome and remounted | 102 Provided file systems once mounted are remembered by Chrome and remounted |
| 42 automatically after reboot or restart. Hence, once a file system is | 103 automatically after reboot or restart. Hence, once a file system is |
| 43 <a href="method-mount">mounted</a> by a providing extension, it will stay until | 104 <a href="#method-mount">mounted</a> by a providing extension, it will stay until |
| 44 either the extension is unloaded, or the extension calls the | 105 either the extension is unloaded, or the extension calls the |
| 45 <a href="#method-unmount"> unmount</a> method. | 106 $(ref:unmount) method. |
| 46 </p> | 107 </p> |
| 108 {{?is_apps}} | |
| 47 <p> | 109 <p> |
| 48 In case of acting as a file handler, the handled file may need to be stored | 110 In case of acting as a file handler, the handled file may need to be stored |
| 49 to access it after either a reboot, or suspending and resuming an event page | 111 to access it after either a reboot, or suspending and resuming an event page |
| 50 of the providing extension. In such case | 112 of the providing extension. In such case $(ref:fileSystem.retainEntry) and |
| 51 <a href="fileSystem#method-retainEntry">chrome.fileSystem.retainEntry</a> and | 113 $(ref:fileSystem.restoreEntry) should be used. |
| 52 <a href="fileSystem#method-restoreEntry">chrome.fileSystem.restoreEntry</a> | |
| 53 should be used. | |
| 54 </p> | 114 </p> |
| 115 {{/is_apps}} | |
| OLD | NEW |