Bug 1140815 - Don't leave .part files lying around after a preferred helper app is used to process a URL. r=paolo,mfinkle

This commit is contained in:
Kartikaya Gupta 2015-03-08 21:35:39 -04:00
Родитель f0033b0262
Коммит 6c506d5a30
1 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -153,6 +153,15 @@ HelperAppLauncherDialog.prototype = {
}
});
let callback = function(app) {
aLauncher.MIMEInfo.preferredAction = Ci.nsIMIMEInfo.useHelperApp;
if (!app.launch(aLauncher.source)) {
// Once the app is done we need to get rid of the temp file. This shouldn't
// get run in the saveToDisk case.
aLauncher.cancel(Cr.NS_BINDING_ABORTED);
}
}
// See if the user already marked something as the default for this mimetype,
// and if that app is still installed.
let preferredApp = this._getPreferredApp(aLauncher);
@ -162,18 +171,11 @@ HelperAppLauncherDialog.prototype = {
});
if (pref.length > 0) {
pref[0].launch(aLauncher.source);
callback(pref[0]);
return;
}
}
let callback = function(app) {
aLauncher.MIMEInfo.preferredAction = Ci.nsIMIMEInfo.useHelperApp;
if (!app.launch(aLauncher.source)) {
aLauncher.cancel(Cr.NS_BINDING_ABORTED);
}
}
// If there's only one choice, and we don't want to prompt, go right ahead
// and choose that app automatically.
if (!this._shouldPrompt(aLauncher) && (apps.length === 1)) {