diff --git a/mozilla/browser/components/prefwindow/content/pref-advanced.js b/mozilla/browser/components/prefwindow/content/pref-advanced.js
index c3210b464b0..ae258e9fee7 100644
--- a/mozilla/browser/components/prefwindow/content/pref-advanced.js
+++ b/mozilla/browser/components/prefwindow/content/pref-advanced.js
@@ -166,9 +166,10 @@ function openDeviceManager()
function checkForUpdates()
{
- // XXXben - check for "all types" and the app itself here.
- var em = Components.classes["@mozilla.org/extensions/manager;1"]
- .getService(Components.interfaces.nsIExtensionManager);
- em.update([], 0, Components.interfaces.nsIExtensionManager.UPDATE_TYPE_USERINVOKED);
+ var updates = Components.classes["@mozilla.org/updates/update-service;1"]
+ .getService(Components.interfaces.nsIUpdateService);
+ updates.checkForUpdates([], 0, Components.interfaces.nsIUpdateItem.TYPE_ANY,
+ Components.interfaces.nsIUpdateService.SOURCE_EVENT_USER,
+ window);
}
diff --git a/mozilla/toolkit/mozapps/extensions/content/extensions.js b/mozilla/toolkit/mozapps/extensions/content/extensions.js
index 3d35aa9059e..1a70745284a 100644
--- a/mozilla/toolkit/mozapps/extensions/content/extensions.js
+++ b/mozilla/toolkit/mozapps/extensions/content/extensions.js
@@ -371,7 +371,8 @@ var gExtensionsViewController = {
var updates = Components.classes["@mozilla.org/updates/update-service;1"]
.getService(Components.interfaces.nsIUpdateService);
updates.checkForUpdates(items, items.length, nsIUpdateItem.TYPE_EXTENSION,
- Components.interfaces.nsIUpdateService.SOURCE_EVENT_USER);
+ Components.interfaces.nsIUpdateService.SOURCE_EVENT_USER,
+ window);
},
cmd_uninstall: function ()
diff --git a/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in b/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in
index 3b497fba479..cfba2d1c584 100644
--- a/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in
+++ b/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in
@@ -123,6 +123,8 @@ function nsExtensionManager()
nsExtensionManager.prototype = {
+
+ /////////////////////////////////////////////////////////////////////////////
// nsIObserver
observe: function (aSubject, aTopic, aData)
{
@@ -153,8 +155,11 @@ nsExtensionManager.prototype = {
// Now disable the extension so it won't hurt anything.
this.disableExtension(items[i].id);
}
- this.update(items, items.length,
- Components.interfaces.nsIExtensionManager.UPDATE_TYPE_MISMATCH);
+ var updates = Components.classes["@mozilla.org/updates/update-service;1"]
+ .getService(Components.interfaces.nsIUpdateService);
+ updates.checkForUpdates(items, items.length, Components.interfaces.nsIUpdateItem.TYPE_ADDON,
+ Components.interfaces.nsIExtensionManager.SOURCE_EVENT_MISMATCH,
+ null);
}
}
diff --git a/mozilla/toolkit/mozapps/update/content/update.js b/mozilla/toolkit/mozapps/update/content/update.js
index f851e050f47..64ac3e1df99 100644
--- a/mozilla/toolkit/mozapps/update/content/update.js
+++ b/mozilla/toolkit/mozapps/update/content/update.js
@@ -41,6 +41,7 @@
const nsIUpdateItem = Components.interfaces.nsIUpdateItem;
const nsIUpdateService = Components.interfaces.nsIUpdateService;
+const nsIExtensionManager = Components.interfaces.nsIExtensionManager;
const PREF_APP_ID = "app.id";
const PREF_UPDATE_APP_UPDATESAVAILABLE = "update.app.updatesAvailable";
@@ -61,6 +62,8 @@ var gUpdateWizard = {
shouldSuggestAutoChecking: false,
shouldAutoCheck: false,
+ updatingApp: false,
+
init: function ()
{
gUpdateTypes = window.arguments[0];
@@ -93,6 +96,34 @@ var gUpdateWizard = {
.getService(Components.interfaces.nsIPrefBranch);
pref.setBoolPref("update.extensions.enabled", this.shouldAutoCheck);
}
+
+ if (this.updatingApp) {
+ var updates = Components.classes["@mozilla.org/updates/update-service;1"]
+ .getService(Components.interfaces.nsIUpdateService);
+# If we're not a browser, use the external protocol service to load the URI.
+#ifndef MOZ_PHOENIX
+ var uri = Components.classes["@mozilla.org/network/standard-url;1"]
+ .createInstance(Components.interfaces.nsIURI);
+ uri.spec = updates.appUpdateURL;
+
+ var protocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
+ .getService(Components.interfaces.nsIExternalProtocolService);
+ if (protocolSvc.isExposedProtocol(uri.scheme))
+ protocolSvc.loadUrl(uri);
+# If we're a browser, open a new browser window instead.
+#else
+ var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
+ .getService(Components.interfaces.nsIWindowWatcher);
+ var ary = Components.classes["@mozilla.org/supports-array;1"]
+ .createInstance(Components.interfaces.nsISupportsArray);
+ var url = Components.classes["@mozilla.org/supports-string;1"]
+ .createInstance(Components.interfaces.nsISupportsString);
+ url.data = updates.appUpdateURL;
+ ary.AppendElement(url);
+ ww.openWindow(null, "chrome://browser/content/browser.xul",
+ "_blank", "chrome,all,dialog=no", ary);
+#endif
+ }
},
_setUpButton: function (aButtonID, aButtonKey, aDisabled)
@@ -168,7 +199,8 @@ var gUpdatePage = {
var updates = Components.classes["@mozilla.org/updates/update-service;1"]
.getService(Components.interfaces.nsIUpdateService);
- updates.checkForUpdatesInternal(gUpdateWizard.items, gUpdateWizard.items.length, gUpdateTypes);
+ updates.checkForUpdatesInternal(gUpdateWizard.items, gUpdateWizard.items.length,
+ gUpdateTypes, gSourceEvent);
this._updateState = nsIUpdateService.UPDATED_NONE;
},
@@ -273,6 +305,7 @@ var gFoundPage = {
this._appUpdateExists = true;
this._appSelected = true;
this._appItem = updateitem;
+ document.getElementById("found").setAttribute("next", "appupdate");
}
else {
updateitem.checked = !this._appUpdateExists;
@@ -293,9 +326,11 @@ var gFoundPage = {
var nonAppItem = this._nonAppItems[i];
nonAppItem.checked = !aEvent.target.checked;
}
+ document.getElementById("found").setAttribute("next", "appupdate");
}
else {
this._appItem.checked = false;
+ document.getElementById("found").setAttribute("next", "installing");
}
}
@@ -312,6 +347,18 @@ var gFoundPage = {
}
};
+var gAppUpdatePage = {
+ onPageShow: function ()
+ {
+ gUpdateWizard.setButtonLabels(null, true,
+ null, true,
+ null, true);
+ gUpdateWizard.updatingApp = true;
+
+ document.documentElement.getButton("finish").focus();
+ }
+};
+
var gInstallingPage = {
onPageShow: function ()
{
@@ -355,7 +402,7 @@ var gFinishedPage = {
fEC.hidden = true;
}
- if (gSourceEvent == nsIUpdateService.SOURCE_EVENT_MISMATCH) {
+ if (gSourceEvent == nsIExtensionManager.SOURCE_EVENT_MISMATCH) {
document.getElementById("finishedMismatch").hidden = false;
document.getElementById("incompatibleAlert").hidden = false;
}
diff --git a/mozilla/toolkit/mozapps/update/content/update.xul b/mozilla/toolkit/mozapps/update/content/update.xul
index 2cab56f80eb..90acafda0b7 100644
--- a/mozilla/toolkit/mozapps/update/content/update.xul
+++ b/mozilla/toolkit/mozapps/update/content/update.xul
@@ -113,6 +113,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/toolkit/mozapps/update/content/updates.xml b/mozilla/toolkit/mozapps/update/content/updates.xml
index 9e063bd5c2b..cd32bd11008 100644
--- a/mozilla/toolkit/mozapps/update/content/updates.xml
+++ b/mozilla/toolkit/mozapps/update/content/updates.xml
@@ -48,7 +48,8 @@
this.updateCount = updates.updateCount;
#ifdef XP_WIN
- this._showUpdateInfo();
+ if (parseInt(aData) == Components.interfaces.nsIUpdateService.SOURCE_EVENT_BACKGROUND)
+ this._showUpdateInfo();
#endif
}
]]>
@@ -99,7 +100,8 @@
var updates = Components.classes["@mozilla.org/updates/update-service;1"]
.getService(Components.interfaces.nsIUpdateService);
updates.checkForUpdates([], 0, Components.interfaces.nsIUpdateItem.TYPE_ANY,
- Components.interfaces.nsIUpdateService.SOURCE_EVENT_USER);
+ Components.interfaces.nsIUpdateService.SOURCE_EVENT_USER,
+ window);
]]>