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 [implemented_in="chrome/browser/chromeos/extensions/file_system_provider/file_sy stem_provider_api.h"] | 7 [implemented_in="chrome/browser/chromeos/extensions/file_system_provider/file_sy stem_provider_api.h"] |
| 8 namespace fileSystemProvider { | 8 namespace fileSystemProvider { |
| 9 // Error codes used by providing extensions in response to requests as well | 9 // Error codes used by providing extensions in response to requests as well |
| 10 // as in case of errors when calling methods of the API. For success, <code> | 10 // as in case of errors when calling methods of the API. For success, <code> |
| (...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>. | 32 // Mode of opening a file. Used by <code>onOpenFileRequested</code>. |
|
not at google - send to devlin
2015/05/12 00:08:51
These should be $(ref:onOpenFileRequested) (there
mtomasz
2015/05/12 08:01:18
I didn't know we can do that in IDL/json. Done.
| |
| 33 enum OpenFileMode { | 33 enum OpenFileMode { |
| 34 READ, | 34 READ, |
| 35 WRITE | 35 WRITE |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 // Type of a change detected on the observed directory. | 38 // Type of a change detected on the observed directory. |
| 39 enum ChangeType { | 39 enum ChangeType { |
| 40 CHANGED, | 40 CHANGED, |
| 41 DELETED | 41 DELETED |
| 42 }; | 42 }; |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 406 Change[]? changes; | 406 Change[]? changes; |
| 407 | 407 |
| 408 // Tag for the notification. Required if the file system was mounted with | 408 // Tag for the notification. Required if the file system was mounted with |
| 409 // the <code>supportsNotifyTag</code> option. Note, that this flag is | 409 // the <code>supportsNotifyTag</code> option. Note, that this flag is |
| 410 // necessary to provide notifications about changes which changed even | 410 // necessary to provide notifications about changes which changed even |
| 411 // when the system was shutdown. | 411 // when the system was shutdown. |
| 412 DOMString? tag; | 412 DOMString? tag; |
| 413 }; | 413 }; |
| 414 | 414 |
| 415 // Options for the <code>onConfigureRequested()</code> event. | 415 // Options for the <code>onConfigureRequested()</code> event. |
| 416 [nodoc] dictionary ConfigureRequestedOptions { | 416 dictionary ConfigureRequestedOptions { |
| 417 // The identifier of the file system to be configured. | 417 // The identifier of the file system to be configured. |
| 418 DOMString fileSystemId; | 418 DOMString fileSystemId; |
| 419 | 419 |
| 420 // The unique identifier of this request. | 420 // The unique identifier of this request. |
| 421 long requestId; | 421 long requestId; |
| 422 }; | 422 }; |
| 423 | 423 |
| 424 // Callback to receive the result of getAll() function. | 424 // Callback to receive the result of getAll() function. |
| 425 callback GetAllCallback = void(FileSystemInfo[] fileSystems); | 425 callback GetAllCallback = void(FileSystemInfo[] fileSystems); |
| 426 | 426 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 481 optional ResultCallback callback); | 481 optional ResultCallback callback); |
| 482 | 482 |
| 483 // Returns all file systems mounted by the extension. | 483 // Returns all file systems mounted by the extension. |
| 484 static void getAll(GetAllCallback callback); | 484 static void getAll(GetAllCallback callback); |
| 485 | 485 |
| 486 // Returns information about a file system with the passed <code> | 486 // Returns information about a file system with the passed <code> |
| 487 // fileSystemId</code>. | 487 // fileSystemId</code>. |
| 488 static void get(DOMString fileSystemId, GetCallback callback); | 488 static void get(DOMString fileSystemId, GetCallback callback); |
| 489 | 489 |
| 490 // Notifies about changes in the watched directory at <code> | 490 // Notifies about changes in the watched directory at <code> |
| 491 // observedPath</code> in <code>recursive</code mode. If the file system is | 491 // observedPath</code> in <code>recursive</code> mode. If the file system is |
| 492 // mounted with <code>supportsNofityTag</code>, then <code>tag</code> must | 492 // mounted with <code>supportsNofityTag</code>, then <code>tag</code> must |
| 493 // be provided, and all changes since the last notification always reported, | 493 // be provided, and all changes since the last notification always reported, |
| 494 // even if the system was shutdown. The last tag can be obtained with <code> | 494 // even if the system was shutdown. The last tag can be obtained with <code> |
| 495 // getAll()</code>. Note, that <code>tag</code> is required in order to | 495 // getAll()</code>. Note, that <code>tag</code> is required in order to |
| 496 // enable the internal cache. | 496 // enable the internal cache. |
| 497 // | 497 // |
| 498 // Value of <code>tag</code> can be any string which is unique per call, | 498 // Value of <code>tag</code> can be any string which is unique per call, |
| 499 // so it's possible to identify the last registered notification. Eg. if | 499 // so it's possible to identify the last registered notification. Eg. if |
| 500 // the providing extension starts after a reboot, and the last registered | 500 // the providing extension starts after a reboot, and the last registered |
| 501 // notification's tag is equal to "123", then it should call notify() for | 501 // notification's tag is equal to "123", then it should call notify() for |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 630 // abort request executed. If aborting fails, then <code>errorCallback | 630 // abort request executed. If aborting fails, then <code>errorCallback |
| 631 // </code> must be called. Note, that callbacks of the aborted operation | 631 // </code> must be called. Note, that callbacks of the aborted operation |
| 632 // must not be called, as they will be ignored. Despite calling <code> | 632 // must not be called, as they will be ignored. Despite calling <code> |
| 633 // errorCallback</code>, the request may be forcibly aborted. | 633 // errorCallback</code>, the request may be forcibly aborted. |
| 634 [maxListeners=1] static void onAbortRequested( | 634 [maxListeners=1] static void onAbortRequested( |
| 635 AbortRequestedOptions options, | 635 AbortRequestedOptions options, |
| 636 ProviderSuccessCallback successCallback, | 636 ProviderSuccessCallback successCallback, |
| 637 ProviderErrorCallback errorCallback); | 637 ProviderErrorCallback errorCallback); |
| 638 | 638 |
| 639 // Raised when showing a configuration dialog for <code>fileSystemId</code> | 639 // Raised when showing a configuration dialog for <code>fileSystemId</code> |
| 640 // is requested. If it's not supported, then this event must not be handled. | 640 // is requested. If it's handled, the <code> |
| 641 [maxListeners=1, nodoc] static void onConfigureRequested( | 641 // file_system_provider.configurable</code> manfiest option must be set to |
| 642 // true. | |
| 643 [maxListeners=1] static void onConfigureRequested( | |
| 642 ConfigureRequestedOptions options, | 644 ConfigureRequestedOptions options, |
| 643 ProviderSuccessCallback successCallback, | 645 ProviderSuccessCallback successCallback, |
| 644 ProviderErrorCallback errorCallback); | 646 ProviderErrorCallback errorCallback); |
| 645 | 647 |
| 646 // Raised when showing a dialog for mounting a new file system is requested. | 648 // Raised when showing a dialog for mounting a new file system is requested. |
| 647 // If the extension/app is a file handler, then this event shouldn't be | 649 // If the extension/app is a file handler, then this event shouldn't be |
| 648 // handled. Instead <code>onLaunched</code> should be handled in order to | 650 // handled. Instead <code>onLaunched</code> should be handled in order to |
| 649 // mount new file systems when a file is opened. | 651 // mount new file systems when a file is opened. For multiple mounts, the |
| 650 [maxListeners=1, nodoc] static void onMountRequested( | 652 // <code>file_system_provider.multiple_mounts</code> manifest option must |
| 653 // be set to true. | |
| 654 [maxListeners=1] static void onMountRequested( | |
| 651 ProviderSuccessCallback successCallback, | 655 ProviderSuccessCallback successCallback, |
| 652 ProviderErrorCallback errorCallback); | 656 ProviderErrorCallback errorCallback); |
| 653 | 657 |
| 654 // Raised when setting a new directory watcher is requested. If an error | 658 // Raised when setting a new directory watcher is requested. If an error |
| 655 // occurs, then <code>errorCallback</code> must be called. | 659 // occurs, then <code>errorCallback</code> must be called. |
| 656 [maxListeners=1, nodoc] static void onAddWatcherRequested( | 660 [maxListeners=1, nodoc] static void onAddWatcherRequested( |
| 657 AddWatcherRequestedOptions options, | 661 AddWatcherRequestedOptions options, |
| 658 ProviderSuccessCallback successCallback, | 662 ProviderSuccessCallback successCallback, |
| 659 ProviderErrorCallback errorCallback); | 663 ProviderErrorCallback errorCallback); |
| 660 | 664 |
| 661 // Raised when the watcher should be removed. If an error occurs, then | 665 // Raised when the watcher should be removed. If an error occurs, then |
| 662 // <code>errorCallback</code> must be called. | 666 // <code>errorCallback</code> must be called. |
| 663 [maxListeners=1, nodoc] static void onRemoveWatcherRequested( | 667 [maxListeners=1, nodoc] static void onRemoveWatcherRequested( |
| 664 RemoveWatcherRequestedOptions options, | 668 RemoveWatcherRequestedOptions options, |
| 665 ProviderSuccessCallback successCallback, | 669 ProviderSuccessCallback successCallback, |
| 666 ProviderErrorCallback errorCallback); | 670 ProviderErrorCallback errorCallback); |
| 667 }; | 671 }; |
| 668 }; | 672 }; |
| 669 | 673 |
| OLD | NEW |