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

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: 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..c68fd28b91f204bb088be1d4071ba60ea59f45d3 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -1846,6 +1846,17 @@ FileManager.prototype = {
* Event handler called when some internal task should be executed.
*/
FileManager.prototype.onFileTaskExecute_ = function(id, details) {
+ // Each instance of the file manager receives the event. But it must be
+ // handled once. Let's it be the first instance in the list returned by
rginda 2011/08/31 18:10:03 s/Let's/Let/
+ // getViews.
+ var windows = chrome.extension.getViews({type: 'tab'});
+ for (var i = 0; i < windows.length; i++) {
+ if ('fileManager' in windows[i]) {
rginda 2011/08/31 18:10:03 This seems hokey. Any window with a variable call
+ if (windows[i]['fileManager'] == this) break;
rginda 2011/08/31 18:10:03 Newline and indent before break and return, please
+ else return;
+ }
+ }
+
var urls = details.entries.map(function(entry) {
return entry.toURL();
});
« 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