Bug 861495 - Transplant getOuterWindowWithId from nsIDOMWindowUtils to a window-related service: SignInToWebsite.jsm. r=dolske
authorColby Russell <Sevenspade@gmail.com>
Tue, 07 May 2013 12:34:20 -0400
changeset 141959 fe584ef9c4b6480c4e673b86d4b79b605583e313
parent 141958 c26f304056f214ba10db50bc8b3383e33c325c2c
child 141960 5e9671d84fa2556aef9d9bcc63bbf6f8ce5d3f5c
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske
bugs861495
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 861495 - Transplant getOuterWindowWithId from nsIDOMWindowUtils to a window-related service: SignInToWebsite.jsm. r=dolske
browser/modules/SignInToWebsite.jsm
--- a/browser/modules/SignInToWebsite.jsm
+++ b/browser/modules/SignInToWebsite.jsm
@@ -131,35 +131,26 @@ this.SignInToWebsiteUX = {
   },
 
   // Private
 
   /**
    * Return the chrome window and <browser> for the given outer window ID.
    */
   _getUIForWindowID: function(aWindowID) {
-    let someWindow = Services.wm.getMostRecentWindow("navigator:browser");
-    if (!someWindow) {
-      Logger.reportError("SignInToWebsiteUX", "no window");
-      return [null, null];
-    }
-
-    let windowUtils = someWindow.QueryInterface(Ci.nsIInterfaceRequestor)
-                                .getInterface(Ci.nsIDOMWindowUtils);
-    let content = windowUtils.getOuterWindowWithId(aWindowID);
-
+    let content = Services.wm.getOuterWindowWithId(aWindowID);
     if (content) {
       let browser = content.QueryInterface(Ci.nsIInterfaceRequestor)
                            .getInterface(Ci.nsIWebNavigation)
                            .QueryInterface(Ci.nsIDocShell).chromeEventHandler;
       let chromeWin = browser.ownerDocument.defaultView;
       return [chromeWin, browser];
     }
+
     Logger.reportError("SignInToWebsiteUX", "no content");
-
     return [null, null];
   },
 
   /**
    * Open UI with a content frame displaying aAuthURI so that the user can authenticate with their
    * IDP.  Then tell Identity.jsm the identifier for the window so that it knows that the DOM API
    * calls are for this authentication flow.
    */