diff --git a/browser/locales/en-US/chrome/browser/browser.properties b/browser/locales/en-US/chrome/browser/browser.properties
index 7f58fe4f6ec..5a0c9acb943 100644
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -357,7 +357,6 @@ webapps.install = Install
webapps.install.accesskey = I
#LOCALIZATION NOTE (webapps.requestInstall) %1$S is the web app name, %2$S is the site from which the web app is installed
webapps.requestInstall = Do you want to install "%1$S" from this site (%2$S)?
-webapps.install.success = Application Installed
# Telemetry opt-out prompt for Aurora and Nightly
# LOCALIZATION NOTE (telemetryOptOutPrompt): %1$S and %3$S will be replaced by
diff --git a/browser/modules/webappsUI.jsm b/browser/modules/webappsUI.jsm
index e24ef83dbe7..052da45b3d8 100644
--- a/browser/modules/webappsUI.jsm
+++ b/browser/modules/webappsUI.jsm
@@ -29,12 +29,10 @@ let webappsUI = {
switch(aTopic) {
case "webapps-ask-install":
- let win = this._getWindowForId(data.oid);
- if (win && win.location.href == data.from) {
- this.doInstall(data, win);
- }
+ let [chromeWin, browser] = this._getBrowserForId(data.oid);
+ if (chromeWin)
+ this.doInstall(data, browser, chromeWin);
break;
-
case "webapps-launch":
DOMApplicationRegistry.getManifestFor(data.origin, (function(aManifest) {
if (!aManifest)
@@ -85,14 +83,27 @@ let webappsUI = {
}
},
- doInstall: function(aData, aWindow) {
- let browser = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell)
- .chromeEventHandler;
+ _getBrowserForId: function(aId) {
+ let someWindow = Services.wm.getMostRecentWindow(null);
- let chromeWin = browser.ownerDocument.defaultView;
- let bundle = chromeWin.gNavigatorBundle;
+ if (someWindow) {
+ let windowUtils = someWindow.QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIDOMWindowUtils);
+ let content = windowUtils.getOuterWindowWithId(aId);
+ if (content) {
+ let browser = content.QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIWebNavigation)
+ .QueryInterface(Ci.nsIDocShell).chromeEventHandler;
+ let win = browser.ownerDocument.defaultView;
+ return [win, browser];
+ }
+ }
+
+ return [null, null];
+ },
+
+ doInstall: function(aData, aBrowser, aWindow) {
+ let bundle = aWindow.gNavigatorBundle;
let mainAction = {
label: bundle.getString("webapps.install"),
@@ -106,14 +117,13 @@ let webappsUI = {
}
DOMApplicationRegistry.confirmInstall(aData, false, localDir);
- installationSuccessNotification(app, chromeWin);
} else {
DOMApplicationRegistry.denyInstall(aData);
}
}
};
- let requestingURI = chromeWin.makeURI(aData.from);
+ let requestingURI = aWindow.makeURI(aData.from);
let manifest = new DOMApplicationManifest(aData.app.manifest, aData.app.origin);
let host;
@@ -124,35 +134,10 @@ let webappsUI = {
}
let message = bundle.getFormattedString("webapps.requestInstall",
- [manifest.name, host]);
+ [manifest.name, host], 2);
- chromeWin.PopupNotifications.show(browser, "webapps-install", message,
- "webapps-notification-icon", mainAction);
- },
+ aWindow.PopupNotifications.show(aBrowser, "webapps-install", message,
+ "webapps-notification-icon", mainAction);
- _getWindowForId: function(aId) {
- let someWindow = Services.wm.getMostRecentWindow(null);
- return someWindow &&
- someWindow.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils)
- .getOuterWindowWithId(aId);
- }
-}
-
-function installationSuccessNotification(app, aWindow) {
- let bundle = aWindow.gNavigatorBundle;
-
- if (("@mozilla.org/alerts-service;1" in Cc)) {
- let notifier;
- try {
- notifier = Cc["@mozilla.org/alerts-service;1"].
- getService(Ci.nsIAlertsService);
-
- notifier.showAlertNotification(app.iconURI.spec,
- bundle.getString("webapps.install.success"),
- app.appNameAsFilename,
- false, null, null);
-
- } catch (ex) {}
}
}
diff --git a/dom/apps/src/Webapps.jsm b/dom/apps/src/Webapps.jsm
index 1ea0011d02b..87c5d551ee1 100644
--- a/dom/apps/src/Webapps.jsm
+++ b/dom/apps/src/Webapps.jsm
@@ -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";
@@ -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);
diff --git a/dom/tests/mochitest/webapps/Makefile.in b/dom/tests/mochitest/webapps/Makefile.in
index d5679ad6163..d2e7e887580 100644
--- a/dom/tests/mochitest/webapps/Makefile.in
+++ b/dom/tests/mochitest/webapps/Makefile.in
@@ -16,7 +16,6 @@ DIRS = \
MOCHITEST_CHROME_FILES = \
test_bug_765063.xul \
- test_bug_771294.xul \
test_install_app.xul \
test_list_api.xul \
test_install_errors.xul \
diff --git a/dom/tests/mochitest/webapps/apps/Makefile.in b/dom/tests/mochitest/webapps/apps/Makefile.in
index e297ba2d478..53f4500dba4 100644
--- a/dom/tests/mochitest/webapps/apps/Makefile.in
+++ b/dom/tests/mochitest/webapps/apps/Makefile.in
@@ -12,7 +12,6 @@ include $(DEPTH)/config/autoconf.mk
MOCHITEST_CHROME_FILES = \
bug_765063.xul \
- bug_771294.xul \
include.html \
wild_crazy.webapp \
wild_crazy.webapp^headers^ \
diff --git a/dom/tests/mochitest/webapps/apps/bug_765063.xul b/dom/tests/mochitest/webapps/apps/bug_765063.xul
index 462f06870cf..8f8d1c01f66 100644
--- a/dom/tests/mochitest/webapps/apps/bug_765063.xul
+++ b/dom/tests/mochitest/webapps/apps/bug_765063.xul
@@ -6,6 +6,6 @@
diff --git a/dom/tests/mochitest/webapps/apps/bug_771294.xul b/dom/tests/mochitest/webapps/apps/bug_771294.xul
deleted file mode 100644
index 66d1d6f7a28..00000000000
--- a/dom/tests/mochitest/webapps/apps/bug_771294.xul
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
diff --git a/dom/tests/mochitest/webapps/test_bug_765063.xul b/dom/tests/mochitest/webapps/test_bug_765063.xul
index 21f503e68f3..5ac9a6d6647 100644
--- a/dom/tests/mochitest/webapps/test_bug_765063.xul
+++ b/dom/tests/mochitest/webapps/test_bug_765063.xul
@@ -18,22 +18,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/toolkit/Makefile.in b/toolkit/Makefile.in
index 29748c67d78..b30fb4c627e 100644
--- a/toolkit/Makefile.in
+++ b/toolkit/Makefile.in
@@ -24,7 +24,6 @@ PARALLEL_DIRS = \
obsolete \
profile \
themes \
- webapps \
$(NULL)
DIRS += \
diff --git a/toolkit/content/PopupNotifications.jsm b/toolkit/content/PopupNotifications.jsm
index d374f4b3980..f6e6d760c63 100644
--- a/toolkit/content/PopupNotifications.jsm
+++ b/toolkit/content/PopupNotifications.jsm
@@ -241,9 +241,6 @@ PopupNotifications.prototype = {
let notifications = this._getNotificationsForBrowser(browser);
notifications.push(notification);
- // Notify observers that we're showing the popup (useful for testing)
- this._notify("showing");
-
let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
if (browser == this.tabbrowser.selectedBrowser && fm.activeWindow == this.window) {
// show panel now
diff --git a/toolkit/themes/gnomestripe/global/alerts/alert.css b/toolkit/themes/gnomestripe/global/alerts/alert.css
index 072923dbd29..69b6412b58c 100644
--- a/toolkit/themes/gnomestripe/global/alerts/alert.css
+++ b/toolkit/themes/gnomestripe/global/alerts/alert.css
@@ -27,11 +27,6 @@
min-width: 46px;
}
-#alertImage {
- max-width: 48px;
- max-height: 48px;
-}
-
.alertTitle {
font-weight: bold;
}
diff --git a/toolkit/themes/winstripe/global/alerts/alert.css b/toolkit/themes/winstripe/global/alerts/alert.css
index 1d70096e0c2..688a6f0c1f4 100644
--- a/toolkit/themes/winstripe/global/alerts/alert.css
+++ b/toolkit/themes/winstripe/global/alerts/alert.css
@@ -32,11 +32,6 @@
font-weight: bold;
}
-#alertImage {
- max-width: 48px;
- max-height: 48px;
-}
-
.alertText {
-moz-margin-end: 6px;
}
diff --git a/toolkit/webapps/Makefile.in b/toolkit/webapps/Makefile.in
deleted file mode 100644
index 8ea5cafd989..00000000000
--- a/toolkit/webapps/Makefile.in
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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/.
-
-DEPTH = ../..
-topsrcdir = @top_srcdir@
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/config/config.mk
-
-EXTRA_PP_JS_MODULES = \
- WebappOSUtils.jsm \
- $(NULL)
-
-include $(topsrcdir)/config/rules.mk
diff --git a/toolkit/webapps/WebappOSUtils.jsm b/toolkit/webapps/WebappOSUtils.jsm
deleted file mode 100644
index c2b4941dd4a..00000000000
--- a/toolkit/webapps/WebappOSUtils.jsm
+++ /dev/null
@@ -1,81 +0,0 @@
-/* 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 CC = Components.Constructor;
-
-let EXPORTED_SYMBOLS = ["WebappOSUtils"];
-
-let WebappOSUtils = {
- launch: function(aData) {
-#ifdef XP_WIN
- let appRegKey;
- try {
- let open = CC("@mozilla.org/windows-registry-key;1",
- "nsIWindowsRegKey", "open");
- let initWithPath = CC("@mozilla.org/file/local;1",
- "nsILocalFile", "initWithPath");
- let initProcess = CC("@mozilla.org/process/util;1",
- "nsIProcess", "init");
-
- appRegKey = open(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
- "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\",
- aData.origin, Ci.nsIWindowsRegKey.ACCESS_READ);
-
- let launchTarget = initWithPath(appRegKey.readStringValue("InstallLocation"));
- launchTarget.append(appRegKey.readStringValue("AppFilename") + ".exe");
-
- let process = initProcess(launchTarget);
- process.runwAsync([], 0);
- } catch (e) {
- return false;
- } finally {
- if (appRegKey) {
- appRegKey.close();
- }
- }
-
- return true;
-#elifdef XP_MACOSX
- let mwaUtils = Cc["@mozilla.org/widget/mac-web-app-utils;1"]
- .createInstance(Ci.nsIMacWebAppUtils);
- let appPath;
- try {
- appPath = mwaUtils.pathForAppWithIdentifier(aData.origin);
- } catch (e) {}
-
- if (appPath) {
- mwaUtils.launchAppWithIdentifier(aData.origin);
- return true;
- }
-
- return false;
-#elifdef XP_UNIX
- let origin = Services.io.newURI(aData.origin, null, null);
- let installDir = "." + origin.scheme + ";" + origin.host;
- if (origin.port != -1)
- installDir += ";" + origin.port;
-
- let exeFile = Services.dirsvc.get("Home", Ci.nsIFile);
- exeFile.append(installDir);
- exeFile.append("webapprt-stub");
-
- try {
- if (exeFile.exists()) {
- let process = Cc["@mozilla.org/process/util;1"]
- .createInstance(Ci.nsIProcess);
- process.init(exeFile);
- process.runAsync([], 0);
- return true;
- }
- } catch (e) {}
-
- return false;
-#else
- Services.obs.notifyObservers(this, "webapps-launch", JSON.stringify(aData));
- return true;
-#endif
- }
-}
diff --git a/widget/cocoa/nsMacWebAppUtils.mm b/widget/cocoa/nsMacWebAppUtils.mm
index 09f21adfdbc..08d4655d1d3 100644
--- a/widget/cocoa/nsMacWebAppUtils.mm
+++ b/widget/cocoa/nsMacWebAppUtils.mm
@@ -37,22 +37,3 @@ NS_IMETHODIMP nsMacWebAppUtils::PathForAppWithIdentifier(const nsAString& bundle
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
}
-
-NS_IMETHODIMP nsMacWebAppUtils::LaunchAppWithIdentifier(const nsAString& bundleIdentifier) {
- NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
-
- NSAutoreleasePool* ap = [[NSAutoreleasePool alloc] init];
-
- // Note this might return false, meaning the app wasnt launched for some reason.
- BOOL success = [[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier:
- [NSString stringWithCharacters:((nsString)bundleIdentifier).get() length:((nsString)bundleIdentifier).Length()]
- options: nil
- additionalEventParamDescriptor: nil
- launchIdentifier: NULL];
-
-
- [ap release];
- return NS_OK;
-
- NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
-}
diff --git a/widget/nsIMacWebAppUtils.idl b/widget/nsIMacWebAppUtils.idl
index 12a42ea17c1..1e47d09b901 100644
--- a/widget/nsIMacWebAppUtils.idl
+++ b/widget/nsIMacWebAppUtils.idl
@@ -17,9 +17,4 @@ interface nsIMacWebAppUtils : nsISupports {
*/
AString pathForAppWithIdentifier(in AString bundleIdentifier);
- /**
- * Launch the app with the given identifier, if it exists.
- */
- void launchAppWithIdentifier(in AString bundleIdentifier);
-
};