Commit e366d8d1 authored by Isabella Scalzi's avatar Isabella Scalzi Committed by Commit Bot

[quickview] Change openInNewButtonTap_ to use executeDefault

If the user opens Quick View after selecting multiple files of
different types, the user is unable to use the "open" button from Quick
View. This is due to the openInNewButtonTap_ (OPEN button) handler using
taskController_.executeDefaultTask, which retrieves the tasks for the
entire mutli-selection, rather than for the item shown in Quick View.

Fix this: create a local variable containing the tasks for the currently
viewed item, and retrieve the tasks from here when the "open" button is
clicked from Quick View.

This could potentially be racy. Will address this in a future patch.

Bug: 1038799
Change-Id: Ie4186f4f4162eff1b89d5334bd5b5bcab9089450
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2010236Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733495}
parent e22c75d8
......@@ -65,6 +65,12 @@ class QuickViewController {
*/
this.entries_ = [];
/**
* The tasks for the entry currently shown in Quick View.
* @private {?FileTasks}
*/
this.tasks_ = null;
/**
* The current selection index of this.entries_.
* @private {number}
......@@ -141,7 +147,7 @@ class QuickViewController {
* @private
*/
onOpenInNewButtonTap_(event) {
this.taskController_.executeDefaultTask();
this.tasks_ && this.tasks_.executeDefault();
this.quickView_.close();
}
......@@ -294,6 +300,7 @@ class QuickViewController {
*/
getAvailableTasks_(entry) {
return this.taskController_.getEntryFileTasks(entry).then(tasks => {
this.tasks_ = tasks;
return tasks.getTaskItems();
});
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment