diff options
author | mtomasz <mtomasz@chromium.org> | 2015-04-23 10:50:16 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-23 17:50:24 +0000 |
commit | 114c366be51211e75f0fa8c58f034fa4830883cb (patch) | |
tree | 91c62a0c10153eb75379b981a2f1eae5deae894e /ui | |
parent | 1eef00091473e5e77eed220fd3512f28c805eb9b (diff) | |
download | chromium_src-114c366be51211e75f0fa8c58f034fa4830883cb.zip chromium_src-114c366be51211e75f0fa8c58f034fa4830883cb.tar.gz chromium_src-114c366be51211e75f0fa8c58f034fa4830883cb.tar.bz2 |
Migrate from Management API to more detailed private APIs.
The management API is too powerful and not detailed enough for Files app needs.
This CL wires new private APIs to Files app and removed the management
permission.
TEST=Tested manually that adding new providers works.
BUG=474146
Review URL: https://codereview.chromium.org/1089723002
Cr-Commit-Position: refs/heads/master@{#326572}
Diffstat (limited to 'ui')
3 files changed, 10 insertions, 5 deletions
diff --git a/ui/file_manager/file_manager/foreground/js/cws_container_client.js b/ui/file_manager/file_manager/foreground/js/cws_container_client.js index 403d716..9e31923 100644 --- a/ui/file_manager/file_manager/foreground/js/cws_container_client.js +++ b/ui/file_manager/file_manager/foreground/js/cws_container_client.js @@ -194,13 +194,13 @@ CWSContainerClient.prototype.postInstallSuccessMessage_ = function(itemId) { */ CWSContainerClient.prototype.postInitializeMessage_ = function() { new Promise(function(fulfill, reject) { - chrome.management.getAll(function(items) { + chrome.fileManagerPrivate.getProvidingExtensions(function(items) { if (chrome.runtime.lastError) { reject(chrome.runtime.lastError.message); return; } fulfill(items.map(function(item) { - return item.id; + return item.extensionId; })); }) }).then( 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 070b1cd..74c8dc4 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 @@ -1257,8 +1257,14 @@ CommandHandler.COMMANDS_['add-new-services'] = /** @type {Command} */ ({ function(result, itemId) { // If a new provider is installed, then launch it so the configuration // dialog is shown (if it's available). - if (result === SuggestAppsDialog.Result.SUCCESS) - chrome.management.launchApp(assert(itemId), function() {}); + if (result === SuggestAppsDialog.Result.SUCCESS) { + chrome.fileManagerPrivate.addProvidedFileSystem(function() { + if (chrome.runtime.lastError) { + // TODO(mtomasz): Handle the error and let users uninstall the + // extension easily. + } + }); + } }); }, canExecute: CommandUtil.canExecuteAlways diff --git a/ui/file_manager/file_manager/manifest.json b/ui/file_manager/file_manager/manifest.json index 674dd69..60712be 100644 --- a/ui/file_manager/file_manager/manifest.json +++ b/ui/file_manager/file_manager/manifest.json @@ -36,7 +36,6 @@ "https://drive.google.com/", "https://www.google-analytics.com/", "launcherSearchProvider", - "management", "mediaPlayerPrivate", "metricsPrivate", "notifications", |