mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 05:45:33 +00:00
Bug 747601. Only create Info.plist file after webapp icon has been downloaded. r=mstange a=desktop-only.
OSX caches the application info when Info.plist is created and if the icon has not yet been embedded in the .app package, Finder might indefinitely cache a no-icon app
This commit is contained in:
parent
e658a30e40
commit
a6a703eabb
@ -105,5 +105,7 @@ function getIconForApp(aShell, callback) {
|
||||
function onIconDownloaded(aShell, aMimeType, aStatusCode, aIcon, aCallback) {
|
||||
if (Components.isSuccessCode(aStatusCode)) {
|
||||
aShell.processIcon(aMimeType, aIcon, aCallback);
|
||||
} else {
|
||||
aCallback.call(aShell);
|
||||
}
|
||||
}
|
||||
|
@ -495,7 +495,7 @@ MacNativeApp.prototype = {
|
||||
throw(ex);
|
||||
}
|
||||
|
||||
getIconForApp(this);
|
||||
getIconForApp(this, this._createPListFile);
|
||||
},
|
||||
|
||||
_removeInstallation: function(keepProfile) {
|
||||
@ -561,7 +561,10 @@ MacNativeApp.prototype = {
|
||||
writer.setString("Webapp", "Name", this.appName);
|
||||
writer.setString("Webapp", "Profile", this.appProfileDir.leafName);
|
||||
writer.writeFile();
|
||||
},
|
||||
|
||||
_createPListFile: function() {
|
||||
// ${InstallDir}/Contents/Info.plist
|
||||
let infoPListContent = '<?xml version="1.0" encoding="UTF-8"?>\n\
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n\
|
||||
<plist version="1.0">\n\
|
||||
@ -616,7 +619,7 @@ MacNativeApp.prototype = {
|
||||
* @param aCallback a callback function to be called
|
||||
* after the process finishes
|
||||
*/
|
||||
processIcon: function(aMimeType, aIcon) {
|
||||
processIcon: function(aMimeType, aIcon, aCallback) {
|
||||
try {
|
||||
let process = Cc["@mozilla.org/process/util;1"]
|
||||
.createInstance(Ci.nsIProcess);
|
||||
@ -633,6 +636,8 @@ MacNativeApp.prototype = {
|
||||
9);
|
||||
} catch(e) {
|
||||
throw(e);
|
||||
} finally {
|
||||
aCallback.call(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user