Chromium Code Reviews| Index: chrome/common/extensions/docs/templates/intros/fileSystemProvider.html |
| diff --git a/chrome/common/extensions/docs/templates/intros/fileSystemProvider.html b/chrome/common/extensions/docs/templates/intros/fileSystemProvider.html |
| index 7ca0ab38c80a3907636ac3abf58904e6b9a74e6c..7aefb672308adaa0a1ba1a86959718a6b50a06b0 100644 |
| --- a/chrome/common/extensions/docs/templates/intros/fileSystemProvider.html |
| +++ b/chrome/common/extensions/docs/templates/intros/fileSystemProvider.html |
| @@ -1,19 +1,31 @@ |
| <h2 id="manifest">Manifest</h2> |
| -<p>You must declare the "fileSystemProvider" permission |
| +<p>You must declare the "fileSystemProvider" permission and section |
| in the <a href="manifest">extension manifest</a> |
| to use the File System Provider API. |
| For example:</p> |
| <pre data-filename="manifest.json"> |
| { |
| - "name": "My extension", |
| + "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.
|
| ... |
| - <b>"permissions": [ |
| + "permissions": [ |
| "fileSystemProvider" |
| - ]</b>, |
| + ], |
| + ... |
| + "file_system_provider": [ |
| + "configurable": true, |
| + "multiple_mounts": true, |
| + "source": "network" |
| + ], |
| ... |
| } |
| </pre> |
| +<p class="api_reference"> |
| +The <code>file_system_provider</code> section must be declared as follows: |
| +{{+partials.manifest_type |
| + type:apis.extensions.manifestTypes.byName.FileSystemProviderCapabilities /}} |
| +</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
|
| + |
| <h2 id="overview">Overview</h2> |
| <p> |
| File System Provider API allows extensions to support virtual file systems, |
| @@ -22,33 +34,82 @@ Use cases include decompressing archives and accessing files in a cloud |
| service other than Drive. |
| </p> |
| -<h2 id="archives">File handlers</h2> |
| +<h2 id="archives">Mounting file systems</h2> |
| <p> |
| -Provided file systems can either provide file system contents from an external |
| -source (such as a remote server), or using a local file (such as an archive) as |
| -its input. |
| +Providing extensions can either provide file system contents from an external |
| +source (such as a remote server or a USB device), or using a local file (such as |
| +an archive) as its input. |
| </p> |
| <p> |
| -In the second case, the providing extension should have a |
| +{{?is_apps}} |
| +For file handlers, the providing extension should have a |
| <a href="manifest/file_handlers">file_handlers</a> manifest entry in order |
| to be launched when the file is selected in the file manager. |
| When the extension is executed with a file to be handled, it has to mount a |
| file system and start serving contents from the provided file. |
| +{{:is_apps}} |
| +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
|
| +</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
|
| +event is not available to extensions. |
| +{{/is_apps}} |
| +</p> |
| +<p> |
| +If the source is network or a device, then the file system should be mounted |
| +when $(ref:onMountRequested) event is called. |
| +</p> |
| +<p> |
| + <table id="source-table"> |
| + <tr> |
| + <th> |
| + <a href="#property-options-source">Source</a> of the file system data |
| + </th> |
| + <th>Entry point</th> |
| + </tr> |
| + <tr> |
| + <td> |
| + <code>"file"</code> |
| + </td> |
| + <td> |
| + {{?is_apps}} |
| + $(ref:app.runtime.onLaunched) |
| + {{:is_apps}} |
| + Available to <a href="/apps/fileSystemProvider#source-table">packaged |
| + apps</a> only. |
| + {{/is_apps}} |
| + </td> |
| + </tr> |
| + <tr> |
| + <td> |
| + <code>"device"</code> or <code>"network"</code> |
| + </td> |
| + <td> |
| + $(ref:onMountRequested) |
| + </td> |
| + </tr> |
| + </table> |
| +</p> |
| + |
| +<h2 id="archives">Configuring file systems</h2> |
| +<p> |
| +Provided file systems once mounted can be configured via the |
| +$(ref:onConfigureRequested) event. It's especially useful for file systems which |
| +provide contents via network in order to set proper credentials. Handling this |
| +event is optional. |
| </p> |
| <h2 id="archives">Life cycle</h2> |
| <p> |
| Provided file systems once mounted are remembered by Chrome and remounted |
| automatically after reboot or restart. Hence, once a file system is |
| -<a href="method-mount">mounted</a> by a providing extension, it will stay until |
| +<a href="#method-mount">mounted</a> by a providing extension, it will stay until |
| either the extension is unloaded, or the extension calls the |
| -<a href="#method-unmount"> unmount</a> method. |
| +$(ref:unmount) method. |
| </p> |
| +{{?is_apps}} |
| <p> |
| In case of acting as a file handler, the handled file may need to be stored |
| to access it after either a reboot, or suspending and resuming an event page |
| -of the providing extension. In such case |
| -<a href="fileSystem#method-retainEntry">chrome.fileSystem.retainEntry</a> and |
| -<a href="fileSystem#method-restoreEntry">chrome.fileSystem.restoreEntry</a> |
| -should be used. |
| +of the providing extension. In such case $(ref:fileSystem.retainEntry) and |
| +$(ref:fileSystem.restoreEntry) should be used. |
| </p> |
| +{{/is_apps}} |