| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 78   // Success callback for the <code>onReadDirectoryRequested</code> event. If | 78   // Success callback for the <code>onReadDirectoryRequested</code> event. If | 
| 79   // more entries will be returned, then <code>hasNext</code> must be true, and | 79   // more entries will be returned, then <code>hasNext</code> must be true, and | 
| 80   // it has to be called again with additional entries. If no more entries are | 80   // it has to be called again with additional entries. If no more entries are | 
| 81   // available, then <code>hasNext</code> must be set to false. | 81   // available, then <code>hasNext</code> must be set to false. | 
| 82   callback EntriesCallback = void(ResourceEntry[] entries, bool hasNext); | 82   callback EntriesCallback = void(ResourceEntry[] entries, bool hasNext); | 
| 83 | 83 | 
| 84   // Success callback for the <code>onReadFileRequested</code> event. If more | 84   // Success callback for the <code>onReadFileRequested</code> event. If more | 
| 85   // data will be returned, then <code>hasNext</code> must be true, and it | 85   // data will be returned, then <code>hasNext</code> must be true, and it | 
| 86   // has to be called again with additional entries. If no more data is | 86   // has to be called again with additional entries. If no more data is | 
| 87   // available, then <code>hasNext</code> must be set to false. | 87   // available, then <code>hasNext</code> must be set to false. | 
| 88   callback FileDataCallback = void(DOMString data, bool hasNext); | 88   callback FileDataCallback = void(ArrayBuffer data, bool hasNext); | 
| 89 | 89 | 
| 90   interface Functions { | 90   interface Functions { | 
| 91     // Mounts a file system with the given <code>displayName</code>. | 91     // Mounts a file system with the given <code>displayName</code>. | 
| 92     // <code>displayName</code> will be shown in the left panel of | 92     // <code>displayName</code> will be shown in the left panel of | 
| 93     // Files.app. <code>displayName</code> can contain any characters | 93     // Files.app. <code>displayName</code> can contain any characters | 
| 94     // including '/', but cannot be an empty string. <code>displayName</code> | 94     // including '/', but cannot be an empty string. <code>displayName</code> | 
| 95     // should be descriptive but doesn't have to be unique. Duplicate display | 95     // should be descriptive but doesn't have to be unique. Duplicate display | 
| 96     // names are uniquified by adding suffix like "(1)" in the Files.app UI. | 96     // names are uniquified by adding suffix like "(1)" in the Files.app UI. | 
| 97     static void mount(DOMString displayName, | 97     static void mount(DOMString displayName, | 
| 98                       MountCallback successCallback, | 98                       MountCallback successCallback, | 
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 138         long fileSystemId, | 138         long fileSystemId, | 
| 139         DOMString directoryPath, | 139         DOMString directoryPath, | 
| 140         EntriesCallback successCallback, | 140         EntriesCallback successCallback, | 
| 141         ProviderErrorCallback errorCallback); | 141         ProviderErrorCallback errorCallback); | 
| 142 | 142 | 
| 143     // Raised when opening a file at <code>filePath</code> is requested. | 143     // Raised when opening a file at <code>filePath</code> is requested. | 
| 144     // If <code>create</code> is set to <code>true</code> and the file does not | 144     // If <code>create</code> is set to <code>true</code> and the file does not | 
| 145     // exist, then it should be created. | 145     // exist, then it should be created. | 
| 146     [maxListeners=1] static void onOpenFileRequested( | 146     [maxListeners=1] static void onOpenFileRequested( | 
| 147         long fileSystemId, | 147         long fileSystemId, | 
|  | 148         long requestId, | 
| 148         DOMString filePath, | 149         DOMString filePath, | 
| 149         OpenFileMode mode, | 150         OpenFileMode mode, | 
| 150         boolean create, | 151         boolean create, | 
| 151         ProviderSuccessCallback successCallback, | 152         ProviderSuccessCallback successCallback, | 
| 152         ProviderErrorCallback errorCallback); | 153         ProviderErrorCallback errorCallback); | 
| 153 | 154 | 
| 154     // Raised when opening a file previously opened with <code>openRequestId | 155     // Raised when opening a file previously opened with <code>openRequestId | 
| 155     // </code> is requested to be closed. | 156     // </code> is requested to be closed. | 
| 156     [maxListeners=1] static void onCloseFileRequested( | 157     [maxListeners=1] static void onCloseFileRequested( | 
| 157         long fileSystemId, | 158         long fileSystemId, | 
| 158         long openRequestId, | 159         long openRequestId, | 
| 159         ProviderSuccessCallback successCallback, | 160         ProviderSuccessCallback successCallback, | 
| 160         ProviderErrorCallback errorCallback); | 161         ProviderErrorCallback errorCallback); | 
| 161 | 162 | 
| 162     // Raised when contents of a file opened previously with <code>openRequestId | 163     // Raised when contents of a file opened previously with <code>openRequestId | 
| 163     // </code>. The results should be returned in chunks by calling <code> | 164     // </code>. The results should be returned in chunks by calling <code> | 
| 164     // successCallback</code> several times. In case of an error, <code> | 165     // successCallback</code> several times. In case of an error, <code> | 
| 165     // errorCallback</code> must be called. | 166     // errorCallback</code> must be called. | 
| 166     [maxListeners=1] static void onReadFileRequested( | 167     [maxListeners=1] static void onReadFileRequested( | 
| 167         long fileSystemId, | 168         long fileSystemId, | 
| 168         long openRequestId, | 169         long openRequestId, | 
| 169         double offset, | 170         double offset, | 
| 170         double length, | 171         double length, | 
| 171         FileDataCallback successCallback, | 172         FileDataCallback successCallback, | 
| 172         ProviderErrorCallback errorCallback); | 173         ProviderErrorCallback errorCallback); | 
| 173   }; | 174   }; | 
| 174 }; | 175 }; | 
| 175 | 176 | 
| OLD | NEW | 
|---|