| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 // Mime type for the entry. | 57 // Mime type for the entry. |
| 58 DOMString? mimeType; | 58 DOMString? mimeType; |
| 59 | 59 |
| 60 // Thumbnail image as a data URI in either PNG, JPEG or WEBP format, at most | 60 // Thumbnail image as a data URI in either PNG, JPEG or WEBP format, at most |
| 61 // 32 KB in size. Optional, but can be provided only when explicitly | 61 // 32 KB in size. Optional, but can be provided only when explicitly |
| 62 // requested by the <code>onGetMetadataRequested</code> event. | 62 // requested by the <code>onGetMetadataRequested</code> event. |
| 63 DOMString? thumbnail; | 63 DOMString? thumbnail; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 // Represents an observed entry. | 66 // Represents a watcher. |
| 67 dictionary ObservedEntry { | 67 dictionary Watcher { |
| 68 // The path of the entry being observed. | 68 // The path of the entry being observed. |
| 69 DOMString entryPath; | 69 DOMString entryPath; |
| 70 | 70 |
| 71 // Whether observing should include all child entries recursively. | 71 // Whether watching should include all child entries recursively. It can be |
| 72 // true for directories only. |
| 72 boolean recursive; | 73 boolean recursive; |
| 73 | 74 |
| 74 // Tag used by the last notification for the observed path. | 75 // Tag used by the last notification for the watcher. |
| 75 DOMString? lastTag; | 76 DOMString? lastTag; |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 // Represents a mounted file system. | 79 // Represents a mounted file system. |
| 79 dictionary FileSystemInfo { | 80 dictionary FileSystemInfo { |
| 80 // The identifier of the file system. | 81 // The identifier of the file system. |
| 81 DOMString fileSystemId; | 82 DOMString fileSystemId; |
| 82 | 83 |
| 83 // A human-readable name for the file system. | 84 // A human-readable name for the file system. |
| 84 DOMString displayName; | 85 DOMString displayName; |
| 85 | 86 |
| 86 // Whether the file system supports operations which may change contents | 87 // Whether the file system supports operations which may change contents |
| 87 // of the file system (such as creating, deleting or writing to files). | 88 // of the file system (such as creating, deleting or writing to files). |
| 88 boolean writable; | 89 boolean writable; |
| 89 | 90 |
| 90 // Whether the file system supports the <code>tag</code> field for observing | 91 // Whether the file system supports the <code>tag</code> field for observing |
| 91 // directories. | 92 // directories. |
| 92 [nodoc] boolean? supportsNotifyTag; | 93 [nodoc] boolean? supportsNotifyTag; |
| 93 | 94 |
| 94 // List of observed entries. | 95 // List of watchers. |
| 95 [nodoc] ObservedEntry[] observedEntries; | 96 [nodoc] Watcher[] watchers; |
| 96 }; | 97 }; |
| 97 | 98 |
| 98 // Options for the <code>mount()</code> method. | 99 // Options for the <code>mount()</code> method. |
| 99 dictionary MountOptions { | 100 dictionary MountOptions { |
| 100 // The string indentifier of the file system. Must be unique per each | 101 // The string indentifier of the file system. Must be unique per each |
| 101 // extension. | 102 // extension. |
| 102 DOMString fileSystemId; | 103 DOMString fileSystemId; |
| 103 | 104 |
| 104 // A human-readable name for the file system. | 105 // A human-readable name for the file system. |
| 105 DOMString displayName; | 106 DOMString displayName; |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 // The identifier of the file system related to this operation. | 310 // The identifier of the file system related to this operation. |
| 310 DOMString fileSystemId; | 311 DOMString fileSystemId; |
| 311 | 312 |
| 312 // The unique identifier of this request. | 313 // The unique identifier of this request. |
| 313 long requestId; | 314 long requestId; |
| 314 | 315 |
| 315 // An ID of the request to be aborted. | 316 // An ID of the request to be aborted. |
| 316 long operationRequestId; | 317 long operationRequestId; |
| 317 }; | 318 }; |
| 318 | 319 |
| 319 // Options for the <code>onObserveDirectoryRequested()</code> event. | 320 // Options for the <code>onAddWatcherRequested()</code> event. |
| 320 dictionary ObserveDirectoryRequestedOptions { | 321 dictionary AddWatcherRequestedOptions { |
| 321 // The identifier of the file system related to this operation. | 322 // The identifier of the file system related to this operation. |
| 322 DOMString fileSystemId; | 323 DOMString fileSystemId; |
| 323 | 324 |
| 324 // The unique identifier of this request. | 325 // The unique identifier of this request. |
| 325 long requestId; | 326 long requestId; |
| 326 | 327 |
| 327 // The path of the directory to be observed. | 328 // The path of the entry to be observed. |
| 328 DOMString directoryPath; | 329 DOMString entryPath; |
| 329 | 330 |
| 330 // Whether observing should include all child entries recursively. | 331 // Whether observing should include all child entries recursively. It can be |
| 332 // true for directories only. |
| 331 boolean recursive; | 333 boolean recursive; |
| 332 }; | 334 }; |
| 333 | 335 |
| 334 // Options for the <code>onUnobserveEntryRequested()</code> event. | 336 // Options for the <code>onRemoveWatcherRequested()</code> event. |
| 335 dictionary UnobserveEntryRequestedOptions { | 337 dictionary RemoveWatcherRequestedOptions { |
| 336 // The identifier of the file system related to this operation. | 338 // The identifier of the file system related to this operation. |
| 337 DOMString fileSystemId; | 339 DOMString fileSystemId; |
| 338 | 340 |
| 339 // The unique identifier of this request. | 341 // The unique identifier of this request. |
| 340 long requestId; | 342 long requestId; |
| 341 | 343 |
| 342 // Mode of the observed entry. | 344 // The path of the watched entry. |
| 345 DOMString entryPath; |
| 346 |
| 347 // Mode of the watcher. |
| 343 boolean recursive; | 348 boolean recursive; |
| 344 | |
| 345 // The path of the entry to be not observed anymore. | |
| 346 DOMString entryPath; | |
| 347 }; | 349 }; |
| 348 | 350 |
| 349 // Information about a change happened to an entry within the observed | 351 // Information about a change happened to an entry within the observed |
| 350 // directory (including the entry itself). | 352 // directory (including the entry itself). |
| 351 dictionary Change { | 353 dictionary Change { |
| 352 // The path of the changed entry. | 354 // The path of the changed entry. |
| 353 DOMString entryPath; | 355 DOMString entryPath; |
| 354 | 356 |
| 355 // The type of the change which happened to the entry. | 357 // The type of the change which happened to the entry. |
| 356 ChangeType changeType; | 358 ChangeType changeType; |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 // </code> must be called. Note, that callbacks of the aborted operation | 582 // </code> must be called. Note, that callbacks of the aborted operation |
| 581 // must not be called, as they will be ignored. Despite calling <code> | 583 // must not be called, as they will be ignored. Despite calling <code> |
| 582 // errorCallback</code>, the request may be forcibly aborted. | 584 // errorCallback</code>, the request may be forcibly aborted. |
| 583 [maxListeners=1] static void onAbortRequested( | 585 [maxListeners=1] static void onAbortRequested( |
| 584 AbortRequestedOptions options, | 586 AbortRequestedOptions options, |
| 585 ProviderSuccessCallback successCallback, | 587 ProviderSuccessCallback successCallback, |
| 586 ProviderErrorCallback errorCallback); | 588 ProviderErrorCallback errorCallback); |
| 587 | 589 |
| 588 // Raised when setting a new directory watcher is requested. If an error | 590 // Raised when setting a new directory watcher is requested. If an error |
| 589 // occurs, then <code>errorCallback</code> must be called. | 591 // occurs, then <code>errorCallback</code> must be called. |
| 590 [maxListeners=1, nodoc] static void onObserveDirectoryRequested( | 592 [maxListeners=1, nodoc] static void onAddWatcherRequested( |
| 591 ObserveDirectoryRequestedOptions options, | 593 AddWatcherRequestedOptions options, |
| 592 ProviderSuccessCallback successCallback, | 594 ProviderSuccessCallback successCallback, |
| 593 ProviderErrorCallback errorCallback); | 595 ProviderErrorCallback errorCallback); |
| 594 | 596 |
| 595 // Raised when the entry should no longer be observed. If an error occurs, | 597 // Raised when the watcher should be removed. If an error occurs, then |
| 596 // then <code>errorCallback</code> must be called. | 598 // <code>errorCallback</code> must be called. |
| 597 [maxListeners=1, nodoc] static void onUnobserveEntryRequested( | 599 [maxListeners=1, nodoc] static void onRemoveWatcherRequested( |
| 598 UnobserveEntryRequestedOptions options, | 600 RemoveWatcherRequestedOptions options, |
| 599 ProviderSuccessCallback successCallback, | 601 ProviderSuccessCallback successCallback, |
| 600 ProviderErrorCallback errorCallback); | 602 ProviderErrorCallback errorCallback); |
| 601 }; | 603 }; |
| 602 }; | 604 }; |
| 603 | 605 |
| OLD | NEW |