Bumping manifests a=b2g-bump
[gecko.git] / b2g / components / SystemMessageGlue.js
blobf7c0b3677331412ca9e350c41c80038a5ba300c2
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3  * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 "use strict"
7 const Cc = Components.classes;
8 const Ci = Components.interfaces;
9 const Cu = Components.utils;
11 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
12 Cu.import("resource://gre/modules/Services.jsm");
14 XPCOMUtils.defineLazyModuleGetter(this, "SystemAppProxy",
15                                   "resource://gre/modules/SystemAppProxy.jsm");
17 function SystemMessageGlue() {
20 SystemMessageGlue.prototype = {
21   openApp: function(aPageURL, aManifestURL, aType, aTarget, aShowApp,
22                     aOnlyShowApp, aExtra) {
23     let payload = { url: aPageURL,
24                     manifestURL: aManifestURL,
25                     isActivity: (aType == "activity"),
26                     target: aTarget,
27                     showApp: aShowApp,
28                     onlyShowApp: aOnlyShowApp,
29                     expectingSystemMessage: true,
30                     extra: aExtra };
32     // |SystemAppProxy| will queue "open-app" events for non-activity system
33     // messages without actually sending them until the system app is ready.
34     SystemAppProxy._sendCustomEvent("open-app", payload, (aType == "activity"));
35   },
37   classID: Components.ID("{2846f034-e614-11e3-93cd-74d02b97e723}"),
39   QueryInterface: XPCOMUtils.generateQI([Ci.nsISystemMessageGlue])
42 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SystemMessageGlue]);