Bug 479805: browser.offline should only be consulted during startup. r=dao

This commit is contained in:
Dave Townsend 2009-08-18 16:39:37 +01:00
parent 72a576fb4d
commit 93e942860c
2 changed files with 16 additions and 14 deletions

View File

@ -5296,20 +5296,6 @@ var BrowserOffline = {
var ioService = Components.classes["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService2);
// if ioService is managing the offline status, then ioservice.offline
// is already set correctly. We will continue to allow the ioService
// to manage its offline state until the user uses the "Work Offline" UI.
if (!ioService.manageOfflineStatus) {
// set the initial state
var isOffline = false;
try {
isOffline = gPrefService.getBoolPref("browser.offline");
}
catch (e) { }
ioService.offline = isOffline;
}
this._updateOfflineUI(ioService.offline);
},

View File

@ -265,6 +265,22 @@ BrowserGlue.prototype = {
// handle any UI migration
this._migrateUI();
var ioService = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService2);
// if ioService is managing the offline status, then ioservice.offline
// is already set correctly. We will continue to allow the ioService
// to manage its offline state until the user uses the "Work Offline" UI.
if (!ioService.manageOfflineStatus) {
// set the initial state
try {
ioService.offline = this._prefs.getBoolPref("browser.offline");
}
catch (e) {
ioService.offline = false;
}
}
this._observerService.notifyObservers(null, "browser-ui-startup-complete", "");
},