Skip to content

Commit

Permalink
Bug 774216. Can't launch apps on B2G since it's seen as XP_UNIX by We…
Browse files Browse the repository at this point in the history
…bappOSUtils. r=felipe
  • Loading branch information
etiennesegonzac committed Jul 16, 2012
1 parent b436e62 commit be4959b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
8 changes: 2 additions & 6 deletions browser/modules/webappsUI.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Webapps.jsm");
Cu.import("resource:///modules/WebappsInstaller.jsm");
Cu.import("resource://gre/modules/WebappOSUtils.jsm");

let webappsUI = {
init: function webappsUI_init() {
Expand All @@ -34,12 +35,7 @@ let webappsUI = {
this.doInstall(data, browser, chromeWin);
break;
case "webapps-launch":
DOMApplicationRegistry.getManifestFor(data.origin, (function(aManifest) {
if (!aManifest)
return;
let manifest = new DOMApplicationManifest(aManifest, data.origin);
this.openURL(manifest.fullLaunchPath(), data.origin);
}).bind(this));
WebappOSUtils.launch(data);
break;
}
},
Expand Down
3 changes: 1 addition & 2 deletions dom/apps/src/Webapps.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ let EXPORTED_SYMBOLS = ["DOMApplicationRegistry", "DOMApplicationManifest"];
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/FileUtils.jsm");
Cu.import("resource://gre/modules/WebappOSUtils.jsm");

const WEBAPP_RUNTIME = Services.appinfo.ID == "webapprt@mozilla.org";

Expand Down Expand Up @@ -172,7 +171,7 @@ let DOMApplicationRegistry = {
this.uninstall(msg);
break;
case "Webapps:Launch":
WebappOSUtils.launch(msg);
Services.obs.notifyObservers(this, "webapps-launch", JSON.stringify(msg));
break;
case "Webapps:GetInstalled":
this.getInstalled(msg);
Expand Down
6 changes: 3 additions & 3 deletions toolkit/webapps/WebappOSUtils.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
const Cc = Components.classes;
const Ci = Components.interfaces;
const CC = Components.Constructor;
const Cu = Components.utils;

Cu.import("resource://gre/modules/Services.jsm");

let EXPORTED_SYMBOLS = ["WebappOSUtils"];

Expand Down Expand Up @@ -73,9 +76,6 @@ let WebappOSUtils = {
} catch (e) {}

return false;
#else
Services.obs.notifyObservers(this, "webapps-launch", JSON.stringify(aData));
return true;
#endif
}
}
2 changes: 2 additions & 0 deletions webapprt/WebappsHandler.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ let Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Webapps.jsm");
Cu.import("resource://gre/modules/WebappsInstaller.jsm");
Cu.import("resource://gre/modules/WebappOSUtils.jsm");

let WebappsHandler = {
init: function() {
Expand All @@ -30,6 +31,7 @@ let WebappsHandler = {
this.doInstall(data, chromeWin);
break;
case "webapps-launch":
WebappOSUtils.launch(data);
break;
}
},
Expand Down

0 comments on commit be4959b

Please sign in to comment.