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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // Callback to be called by the providing extension in case of an error. | 63 // Callback to be called by the providing extension in case of an error. |
64 callback ProviderErrorCallback = void(ProviderError error); | 64 callback ProviderErrorCallback = void(ProviderError error); |
65 | 65 |
66 // Callback to handle an error raised from the browser. | 66 // Callback to handle an error raised from the browser. |
67 [nocompile] callback ErrorCallback = void([instanceOf=DOMError] object error); | 67 [nocompile] callback ErrorCallback = void([instanceOf=DOMError] object error); |
68 | 68 |
69 // Success callback for the <code>onGetMetadataRequested</code> event. | 69 // Success callback for the <code>onGetMetadataRequested</code> event. |
70 callback MetadataCallback = void(EntryMetadata metadata); | 70 callback MetadataCallback = void(EntryMetadata metadata); |
71 | 71 |
72 // Success callback for the <code>onReadDirectoryRequested</code> event. If | 72 // Success callback for the <code>onReadDirectoryRequested</code> event. If |
73 // more entries will be returned, then <code>hasNext</code> must be true, and | 73 // more entries will be returned, then <code>hasMore</code> must be true, and |
74 // it has to be called again with additional entries. If no more entries are | 74 // it has to be called again with additional entries. If no more entries are |
75 // available, then <code>hasNext</code> must be set to false. | 75 // available, then <code>hasMore</code> must be set to false. |
76 callback EntriesCallback = void(ResourceEntry[] entries, bool hasNext); | 76 callback EntriesCallback = void(ResourceEntry[] entries, bool hasMore); |
77 | 77 |
78 // Success callback for the <code>onReadFileRequested</code> event. If more | 78 // Success callback for the <code>onReadFileRequested</code> event. If more |
79 // data will be returned, then <code>hasNext</code> must be true, and it | 79 // data will be returned, then <code>hasMore</code> must be true, and it |
80 // has to be called again with additional entries. If no more data is | 80 // has to be called again with additional entries. If no more data is |
81 // available, then <code>hasNext</code> must be set to false. | 81 // available, then <code>hasMore</code> must be set to false. |
82 callback FileDataCallback = void(ArrayBuffer data, bool hasNext); | 82 callback FileDataCallback = void(ArrayBuffer data, bool hasMore); |
83 | 83 |
84 interface Functions { | 84 interface Functions { |
85 // Mounts a file system with the given <code>fileSystemId</code> and <code> | 85 // Mounts a file system with the given <code>fileSystemId</code> and <code> |
86 // displayName</code>. <code>displayName</code> will be shown in the left | 86 // displayName</code>. <code>displayName</code> will be shown in the left |
87 // panel of Files.app. <code>displayName</code> can contain any characters | 87 // panel of Files.app. <code>displayName</code> can contain any characters |
88 // including '/', but cannot be an empty string. <code>displayName</code> | 88 // including '/', but cannot be an empty string. <code>displayName</code> |
89 // should be descriptive but doesn't have to be unique. Duplicate display | 89 // should be descriptive but doesn't have to be unique. Duplicate display |
90 // names are uniquified by adding suffix like "(1)" in the Files app UI. | 90 // names are uniquified by adding suffix like "(1)" in the Files app UI. |
91 // | 91 // |
92 // If a file system with the passed <code>fileSystemId</code> is already | 92 // If a file system with the passed <code>fileSystemId</code> is already |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 [maxListeners=1] static void onReadFileRequested( | 167 [maxListeners=1] static void onReadFileRequested( |
168 DOMString fileSystemId, | 168 DOMString fileSystemId, |
169 long openRequestId, | 169 long openRequestId, |
170 double offset, | 170 double offset, |
171 double length, | 171 double length, |
172 FileDataCallback successCallback, | 172 FileDataCallback successCallback, |
173 ProviderErrorCallback errorCallback); | 173 ProviderErrorCallback errorCallback); |
174 }; | 174 }; |
175 }; | 175 }; |
176 | 176 |
OLD | NEW |