Bug 1085158 - FilePicker.js should use its parent window for the creation of File object, r=bz

This commit is contained in:
Andrea Marchesini 2014-10-21 14:50:21 +01:00
parent ee2a1a8d27
commit 04ab44d36f

View File

@ -10,6 +10,8 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/FileUtils.jsm");
Cu.importGlobalProperties(['File']);
function FilePicker() {
}
@ -143,12 +145,22 @@ FilePicker.prototype = {
if (!f) {
return null;
}
return File(f);
if (this._domWin) {
return new this._domWin.File(f);
}
return new File(f);
},
get domfiles() {
let win = this._domWin;
return this.getEnumerator([this.file], function(file) {
return File(file);
if (win) {
return new win.File(file);
}
return new File(file);
});
},