diff --git a/mozilla/browser/base/content/utilityOverlay.js b/mozilla/browser/base/content/utilityOverlay.js
index cce241bd5a8..c372c27b6b4 100644
--- a/mozilla/browser/base/content/utilityOverlay.js
+++ b/mozilla/browser/base/content/utilityOverlay.js
@@ -482,12 +482,16 @@ function buildHelpMenu()
label = strings.getString("updates_resumeDownloadingFallback");
}
}
-
+
var checkForUpdates = document.getElementById("checkForUpdates");
checkForUpdates.label = label;
if (um.activeUpdate && updates.isDownloading)
checkForUpdates.setAttribute("loading", "true");
else
checkForUpdates.removeAttribute("loading");
+
+ // Disable the UI if the update enabled pref has been locked by the
+ // administrator.
+ checkForUpdates.disabled = gPrefService.prefIsLocked("app.update.enabled");
}
diff --git a/mozilla/browser/components/preferences/advanced.js b/mozilla/browser/components/preferences/advanced.js
index bc17c676405..113f5cb27d7 100644
--- a/mozilla/browser/components/preferences/advanced.js
+++ b/mozilla/browser/components/preferences/advanced.js
@@ -93,27 +93,28 @@ var gAdvancedPane = {
updateAppUpdateUI: function ()
{
- var preference = document.getElementById("app.update.autoUpdateEnabled");
- var ids = ["enableAutoInstall", "autoInstallMode", "updateAnd"];
- if (!preference.value)
- for (var i = 0; i < ids.length; ++i)
- document.getElementById(ids[i]).disabled = true;
- else {
- document.getElementById("enableAutoInstall").disabled = false;
- this.updateAutoInstallUI();
- }
+ var preference = document.getElementById("app.update.enabled");
+ document.getElementById("enableAutoInstall").disabled = !preference.value;
+ this.updateAutoInstallUI();
return undefined;
},
updateAutoInstallUI: function ()
{
- var preference = document.getElementById("app.update.autoInstallEnabled");
+ var autoInstallPref = document.getElementById("app.update.autoInstallEnabled");
+ var updateEnabledPref = document.getElementById("app.update.enabled");
var ids = ["autoInstallMode", "updateAnd"];
+ var disabled = !updateEnabledPref.value || !autoInstallPref.value;
for (var i = 0; i < ids.length; ++i)
- document.getElementById(ids[i]).disabled = !preference.value;
+ document.getElementById(ids[i]).disabled = disabled;
return undefined;
},
+ checkForAddonUpdates: function ()
+ {
+ goats
+ },
+
checkForUpdates: function ()
{
var prompter = Components.classes["@mozilla.org/updates/update-prompt;1"]
diff --git a/mozilla/browser/components/preferences/advanced.xul b/mozilla/browser/components/preferences/advanced.xul
index fc35ffa11c4..ba1adb16c3d 100644
--- a/mozilla/browser/components/preferences/advanced.xul
+++ b/mozilla/browser/components/preferences/advanced.xul
@@ -81,15 +81,6 @@
-
-
-
@@ -172,10 +163,9 @@
+ preference="app.update.enabled"/>
+ oncommand="gAdvancedPane.showUpdates();"/>
@@ -190,8 +180,8 @@
+ oncommand="gAdvancedPane.checkForAddonUpdates();"
+ preference="extensions.update.autoUpdateEnabled"/>
diff --git a/mozilla/toolkit/locales/en-US/chrome/mozapps/update/updates.dtd b/mozilla/toolkit/locales/en-US/chrome/mozapps/update/updates.dtd
index f889ad1c241..c697f3f73f2 100755
--- a/mozilla/toolkit/locales/en-US/chrome/mozapps/update/updates.dtd
+++ b/mozilla/toolkit/locales/en-US/chrome/mozapps/update/updates.dtd
@@ -48,8 +48,8 @@
-
+
diff --git a/mozilla/toolkit/locales/en-US/chrome/mozapps/update/updates.properties b/mozilla/toolkit/locales/en-US/chrome/mozapps/update/updates.properties
index 15490622f81..49c29b5df73 100755
--- a/mozilla/toolkit/locales/en-US/chrome/mozapps/update/updates.properties
+++ b/mozilla/toolkit/locales/en-US/chrome/mozapps/update/updates.properties
@@ -48,3 +48,10 @@ resumePausedAfterCloseTitle=Software Update
resumePausedAfterCloseMessage=You have paused downloading this update. Do you want %S to download the update in the background while you continue to browse?
updateReadyToInstallHeader=%S Ready to Install
+
+checker_error-200=AUS: Update XML File Malformed (200)
+checker_error-403=AUS: Access Denied (403)
+checker_error-404=AUS: Update XML File Not Found (404)
+checker_error-500=AUS: Internal Server Error (500)
+checker_error-2152398878=AUS: Update Server Not Found (Contact your Administrator)
+
diff --git a/mozilla/toolkit/mozapps/update/content/updates.css b/mozilla/toolkit/mozapps/update/content/updates.css
index 2b2abfff044..208fd7003df 100755
--- a/mozilla/toolkit/mozapps/update/content/updates.css
+++ b/mozilla/toolkit/mozapps/update/content/updates.css
@@ -132,5 +132,6 @@ wizard[currentpageid="updatesfound"] .wizard-page-box {
margin-bottom: 2px;
-moz-margin-start: 6px !important;
-moz-margin-end: 5px;
+ font-weight: bold;
}
diff --git a/mozilla/toolkit/mozapps/update/content/updates.js b/mozilla/toolkit/mozapps/update/content/updates.js
index b8268ebce20..fd6226950f0 100755
--- a/mozilla/toolkit/mozapps/update/content/updates.js
+++ b/mozilla/toolkit/mozapps/update/content/updates.js
@@ -352,7 +352,7 @@ var gCheckingPage = {
updateListener: {
/**
- * See nsIUpdateCheckListener.idl
+ * See nsIUpdateCheckListener
*/
onProgress: function(request, position, totalSize) {
var pm = document.getElementById("checkingProgress");
@@ -361,9 +361,9 @@ var gCheckingPage = {
},
/**
- * See nsIUpdateCheckListener.idl
+ * See nsIUpdateCheckListener
*/
- onCheckComplete: function(updates, updateCount) {
+ onCheckComplete: function(request, updates, updateCount) {
var aus = Components.classes["@mozilla.org/updates/update-service;1"]
.getService(Components.interfaces.nsIApplicationUpdateService);
gUpdates.update = aus.selectUpdate(updates, updates.length);
@@ -378,10 +378,33 @@ var gCheckingPage = {
},
/**
- * See nsIUpdateCheckListener.idl
+ * See nsIUpdateCheckListener
*/
- onError: function() {
- LOG("UI:CheckingPage", "UpdateCheckListener: ERROR");
+ onError: function(request) {
+ LOG("UI:CheckingPage", "UpdateCheckListener: error");
+
+ try {
+ var status = request.status;
+ }
+ catch (e) {
+ var req = request.channel.QueryInterface(Components.interfaces.nsIRequest);
+ status = req.status;
+ }
+
+ var sbs =
+ Components.classes["@mozilla.org/intl/stringbundle;1"].
+ getService(Components.interfaces.nsIStringBundleService);
+ var updateBundle = sbs.createBundle(URI_UPDATES_PROPERTIES);
+ var reason = updateBundle.GetStringFromName("checker_error-200");
+ try {
+ reason = updateBundle.GetStringFromName("checker_error-" + status);
+ }
+ catch (e) {
+ // If we can't find an error string specific to this status code,
+ // just use the 200 message from above, which means everything
+ // "looks" fine but there was probably an XML error or a bogus file.
+ }
+ gUpdates.advanceToErrorPage(reason);
},
/**
diff --git a/mozilla/toolkit/mozapps/update/public/nsIUpdateService.idl b/mozilla/toolkit/mozapps/update/public/nsIUpdateService.idl
index 1d99301eb20..22fd5ca855e 100644
--- a/mozilla/toolkit/mozapps/update/public/nsIUpdateService.idl
+++ b/mozilla/toolkit/mozapps/update/public/nsIUpdateService.idl
@@ -43,6 +43,7 @@ interface nsIRequest;
interface nsIRequestObserver;
interface nsISimpleEnumerator;
interface nsITimerCallback;
+interface nsIXMLHttpRequest;
[scriptable, uuid(56863a67-bd69-42de-9f40-583e625b457d)]
interface nsIUpdatePatch : nsISupports
@@ -167,22 +168,38 @@ interface nsIUpdate : nsISupports
interface nsIUpdateCheckListener : nsISupports
{
/**
- *
+ * Called every time there is a progress notification loading the Update
+ * Service file.
+ * @param request
+ * The nsIXMLHttpRequest handling the update check.
+ * @param position
+ * The current byte downloaded
+ * @param totalSize
+ * The total number of bytes that have to be downloaded
*/
- void onProgress(in nsIRequest request,
+ void onProgress(in nsIXMLHttpRequest request,
in unsigned long position,
in unsigned long totalSize);
/**
- *
+ * The update check was completed.
+ * @param request
+ * The nsIXMLHttpRequest handling the update check.
+ * @param updates
+ * An array of nsIUpdate objects listing available updates.
+ * @param updateCount
+ * The size of the |updates| array.
*/
- void onCheckComplete([array, size_is(updateCount)] in nsIUpdate updates,
+ void onCheckComplete(in nsIXMLHttpRequest request,
+ [array, size_is(updateCount)] in nsIUpdate updates,
in unsigned long updateCount);
/**
- *
+ * An error occurred while loading the remote update service file.
+ * @param request
+ * The nsIXMLHttpRequest handling the update check.
*/
- void onError();
+ void onError(in nsIXMLHttpRequest request);
};
[scriptable, uuid(22b00276-ec23-4034-a764-395da539b4be)]
diff --git a/mozilla/toolkit/mozapps/update/src/nsUpdateService.js.in b/mozilla/toolkit/mozapps/update/src/nsUpdateService.js.in
index 6cf5a92e850..d64320920f7 100644
--- a/mozilla/toolkit/mozapps/update/src/nsUpdateService.js.in
+++ b/mozilla/toolkit/mozapps/update/src/nsUpdateService.js.in
@@ -499,11 +499,25 @@ UpdateService.prototype = {
var self = this;
var listener = {
- onProgress: function() { },
- onCheckComplete: function(updates, updateCount) {
+ /**
+ * See nsIUpdateService.idl
+ */
+ onProgress: function(request, position, totalSize) {
+ },
+
+ /**
+ * See nsIUpdateService.idl
+ */
+ onCheckComplete: function(request, updates, updateCount) {
self._selectAndInstallUpdate(updates);
},
- onError: function() { },
+
+ /**
+ * See nsIUpdateService.idl
+ */
+ onError: function(request) {
+ LOG("Checker", "Error during background update");
+ },
}
this.backgroundChecker.checkForUpdates(listener, false);
},
@@ -1194,7 +1208,7 @@ Checker.prototype = {
if (updatesElement.nodeName != "updates") {
LOG("Checker", "get_updates: unexpected node name!");
- return [];
+ throw "";
}
var updates = [];
@@ -1222,12 +1236,20 @@ Checker.prototype = {
this.observer.onLoad(event.target);
// Analyze the resulting DOM and determine the set of updates to install
- var updates = this._updates;
-
- LOG("Checker", "Updates available: " + updates.length);
-
- // ... and tell the Update Service about what we discovered.
- this._callback.onCheckComplete(updates, updates.length);
+ try {
+ var updates = this._updates;
+
+ LOG("Checker", "Updates available: " + updates.length);
+
+ // ... and tell the Update Service about what we discovered.
+ this._callback.onCheckComplete(event.target, updates, updates.length);
+ }
+ catch (e) {
+ LOG("Checker", "There was a problem with the update service URL specified, " +
+ "either the XML file was malformed or it does not exist at the location " +
+ "specified");
+ this._callback.onError(event.target);
+ }
},
/**