Bug 1282611 - Recheck for captive portal after watcher is initialized. r=MattN

MozReview-Commit-ID: DKUibGPvTrx
This commit is contained in:
Nihanth Subramanya 2016-06-27 16:09:23 -07:00 committed by Panos Astithas
parent c470de115e
commit d201f3429d

View File

@ -47,10 +47,14 @@ this.CaptivePortalWatcher = {
Services.obs.addObserver(this, "captive-portal-login-abort", false);
Services.obs.addObserver(this, "captive-portal-login-success", false);
this._initialized = true;
if (cps.state == cps.LOCKED_PORTAL) {
// A captive portal has already been detected.
this._addCaptivePortalTab();
return;
}
cps.recheckCaptivePortal();
},
uninit() {
@ -110,8 +114,8 @@ this.CaptivePortalWatcher = {
}
let win = RecentWindow.getMostRecentBrowserWindow();
if (!win.document.hasFocus()) {
// The document that got focused was not in a browser window.
if (win != Services.ww.activeWindow) {
// The window that got focused was not a browser window.
return;
}
Services.obs.removeObserver(this, "xul-window-visible");