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

Unified Diff: chrome/browser/resources/file_manager/foreground/js/file_manager.js

Issue 109143005: Files.app: Fix a call of the default task picker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix C++ side bug. Created 7 years 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
Index: chrome/browser/resources/file_manager/foreground/js/file_manager.js
diff --git a/chrome/browser/resources/file_manager/foreground/js/file_manager.js b/chrome/browser/resources/file_manager/foreground/js/file_manager.js
index 0b6e095857b7dec855c5aa347c0addbef6072e14..9b3d394ee8bca5c24433618ed26f26012269ef89 100644
--- a/chrome/browser/resources/file_manager/foreground/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/foreground/js/file_manager.js
@@ -1693,8 +1693,8 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
} else {
var extensions = [];
- for (var i = 0; i < selection.urls.length; i++) {
- var match = /\.(\w+)$/g.exec(selection.urls[i]);
+ for (var i = 0; i < selection.entries.length; i++) {
+ var match = /\.(\w+)$/g.exec(selection.entries[i].toURL());
if (match) {
var ext = match[1].toUpperCase();
if (extensions.indexOf(ext) == -1) {
@@ -1717,7 +1717,6 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
}
};
-
/**
* Sets the given task as default, when this task is applicable.
*
@@ -1727,8 +1726,10 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
FileManager.prototype.onDefaultTaskDone_ = function(task) {
// TODO(dgozman): move this method closer to tasks.
var selection = this.getSelection();
- chrome.fileBrowserPrivate.setDefaultTask(task.taskId,
- selection.urls, selection.mimeTypes);
+ chrome.fileBrowserPrivate.setDefaultTask(
+ task.taskId,
+ util.entriesToURLs(selection.entries),
+ selection.mimeTypes);
selection.tasks = new FileTasks(this);
selection.tasks.init(selection.entries, selection.mimeTypes);
selection.tasks.display(this.taskItems_);

Powered by Google App Engine
This is Rietveld 408576698