Bug 753565 - webapp.json incorrect on Mac. r=felipe
authorMarco Castelluccio <mar.castelluccio@studenti.unina.it>
Mon, 21 May 2012 13:39:26 -0700
changeset 96782 81c7d89d9d0667bd98d4914b4ff272a6f96952bd
parent 96781 18f739e8ac9db485a360148acaf06dd09e8b2cd3
child 96783 9463528f5c09cfef9397791075347d93d7fca65a
push id1439
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 20:19:22 +0000
treeherdermozilla-aurora@ea74834dccd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs753565
milestone15.0a1
Bug 753565 - webapp.json incorrect on Mac. r=felipe
browser/modules/WebappsInstaller.jsm
--- a/browser/modules/WebappsInstaller.jsm
+++ b/browser/modules/WebappsInstaller.jsm
@@ -103,16 +103,21 @@ function NativeApp(aData) {
                 ? firstLine
                 : firstLine.substr(0, 253) + "...";
   }
   this.shortDescription = sanitize(shortDesc);
 
   this.manifest = app.manifest;
 
   this.profileFolder = Services.dirsvc.get("ProfD", Ci.nsIFile);
+
+  this.webappJson = {
+    "registryDir": this.profileFolder.path,
+    "app": app
+  };
 }
 
 #ifdef XP_WIN
 /*************************************
  * Windows app installer
  *
  * The Windows installation process will generate the following files:
  *
@@ -283,24 +288,19 @@ WinNativeApp.prototype = {
     uninstaller.copyTo(this.uninstallDir, this.uninstallerFile.leafName);
   },
 
   /**
    * Creates the configuration files into their destination folders.
    */
   _createConfigFiles: function() {
     // ${InstallDir}/webapp.json
-    let json = {
-      "registryDir": this.profileFolder.path,
-      "app": this.app
-    };
-
     let configJson = this.installDir.clone();
     configJson.append("webapp.json");
-    writeToFile(configJson, JSON.stringify(json), function() {});
+    writeToFile(configJson, JSON.stringify(this.webappJson), function() {});
 
     // ${InstallDir}/webapp.ini
     let webappINI = this.installDir.clone().QueryInterface(Ci.nsILocalFile);
     webappINI.append("webapp.ini");
 
     let factory = Cc["@mozilla.org/xpcom/ini-processor-factory;1"]
                     .getService(Ci.nsIINIParserFactory);
 
@@ -533,28 +533,19 @@ MacNativeApp.prototype = {
   _copyPrebuiltFiles: function() {
     let webapprt = this.processFolder.clone();
     webapprt.append("webapprt-stub");
     webapprt.copyTo(this.macOSDir, "webapprt");
   },
 
   _createConfigFiles: function() {
     // ${ProfileDir}/webapp.json
-    let json = {
-      "registryDir": this.profileFolder.path,
-      "app": {
-        "origin": this.launchURI.prePath,
-        "installOrigin": "apps.mozillalabs.com",
-        "manifest": this.manifest
-       }
-    };
-
     let configJson = this.appProfileDir.clone();
     configJson.append("webapp.json");
-    writeToFile(configJson, JSON.stringify(json), function() {});
+    writeToFile(configJson, JSON.stringify(this.webappJson), function() {});
 
     // ${InstallDir}/Contents/MacOS/webapp.ini
     let applicationINI = this.macOSDir.clone().QueryInterface(Ci.nsILocalFile);
     applicationINI.append("webapp.ini");
 
     let factory = Cc["@mozilla.org/xpcom/ini-processor-factory;1"]
                     .getService(Ci.nsIINIParserFactory);