diff options
-rw-r--r-- | third_party/closure_compiler/externs/file_manager_private.js | 34 | ||||
-rw-r--r-- | ui/file_manager/file_manager/foreground/js/file_manager_commands.js | 3 |
2 files changed, 37 insertions, 0 deletions
diff --git a/third_party/closure_compiler/externs/file_manager_private.js b/third_party/closure_compiler/externs/file_manager_private.js index d1736ca..761dc6c 100644 --- a/third_party/closure_compiler/externs/file_manager_private.js +++ b/third_party/closure_compiler/externs/file_manager_private.js @@ -201,6 +201,16 @@ var DriveConnectionState; var DeviceEvent; /** + * @typedef {{ + * extensionId: string, + * name: string, + * canConfigure: boolean, + * canAdd: boolean + * }} + */ +var ProvidingExtension; + +/** * @const */ chrome.fileManagerPrivate = {}; @@ -580,6 +590,30 @@ chrome.fileManagerPrivate.setEntryTag = function(entryURL, visibility, key, valu */ chrome.fileManagerPrivate.isPiexLoaderEnabled = function(callback) {}; +/** + * Returns list of available providing extensions. + * @param {function(!Array<!ProvidingExtension>)} callback + */ +chrome.fileManagerPrivate.getProvidingExtensions = function(callback) {}; + +/** + * Requests adding a new provided file system. If not possible, then an error + * via chrome.runtime.lastError is returned. + * @param {string} extensionId + * @param {function()} callback + */ +chrome.fileManagerPrivate.addProvidedFileSystem = + function(extensionId, callback) {}; + +/** + * Requests configuring an existing file system. If not possible, then returns + * an error via chrome.runtime.lastError. + * @param {string} volumeId + * @param {function()} callback + */ +chrome.fileManagerPrivate.configureProvidedFileSystem = + function(volumeId, callback) {}; + /** @type {!ChromeEvent} */ chrome.fileManagerPrivate.onMountCompleted; diff --git a/ui/file_manager/file_manager/foreground/js/file_manager_commands.js b/ui/file_manager/file_manager/foreground/js/file_manager_commands.js index 74c8dc4..743fb67 100644 --- a/ui/file_manager/file_manager/foreground/js/file_manager_commands.js +++ b/ui/file_manager/file_manager/foreground/js/file_manager_commands.js @@ -1251,6 +1251,7 @@ CommandHandler.COMMANDS_['add-new-services'] = /** @type {Command} */ ({ /** * @param {!Event} event Command event. * @param {!FileManager} fileManager FileManager to use. + * @suppress {checkTypes} */ execute: function(event, fileManager) { fileManager.ui.suggestAppsDialog.showProviders( @@ -1258,10 +1259,12 @@ CommandHandler.COMMANDS_['add-new-services'] = /** @type {Command} */ ({ // If a new provider is installed, then launch it so the configuration // dialog is shown (if it's available). if (result === SuggestAppsDialog.Result.SUCCESS) { + // TODO(mtomasz): Pass extension_id to addProvidedFileSystem. chrome.fileManagerPrivate.addProvidedFileSystem(function() { if (chrome.runtime.lastError) { // TODO(mtomasz): Handle the error and let users uninstall the // extension easily. + console.error(chrome.runtime.lastError.message); } }); } |