| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // Use the <code>chrome.fileSystemProvider</code> API to create file systems, | 5 // Use the <code>chrome.fileSystemProvider</code> API to create file systems, |
| 6 // that can be accessible from the file manager on Chrome OS. | 6 // that can be accessible from the file manager on Chrome OS. |
| 7 [implemented_in="chrome/browser/chromeos/extensions/file_system_provider/file_sy
stem_provider_api.h"] | 7 [implemented_in="chrome/browser/chromeos/extensions/file_system_provider/file_sy
stem_provider_api.h"] |
| 8 namespace fileSystemProvider { | 8 namespace fileSystemProvider { |
| 9 // Error codes used by providing extensions in response to requests as well | 9 // Error codes used by providing extensions in response to requests as well |
| 10 // as in case of errors when calling methods of the API. For success, <code> | 10 // as in case of errors when calling methods of the API. For success, <code> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 READ, | 34 READ, |
| 35 WRITE | 35 WRITE |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 // Type of a change detected on the observed directory. | 38 // Type of a change detected on the observed directory. |
| 39 enum ChangeType { | 39 enum ChangeType { |
| 40 CHANGED, | 40 CHANGED, |
| 41 DELETED | 41 DELETED |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // Source of the file system data. | |
| 45 enum FileSystemSource { | |
| 46 // The file system is handling a file, eg. an archive file obtained via the | |
| 47 // <code>onLaunched</code> event and the <code>file_handlers</code> manifest | |
| 48 // entry. | |
| 49 FILE, | |
| 50 | |
| 51 // The file system contents are fetched from an external device, such as a | |
| 52 // USB device, but not via <code>file_handlers</code>. | |
| 53 DEVICE, | |
| 54 | |
| 55 // The file system is network based. The contents are obtained from another | |
| 56 // server or local network. Eg. cloud services. | |
| 57 NETWORK | |
| 58 }; | |
| 59 | |
| 60 // Represents metadata of a file or a directory. | 44 // Represents metadata of a file or a directory. |
| 61 dictionary EntryMetadata { | 45 dictionary EntryMetadata { |
| 62 // True if it is a directory. | 46 // True if it is a directory. |
| 63 boolean isDirectory; | 47 boolean isDirectory; |
| 64 | 48 |
| 65 // Name of this entry (not full path name). Must not contain '/'. For root | 49 // Name of this entry (not full path name). Must not contain '/'. For root |
| 66 // it must be empty. | 50 // it must be empty. |
| 67 DOMString name; | 51 DOMString name; |
| 68 | 52 |
| 69 // File size in bytes. | 53 // File size in bytes. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // of the file system (such as creating, deleting or writing to files). | 102 // of the file system (such as creating, deleting or writing to files). |
| 119 boolean writable; | 103 boolean writable; |
| 120 | 104 |
| 121 // The maximum number of files that can be opened at once. If 0, then not | 105 // The maximum number of files that can be opened at once. If 0, then not |
| 122 // limited. | 106 // limited. |
| 123 long openedFilesLimit; | 107 long openedFilesLimit; |
| 124 | 108 |
| 125 // List of currently opened files. | 109 // List of currently opened files. |
| 126 OpenedFile[] openedFiles; | 110 OpenedFile[] openedFiles; |
| 127 | 111 |
| 128 // Source of the file system data. | |
| 129 FileSystemSource? source; | |
| 130 | |
| 131 // Whether the file system supports the <code>tag</code> field for observing | 112 // Whether the file system supports the <code>tag</code> field for observing |
| 132 // directories. | 113 // directories. |
| 133 [nodoc] boolean? supportsNotifyTag; | 114 [nodoc] boolean? supportsNotifyTag; |
| 134 | 115 |
| 135 // List of watchers. | 116 // List of watchers. |
| 136 [nodoc] Watcher[] watchers; | 117 [nodoc] Watcher[] watchers; |
| 137 }; | 118 }; |
| 138 | 119 |
| 139 // Options for the <code>mount()</code> method. | 120 // Options for the <code>mount()</code> method. |
| 140 dictionary MountOptions { | 121 dictionary MountOptions { |
| 141 // The string indentifier of the file system. Must be unique per each | 122 // The string indentifier of the file system. Must be unique per each |
| 142 // extension. | 123 // extension. |
| 143 DOMString fileSystemId; | 124 DOMString fileSystemId; |
| 144 | 125 |
| 145 // A human-readable name for the file system. | 126 // A human-readable name for the file system. |
| 146 DOMString displayName; | 127 DOMString displayName; |
| 147 | 128 |
| 148 // Whether the file system supports operations which may change contents | 129 // Whether the file system supports operations which may change contents |
| 149 // of the file system (such as creating, deleting or writing to files). | 130 // of the file system (such as creating, deleting or writing to files). |
| 150 boolean? writable; | 131 boolean? writable; |
| 151 | 132 |
| 152 // The maximum number of files that can be opened at once. If not specified, | 133 // The maximum number of files that can be opened at once. If not specified, |
| 153 // or 0, then not limited. | 134 // or 0, then not limited. |
| 154 long? openedFilesLimit; | 135 long? openedFilesLimit; |
| 155 | 136 |
| 156 // Source of the file system data. | |
| 157 FileSystemSource? source; | |
| 158 | |
| 159 // Whether the file system supports the <code>tag</code> field for observed | 137 // Whether the file system supports the <code>tag</code> field for observed |
| 160 // directories. Required in order to enable the internal cache. | 138 // directories. Required in order to enable the internal cache. |
| 161 [nodoc] boolean? supportsNotifyTag; | 139 [nodoc] boolean? supportsNotifyTag; |
| 162 }; | 140 }; |
| 163 | 141 |
| 164 // Options for the <code>unmount()</code> method. | 142 // Options for the <code>unmount()</code> method. |
| 165 dictionary UnmountOptions { | 143 dictionary UnmountOptions { |
| 166 // The identifier of the file system to be unmounted. | 144 // The identifier of the file system to be unmounted. |
| 167 DOMString fileSystemId; | 145 DOMString fileSystemId; |
| 168 }; | 146 }; |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 | 660 |
| 683 // Raised when the watcher should be removed. If an error occurs, then | 661 // Raised when the watcher should be removed. If an error occurs, then |
| 684 // <code>errorCallback</code> must be called. | 662 // <code>errorCallback</code> must be called. |
| 685 [maxListeners=1, nodoc] static void onRemoveWatcherRequested( | 663 [maxListeners=1, nodoc] static void onRemoveWatcherRequested( |
| 686 RemoveWatcherRequestedOptions options, | 664 RemoveWatcherRequestedOptions options, |
| 687 ProviderSuccessCallback successCallback, | 665 ProviderSuccessCallback successCallback, |
| 688 ProviderErrorCallback errorCallback); | 666 ProviderErrorCallback errorCallback); |
| 689 }; | 667 }; |
| 690 }; | 668 }; |
| 691 | 669 |
| OLD | NEW |