Chromium Code Reviews| 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 11 matching lines...) Expand all Loading... | |
| 22 NOT_A_DIRECTORY, | 22 NOT_A_DIRECTORY, |
| 23 INVALID_OPERATION, | 23 INVALID_OPERATION, |
| 24 SECURITY, | 24 SECURITY, |
| 25 ABORT, | 25 ABORT, |
| 26 NOT_A_FILE, | 26 NOT_A_FILE, |
| 27 NOT_EMPTY, | 27 NOT_EMPTY, |
| 28 INVALID_URL, | 28 INVALID_URL, |
| 29 IO | 29 IO |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 // Mode of opening a file. Used by <code>onOpenFileRequested</code>. | |
| 33 enum OpenFileMode { | |
| 34 READ, | |
| 35 WRITE | |
| 36 }; | |
| 37 | |
| 32 // Represents metadata of a file or a directory. | 38 // Represents metadata of a file or a directory. |
| 33 dictionary EntryMetadata { | 39 dictionary EntryMetadata { |
| 34 // True if it is a directory. | 40 // True if it is a directory. |
| 35 boolean isDirectory; | 41 boolean isDirectory; |
| 36 | 42 |
| 37 // Name of this entry (not full path name). | 43 // Name of this entry (not full path name). |
| 38 DOMString name; | 44 DOMString name; |
| 39 | 45 |
| 40 // File size in bytes. | 46 // File size in bytes. |
| 41 double size; | 47 double size; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 ProviderErrorCallback errorCallback); | 115 ProviderErrorCallback errorCallback); |
| 110 | 116 |
| 111 // Raised when metadata of a file or a directory at <code>entryPath</code> | 117 // Raised when metadata of a file or a directory at <code>entryPath</code> |
| 112 // is requested. The metadata should be returned with the <code> | 118 // is requested. The metadata should be returned with the <code> |
| 113 // successCallback</code> call. In case of an error, <code>errorCallback | 119 // successCallback</code> call. In case of an error, <code>errorCallback |
| 114 // </code> must be called. | 120 // </code> must be called. |
| 115 [maxListeners=1] static void onGetMetadataRequested( | 121 [maxListeners=1] static void onGetMetadataRequested( |
| 116 long fileSystemId, | 122 long fileSystemId, |
| 117 DOMString entryPath, | 123 DOMString entryPath, |
| 118 MetadataCallback successCallback, | 124 MetadataCallback successCallback, |
| 119 ErrorCallback errorCallback); | 125 ProviderErrorCallback errorCallback); |
| 120 | 126 |
| 121 // Raised when contents of a directory at <code>directoryPath</code> are | 127 // Raised when contents of a directory at <code>directoryPath</code> are |
| 122 // requested. The results should be returned in chunks by calling the <code> | 128 // requested. The results should be returned in chunks by calling the <code> |
| 123 // successCallback</code> several times. In case of an error, <code> | 129 // successCallback</code> several times. In case of an error, <code> |
| 124 // errorCallback</code> must be called. | 130 // errorCallback</code> must be called. |
| 125 [maxListeners=1] static void onReadDirectoryRequested( | 131 [maxListeners=1] static void onReadDirectoryRequested( |
| 126 long fileSystemId, | 132 long fileSystemId, |
| 127 DOMString directoryPath, | 133 DOMString directoryPath, |
| 128 EntriesCallback successCallback, | 134 EntriesCallback successCallback, |
| 129 ErrorCallback errorCallback); | 135 ProviderErrorCallback errorCallback); |
| 136 | |
| 137 // Raised when opening a file at <code>filePath</code> is requested. | |
| 138 // If <code>create</code> is set to <code>true</code> and the file does not | |
| 139 // exist, then it should be created. | |
| 140 [maxListeners=1] static void onOpenFileRequested( | |
| 141 long fileSystemId, | |
| 142 DOMString filePath, | |
| 143 ProviderSuccessCallback successCallback, | |
| 144 ProviderErrorCallback errorCallback); | |
|
kinaba
2014/05/13 01:30:35
Where's the <code>create</code> and open mode para
mtomasz
2014/05/13 01:55:01
Done.
| |
| 130 }; | 145 }; |
| 131 }; | 146 }; |
| 132 | 147 |
| OLD | NEW |