Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1886)

Unified Diff: ui/file_manager/file_manager/foreground/js/file_manager_commands.js

Issue 1378053004: Simplify FileTasks in Files app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/file_tasks.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/file_manager_commands.js
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 84c135886df188bd231190c654571327186aaf21..8fdd596eba57a5c3d0e3ae5f2c8b236207830333 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
@@ -1023,8 +1023,7 @@ CommandHandler.COMMANDS_['open-with'] = /** @type {Command} */ ({
* @param {!FileManager} fileManager FileManager to use.
*/
execute: function(event, fileManager) {
- var tasks = fileManager.taskController.tasks;
- if (tasks) {
+ fileManager.taskController.getFileTasks().then(function(tasks) {
tasks.showTaskPicker(fileManager.ui.defaultTaskPicker,
str('OPEN_WITH_BUTTON_LABEL'),
'',
@@ -1032,7 +1031,11 @@ CommandHandler.COMMANDS_['open-with'] = /** @type {Command} */ ({
tasks.execute(task.taskId);
},
false);
- }
+ })
+ .catch(function(error) {
+ if (error)
+ console.error(error.stack || error);
+ });
},
/**
* @param {!Event} event Command event.
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/file_tasks.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698