PartnerDistHelperInitializer.js
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2010 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
25 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
26 
27 const Cc = Components.classes;
28 const Ci = Components.interfaces;
29 const Cu = Components.utils;
30 
31 // Class constructor.
33 }
34 
35 // Class definition.
37  // XPCOM goop
38  classDescription: "PartnerDistHelperInitializer XPCOM Component",
39 
40  classID: Components.ID("{fe6eec71-ab2c-483c-8696-662cbbcd8cd3}"),
41  contractID: "@example.com/PartnerDistHelperInitializer;1",
42 
43  QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
44 
46  {
47  category: "app-startup"
48  }
49  ],
50 
51  // nsIObsever
52  observe: function(aSubject, aTopic, aData) {
53  var env = Cc["@mozilla.org/process/environment;1"]
54  .getService(Ci.nsIEnvironment);
55 
56  // This is the addon's directory (which contains install.rdf)
57  var addonDir = __LOCATION__.parent.parent;
58 
59  // set DISTHELPER_DISTINI to point to our add-on's distribution.ini
60  var distIniFile = addonDir.clone();
61  distIniFile.append("distribution");
62  distIniFile.append("distribution.ini");
63 
64  env.set("DISTHELPER_DISTINI", distIniFile.path);
65  dump("setting DISTHELPER_DISTINI: " + distIniFile.path + "\n");
66  Cu.reportError("setting DISTHELPER_DISTINI: " + distIniFile.path + "\n");
67 
68  // set another environment variable to get passed to disthelper
69  env.set("DISTHELPER_FOOFOO", Math.random());
70  }
71 };
72 
73 // XPCOM registration of class.
75 function NSGetModule(compMgr, fileSpec) {
76  return XPCOMUtils.generateModule(components);
77 }
function NSGetModule(compMgr, fileSpec)
sbDeviceFirmwareAutoCheckForUpdate prototype contractID
sbOSDControlService prototype QueryInterface
sbDeviceFirmwareAutoCheckForUpdate prototype classDescription
function PartnerDistHelperInitializer()
sbDeviceFirmwareAutoCheckForUpdate prototype classID
sbWindowsAutoPlayServiceCfg _xpcom_categories
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe