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

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

Issue 7776031: Handling file actions in only one instance of file manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handling internal tasks around chrome.fileBrowserPrivate.executeTask. Created 9 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/file_manager.js
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js
index 96a8006f7495d711e88eda74c538a07b5c5c0354..7a318c8c002ad741536efee92c8922531ae699bb 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -1656,6 +1656,7 @@ FileManager.prototype = {
// Tweak images, titles of internal tasks.
var task_parts = task.taskId.split('|');
if (task_parts[0] == this.getExtensionId_()) {
+ task.internal = true;
if (task_parts[1] == 'preview') {
// TODO(serya): This hack needed until task.iconUrl get working
// (see GetFileTasksFileBrowserFunction::RunImpl).
@@ -1790,7 +1791,15 @@ FileManager.prototype = {
};
FileManager.prototype.onTaskButtonClicked_ = function(event) {
- chrome.fileBrowserPrivate.executeTask(event.srcElement.task.taskId,
+ var task = event.srcElement.task;
+ if (task.internal) {
+ // For internal tasks call the handler directly to avoid being handled
+ // multiple times.
+ var taskId = task.taskId.split('|')[1];
+ this.onFileTaskExecute_(taskId, {entries: this.selection.entries});
+ return;
+ }
+ chrome.fileBrowserPrivate.executeTask(task.taskId,
this.selection.urls);
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698