gecko-dev/webapprt/CommandLineHandler.js
Edward Lee 5b079f0f2c Bug 746213 - Support mozApps.getSelf/getInstalled in desktop runtime to allow apps to access receipts [r=felipe, a=desktop-only]
Import Webapps.jsm to initialize DOMApplicationRegistry, which handles Webapps:GetSelf, etc. messages.

--HG--
extra : rebase_source : 429c9c48e54e39ff0c403d926c5ac35c49b28c3f
2012-04-20 15:56:06 -07:00

35 lines
1.1 KiB
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
// Initialize DOMApplicationRegistry so it can receive and respond to messages
Cu.import("resource://gre/modules/Webapps.jsm");
function CommandLineHandler() {}
CommandLineHandler.prototype = {
classID: Components.ID("{6d69c782-40a3-469b-8bfd-3ee366105a4a}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
handle: function handle(cmdLine) {
Services.ww.openWindow(null,
"chrome://webapprt/content/webapp.xul",
"_blank",
"chrome,dialog=no,all,resizable",
null);
},
helpInfo : "",
};
let components = [CommandLineHandler];
let NSGetFactory = XPCOMUtils.generateNSGetFactory(components);