| 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 |
| 11 // success, <code>OK</code> should be used. | 11 // success, <code>OK</code> should be used. |
| 12 enum ProviderError { | 12 enum ProviderError { |
| 13 OK, | 13 OK, |
| 14 FAILED, | 14 FAILED, |
| 15 IN_USE, | 15 IN_USE, |
| 16 EXISTS, | 16 EXISTS, |
| 17 NOT_FOUND, | 17 NOT_FOUND, |
| 18 ACCESS_DENIED, | 18 ACCESS_DENIED, |
| 19 TOO_MANY_OPENED, | 19 TOO_MANY_OPENED, |
| 20 NO_MEMORY, | 20 NO_MEMORY, |
| 21 NO_SPACE, | 21 NO_SPACE, |
| 22 NOT_A_DIRECTORY, | 22 NOT_A_DIRECTORY, |
| 23 INVALID_OPERATION, | 23 INVALID_OPERATION, |
| 24 SECURITY, | 24 SECURITY, |
| 25 ABORT, | |
| 26 NOT_A_FILE, | 25 NOT_A_FILE, |
| 27 NOT_EMPTY, | 26 NOT_EMPTY, |
| 28 INVALID_URL, | 27 INVALID_URL, |
| 29 IO | 28 IO |
| 30 }; | 29 }; |
| 31 | 30 |
| 32 // Mode of opening a file. Used by <code>onOpenFileRequested</code>. | 31 // Mode of opening a file. Used by <code>onOpenFileRequested</code>. |
| 33 enum OpenFileMode { | 32 enum OpenFileMode { |
| 34 READ, | 33 READ, |
| 35 WRITE | 34 WRITE |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // Options for the <code>onWriteFileRequested()</code> event. | 159 // Options for the <code>onWriteFileRequested()</code> event. |
| 161 dictionary WriteFileRequestedOptions { | 160 dictionary WriteFileRequestedOptions { |
| 162 DOMString fileSystemId; | 161 DOMString fileSystemId; |
| 163 long requestId; | 162 long requestId; |
| 164 long openRequestId; | 163 long openRequestId; |
| 165 double offset; | 164 double offset; |
| 166 double length; | 165 double length; |
| 167 ArrayBuffer data; | 166 ArrayBuffer data; |
| 168 }; | 167 }; |
| 169 | 168 |
| 169 // Options for the <code>onAbortRequested()</code> event. |
| 170 dictionary AbortRequestedOptions { |
| 171 DOMString fileSystemId; |
| 172 long requestId; |
| 173 long operationRequestId; |
| 174 }; |
| 175 |
| 170 // Callback to receive the result of mount() function. | 176 // Callback to receive the result of mount() function. |
| 171 callback MountCallback = void([nodoc, instanceOf=DOMError] object error); | 177 callback MountCallback = void([nodoc, instanceOf=DOMError] object error); |
| 172 | 178 |
| 173 // Callback to receive the result of unmount() function. | 179 // Callback to receive the result of unmount() function. |
| 174 callback UnmountCallback = void([nodoc, instanceOf=DOMError] object error); | 180 callback UnmountCallback = void([nodoc, instanceOf=DOMError] object error); |
| 175 | 181 |
| 176 // Callback to handle an error raised from the browser. | 182 // Callback to handle an error raised from the browser. |
| 177 [nocompile] callback ErrorCallback = void([instanceOf=DOMError] object error); | 183 [nocompile] callback ErrorCallback = void([instanceOf=DOMError] object error); |
| 178 | 184 |
| 179 // Callback to be called by the providing extension in case of a success. | 185 // Callback to be called by the providing extension in case of a success. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 TruncateRequestedOptions options, | 327 TruncateRequestedOptions options, |
| 322 ProviderSuccessCallback successCallback, | 328 ProviderSuccessCallback successCallback, |
| 323 ProviderErrorCallback errorCallback); | 329 ProviderErrorCallback errorCallback); |
| 324 | 330 |
| 325 // Raised when writing contents to a file opened previously with <code> | 331 // Raised when writing contents to a file opened previously with <code> |
| 326 // openRequestId</code> is requested. | 332 // openRequestId</code> is requested. |
| 327 [maxListeners=1, nodoc] static void onWriteFileRequested( | 333 [maxListeners=1, nodoc] static void onWriteFileRequested( |
| 328 WriteFileRequestedOptions options, | 334 WriteFileRequestedOptions options, |
| 329 ProviderSuccessCallback successCallback, | 335 ProviderSuccessCallback successCallback, |
| 330 ProviderErrorCallback errorCallback); | 336 ProviderErrorCallback errorCallback); |
| 337 |
| 338 // Raised when aborting an operation with <code>operationRequestId</code> |
| 339 // is requested. The operation executed with <code>operationRequestId</code> |
| 340 // should be immediately stopped and <code>successCallback</code> of this |
| 341 // abort request executed. If aborting fails, then <code>errorCallback |
| 342 // </code> must be called. Note, that callbacks of the aborted operation |
| 343 // should not be called, as they will be ignored. |
| 344 [maxListeners=1, nodoc] static void onAbortRequested( |
| 345 AbortRequestedOptions options, |
| 346 ProviderSuccessCallback successCallback, |
| 347 ProviderErrorCallback errorCallback); |
| 331 }; | 348 }; |
| 332 }; | 349 }; |
| 333 | 350 |
| OLD | NEW |