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 [platforms=("chromeos"), | 7 [platforms=("chromeos"), |
8 implemented_in="chrome/browser/chromeos/extensions/file_system_provider/file_sy
stem_provider_api.h"] | 8 implemented_in="chrome/browser/chromeos/extensions/file_system_provider/file_sy
stem_provider_api.h"] |
9 namespace fileSystemProvider { | 9 namespace fileSystemProvider { |
10 // Error codes used by providing extensions in response to requests. For | 10 // Error codes used by providing extensions in response to requests. For |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // File size in bytes. | 46 // File size in bytes. |
47 double size; | 47 double size; |
48 | 48 |
49 // The last modified time of this entry. | 49 // The last modified time of this entry. |
50 [instanceOf=Date] object modificationTime; | 50 [instanceOf=Date] object modificationTime; |
51 | 51 |
52 // Mime type for the entry. | 52 // Mime type for the entry. |
53 DOMString? mimeType; | 53 DOMString? mimeType; |
54 }; | 54 }; |
55 | 55 |
| 56 // Represents a mounted file system. |
| 57 dictionary FileSystemInfo { |
| 58 DOMString fileSystemId; |
| 59 DOMString displayName; |
| 60 [nodoc] boolean writable; |
| 61 }; |
| 62 |
56 // Options for the <code>mount()</code> method. | 63 // Options for the <code>mount()</code> method. |
57 dictionary MountOptions { | 64 dictionary MountOptions { |
58 DOMString fileSystemId; | 65 DOMString fileSystemId; |
59 DOMString displayName; | 66 DOMString displayName; |
60 [nodoc] boolean? writable; | 67 [nodoc] boolean? writable; |
61 }; | 68 }; |
62 | 69 |
63 // Options for the <code>unmount()</code> method. | 70 // Options for the <code>unmount()</code> method. |
64 dictionary UnmountOptions { | 71 dictionary UnmountOptions { |
65 DOMString fileSystemId; | 72 DOMString fileSystemId; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 double length; | 173 double length; |
167 ArrayBuffer data; | 174 ArrayBuffer data; |
168 }; | 175 }; |
169 | 176 |
170 // Callback to receive the result of mount() function. | 177 // Callback to receive the result of mount() function. |
171 callback MountCallback = void([nodoc, instanceOf=DOMError] object error); | 178 callback MountCallback = void([nodoc, instanceOf=DOMError] object error); |
172 | 179 |
173 // Callback to receive the result of unmount() function. | 180 // Callback to receive the result of unmount() function. |
174 callback UnmountCallback = void([nodoc, instanceOf=DOMError] object error); | 181 callback UnmountCallback = void([nodoc, instanceOf=DOMError] object error); |
175 | 182 |
| 183 // Callback to receive the result of getAll() function. |
| 184 callback GetAllCallback = void(FileSystemInfo[] fileSystems); |
| 185 |
176 // Callback to handle an error raised from the browser. | 186 // Callback to handle an error raised from the browser. |
177 [nocompile] callback ErrorCallback = void([instanceOf=DOMError] object error); | 187 [nocompile] callback ErrorCallback = void([instanceOf=DOMError] object error); |
178 | 188 |
179 // Callback to be called by the providing extension in case of a success. | 189 // Callback to be called by the providing extension in case of a success. |
180 callback ProviderSuccessCallback = void(); | 190 callback ProviderSuccessCallback = void(); |
181 | 191 |
182 // Callback to be called by the providing extension in case of an error. | 192 // Callback to be called by the providing extension in case of an error. |
183 callback ProviderErrorCallback = void(ProviderError error); | 193 callback ProviderErrorCallback = void(ProviderError error); |
184 | 194 |
185 // Success callback for the <code>onGetMetadataRequested</code> event. | 195 // Success callback for the <code>onGetMetadataRequested</code> event. |
(...skipping 29 matching lines...) Expand all Loading... |
215 | 225 |
216 // Unmounts a file system with the given <code>fileSystemId</code>. It | 226 // Unmounts a file system with the given <code>fileSystemId</code>. It |
217 // should be called after <code>onUnmountRequested</code> is invoked. Also, | 227 // should be called after <code>onUnmountRequested</code> is invoked. Also, |
218 // the providing extension can decide to perform unmounting if not requested | 228 // the providing extension can decide to perform unmounting if not requested |
219 // (eg. in case of lost connection, or a file error). If there is no file | 229 // (eg. in case of lost connection, or a file error). If there is no file |
220 // system with the requested id, or unmounting fails, then the | 230 // system with the requested id, or unmounting fails, then the |
221 // <code>errorCallback</code> will be called. | 231 // <code>errorCallback</code> will be called. |
222 static void unmount(UnmountOptions options, | 232 static void unmount(UnmountOptions options, |
223 UnmountCallback successCallback, | 233 UnmountCallback successCallback, |
224 [nocompile] ErrorCallback errorCallback); | 234 [nocompile] ErrorCallback errorCallback); |
| 235 |
| 236 // Returns all file systems mounted by the extension. |
| 237 static void getAll(GetAllCallback callback); |
225 }; | 238 }; |
226 | 239 |
227 interface Events { | 240 interface Events { |
228 // Raised when unmounting for the file system with the <code>fileSystemId | 241 // Raised when unmounting for the file system with the <code>fileSystemId |
229 // </code> identifier is requested. In the response, the <code>unmount | 242 // </code> identifier is requested. In the response, the <code>unmount |
230 // </code> API method should be called together with <code>successCallback | 243 // </code> API method should be called together with <code>successCallback |
231 // </code>. If unmounting is not possible (eg. due to a pending operation), | 244 // </code>. If unmounting is not possible (eg. due to a pending operation), |
232 // then <code>errorCallback</code> must be called. | 245 // then <code>errorCallback</code> must be called. |
233 [maxListeners=1] static void onUnmountRequested( | 246 [maxListeners=1] static void onUnmountRequested( |
234 UnmountRequestedOptions options, | 247 UnmountRequestedOptions options, |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 | 337 |
325 // Raised when writing contents to a file opened previously with <code> | 338 // Raised when writing contents to a file opened previously with <code> |
326 // openRequestId</code> is requested. | 339 // openRequestId</code> is requested. |
327 [maxListeners=1, nodoc] static void onWriteFileRequested( | 340 [maxListeners=1, nodoc] static void onWriteFileRequested( |
328 WriteFileRequestedOptions options, | 341 WriteFileRequestedOptions options, |
329 ProviderSuccessCallback successCallback, | 342 ProviderSuccessCallback successCallback, |
330 ProviderErrorCallback errorCallback); | 343 ProviderErrorCallback errorCallback); |
331 }; | 344 }; |
332 }; | 345 }; |
333 | 346 |
OLD | NEW |