Bug 1593469 - Port bug 1470510: Merge nsXULWindow and nsWebShellWindow. r=jorgk
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Tue, 05 Nov 2019 23:54:06 +0100
changeset 37438 edadee96ce8163c1b6d1917ae8b2a1d12a18e152
parent 37437 e2512bf794d189e23fd412f3e7d12cd877f8e2db
child 37439 9448c6a181aa7b97f35d1f56675532610536278d
push id396
push userclokep@gmail.com
push dateMon, 06 Jan 2020 23:11:57 +0000
reviewersjorgk
bugs1593469, 1470510
Bug 1593469 - Port bug 1470510: Merge nsXULWindow and nsWebShellWindow. r=jorgk # XULWindow -> AppWindow grep -rl 'XULWindow' --exclude-dir=.hg --exclude-dir=suite --exclude-dir=editor . | xargs sed -i 's/XULWindow/AppWindow/g' # xulWin -> appWin grep -rl 'xulWin' --exclude-dir=.hg --exclude-dir=suite --exclude-dir=editor . | xargs sed -i 's/xulWin/appWin/g' # XulWin -> AppWin grep -rl 'XulWin' --exclude-dir=.hg --exclude-dir=suite --exclude-dir=editor . | xargs sed -i 's/XulWin/AppWin/g' # XUL window -> app window grep -ril 'XUL window' --exclude-dir=.hg --exclude-dir=suite --exclude-dir=editor . | xargs sed -i 's/XUL window/app window/gi'
common/src/ExtensionSupport.jsm
mail/base/content/mailWindow.js
mail/components/compose/content/editor.js
mail/components/enterprisepolicies/tests/browser/disable_app_update/browser_policy_disable_app_update.js
mail/components/extensions/parent/ext-mail.js
mail/test/mozmill/shared-modules/WindowHelpers.jsm
mailnews/base/src/nsMessenger.cpp
mailnews/compose/src/nsMsgComposeService.cpp
mailnews/compose/src/nsMsgComposeService.h
--- a/common/src/ExtensionSupport.jsm
+++ b/common/src/ExtensionSupport.jsm
@@ -307,27 +307,27 @@ var ExtensionSupport = {
   },
 
   get openWindows() {
     return openWindowList.values();
   },
 
   _windowListener: {
     // nsIWindowMediatorListener functions
-    onOpenWindow(xulWindow) {
+    onOpenWindow(appWindow) {
       // A new window has opened.
-      let domWindow = xulWindow.docShell.domWindow;
+      let domWindow = appWindow.docShell.domWindow;
 
       // Here we pass no caller ID, so all registered callers get notified.
       ExtensionSupport._waitForLoad(domWindow);
     },
 
-    onCloseWindow(xulWindow) {
+    onCloseWindow(appWindow) {
       // One of the windows has closed.
-      let domWindow = xulWindow.docShell.domWindow;
+      let domWindow = appWindow.docShell.domWindow;
       openWindowList.delete(domWindow);
     },
   },
 
   /**
    * Set up listeners to run the callbacks on the given window.
    *
    * @param aWindow {nsIDOMWindow}  The window to set up.
--- a/mail/base/content/mailWindow.js
+++ b/mail/base/content/mailWindow.js
@@ -185,17 +185,17 @@ function CreateMailWindowGlobals() {
   // Create windows status feedback
   // set the JS implementation of status feedback before creating the c++ one..
   window.MsgStatusFeedback = new nsMsgStatusFeedback();
   // double register the status feedback object as the xul browser window implementation
   window
     .getInterface(Ci.nsIWebNavigation)
     .QueryInterface(Ci.nsIDocShellTreeItem)
     .treeOwner.QueryInterface(Ci.nsIInterfaceRequestor)
-    .getInterface(Ci.nsIXULWindow).XULBrowserWindow = window.MsgStatusFeedback;
+    .getInterface(Ci.nsIAppWindow).XULBrowserWindow = window.MsgStatusFeedback;
 
   window.browserDOMWindow = new nsBrowserAccess();
 
   statusFeedback = Cc["@mozilla.org/messenger/statusfeedback;1"].createInstance(
     Ci.nsIMsgStatusFeedback
   );
   statusFeedback.setWrappedStatusFeedback(window.MsgStatusFeedback);
 
--- a/mail/components/compose/content/editor.js
+++ b/mail/components/compose/content/editor.js
@@ -1478,23 +1478,23 @@ function UpdateWindowTitle() {
       }
 
       var fileType = IsHTMLEditor() ? "html" : "text";
       // Save changed title in the recent pages data in prefs
       SaveRecentFilesPrefs(title, fileType);
     }
 
     // Set window title with " - Composer" or " - Text Editor" appended.
-    var xulWin = document.documentElement;
+    var appWin = document.documentElement;
 
     document.title =
       (title || filename || window.gUntitledString) +
       windowTitle +
-      xulWin.getAttribute("titlemenuseparator") +
-      xulWin.getAttribute("titlemodifier");
+      appWin.getAttribute("titlemenuseparator") +
+      appWin.getAttribute("titlemodifier");
   } catch (e) {
     dump(e);
   }
 }
 
 function SaveRecentFilesPrefs(aTitle, aFileType) {
   var curUrl = StripPassword(GetDocumentUrl());
   var historyCount = Services.prefs.getIntPref("editor.history.url_maximum");
--- a/mail/components/enterprisepolicies/tests/browser/disable_app_update/browser_policy_disable_app_update.js
+++ b/mail/components/enterprisepolicies/tests/browser/disable_app_update/browser_policy_disable_app_update.js
@@ -77,32 +77,32 @@ add_task(async function test_update_abou
  * Waits for the About Dialog to load.
  *
  * @return A promise that returns the domWindow for the About Dialog and
  *         resolves when the About Dialog loads.
  */
 function waitForAboutDialog() {
   return new Promise(resolve => {
     var listener = {
-      onOpenWindow: aXULWindow => {
+      onOpenWindow: aAppWindow => {
         Services.wm.removeListener(listener);
 
         async function aboutDialogOnLoad() {
           domwindow.removeEventListener("load", aboutDialogOnLoad, true);
           let chromeURI = "chrome://messenger/content/aboutDialog.xul";
           is(
             domwindow.document.location.href,
             chromeURI,
             "About dialog appeared"
           );
           resolve(domwindow);
         }
 
-        var domwindow = aXULWindow.docShell.domWindow;
+        var domwindow = aAppWindow.docShell.domWindow;
         domwindow.addEventListener("load", aboutDialogOnLoad, true);
       },
-      onCloseWindow: aXULWindow => {},
+      onCloseWindow: aAppWindow => {},
     };
 
     Services.wm.addListener(listener);
     openAboutDialog();
   });
 }
--- a/mail/components/extensions/parent/ext-mail.js
+++ b/mail/components/extensions/parent/ext-mail.js
@@ -946,17 +946,17 @@ class Window extends WindowBase {
 
   /** Gets the private browsing status of the window. */
   get incognito() {
     return false;
   }
 
   /** Checks if the window is considered always on top. */
   get alwaysOnTop() {
-    return this.xulWindow.zLevel >= Ci.nsIXULWindow.raisedZ;
+    return this.appWindow.zLevel >= Ci.nsIAppWindow.raisedZ;
   }
 
   /** Checks if the window was the last one focused. */
   get isLastFocused() {
     return this.window === windowTracker.topWindow;
   }
 
   /**
--- a/mail/test/mozmill/shared-modules/WindowHelpers.jsm
+++ b/mail/test/mozmill/shared-modules/WindowHelpers.jsm
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = [
   // These are used by test-folder-display-helpers.js and shouldn't really be
   // exported, but it's convenient right now.
   "captureWindowStatesForErrorReporting",
-  "getWindowTypeForXulWindow",
+  "getWindowTypeForAppWindow",
   "hereIsMarkAction",
 
   "plan_for_new_window",
   "wait_for_new_window",
   "plan_for_modal_dialog",
   "wait_for_modal_dialog",
   "plan_for_window_close",
   "wait_for_window_close",
@@ -104,32 +104,32 @@ function getWindowTypeOrId(aWindowElem) 
   if (windowType && !windowType.startsWith("prompt:")) {
     return windowType;
   }
 
   return aWindowElem.getAttribute("id");
 }
 
 /**
- * Return the "windowtype" or "id" for the given xul window if it is available.
+ * Return the "windowtype" or "id" for the given app window if it is available.
  * If not, return null.
  */
-function getWindowTypeForXulWindow(aXULWindow, aBusyOk) {
+function getWindowTypeForAppWindow(aAppWindow, aBusyOk) {
   // Sometimes we are given HTML windows, for which the logic below will
   //  bail.  So we use a fast-path here that should work for HTML and should
   //  maybe also work with XUL.  I'm not going to go into it...
   if (
-    aXULWindow.document &&
-    aXULWindow.document.documentElement &&
-    aXULWindow.document.documentElement.hasAttribute("windowtype")
+    aAppWindow.document &&
+    aAppWindow.document.documentElement &&
+    aAppWindow.document.documentElement.hasAttribute("windowtype")
   ) {
-    return getWindowTypeOrId(aXULWindow.document.documentElement);
+    return getWindowTypeOrId(aAppWindow.document.documentElement);
   }
 
-  let docshell = aXULWindow.docShell;
+  let docshell = aAppWindow.docShell;
   // we need the docshell to exist...
   if (!docshell) {
     return null;
   }
 
   // we can't know if it's the right document until it's not busy
   if (!aBusyOk && docshell.busyFlags) {
     return null;
@@ -151,33 +151,33 @@ function getWindowTypeForXulWindow(aXULW
   // finally, we can now have a windowtype!
   let windowType = getWindowTypeOrId(outerDoc.documentElement);
 
   if (windowType) {
     return windowType;
   }
 
   // As a last resort, use the name given to the DOM window.
-  let domWindow = aXULWindow.docShell.domWindow;
+  let domWindow = aAppWindow.docShell.domWindow;
 
   return domWindow.name;
 }
 
 /**
- * Return the unique id we annotated onto this XUL window during
+ * Return the unique id we annotated onto this app window during
  *  augment_controller.
  */
-function getUniqueIdForXulWindow(aXULWindow) {
+function getUniqueIdForAppWindow(aAppWindow) {
   // html case
-  if (aXULWindow.document && aXULWindow.document.documentElement) {
+  if (aAppWindow.document && aAppWindow.document.documentElement) {
     return "no attr html";
   }
 
   // XUL case
-  let docshell = aXULWindow.docShell;
+  let docshell = aAppWindow.docShell;
   // we need the docshell to exist...
   if (!docshell) {
     return "no docshell";
   }
 
   // it also needs to have content loaded (it starts out not busy with no
   //  content viewer.)
   if (docshell.contentViewer == null) {
@@ -212,18 +212,18 @@ var WindowWatcher = {
     Services.wm.addListener(this);
 
     this._inited = true;
   },
 
   /**
    * Track the windowtypes we are waiting on.  Keys are windowtypes.  When
    *  watching for new windows, values are initially null, and are set to an
-   *  nsIXULWindow when we actually find the window.  When watching for closing
-   *  windows, values are nsIXULWindows.  This symmetry lets us have windows
+   *  nsIAppWindow when we actually find the window.  When watching for closing
+   *  windows, values are nsIAppWindows.  This symmetry lets us have windows
    *  that appear and dis-appear do so without dangerously confusing us (as
    *  long as another one comes along...)
    */
   waitingList: new Map(),
   /**
    * Note that we will be looking for a window with the given window type
    *  (ex: "mailnews:search").  This allows us to be ready if an event shows
    *  up before waitForWindow is called.
@@ -234,27 +234,27 @@ var WindowWatcher = {
 
   /**
    * Like planForWindowOpen but we check for already-existing windows.
    */
   planForAlreadyOpenWindow: function WindowWatcher_planForAlreadyOpenWindow(
     aWindowType
   ) {
     this.waitingList.set(aWindowType, null);
-    // We need to iterate over all the XUL windows and consider them all.
+    // We need to iterate over all the app windows and consider them all.
     //  We can't pass the window type because the window might not have a
     //  window type yet.
     // because this iterates from old to new, this does the right thing in that
     //  side-effects of consider will pick the most recent window.
-    for (let xulWindow of fixIterator(
-      Services.wm.getXULWindowEnumerator(null),
-      Ci.nsIXULWindow
+    for (let appWindow of fixIterator(
+      Services.wm.getAppWindowEnumerator(null),
+      Ci.nsIAppWindow
     )) {
-      if (!this.consider(xulWindow)) {
-        this.monitoringList.push(xulWindow);
+      if (!this.consider(appWindow)) {
+        this.monitoringList.push(appWindow);
       }
     }
   },
 
   /**
    * The current windowType we are waiting to open.  This is mainly a means of
    *  communicating the desired window type to monitorize without having to
    *  put the argument in the eval string.
@@ -274,18 +274,18 @@ var WindowWatcher = {
         ? WINDOW_OPEN_TIMEOUT_MS
         : FIRST_WINDOW_EVER_TIMEOUT_MS,
       this._firstWindowOpened
         ? WINDOW_OPEN_CHECK_INTERVAL_MS
         : FIRST_WINDOW_CHECK_INTERVAL_MS
     );
 
     this.waitingForOpen = null;
-    let xulWindow = this.waitingList.get(aWindowType);
-    let domWindow = xulWindow.docShell.domWindow;
+    let appWindow = this.waitingList.get(aWindowType);
+    let domWindow = appWindow.docShell.domWindow;
     this.waitingList.delete(aWindowType);
     // spin the event loop to make sure any setTimeout 0 calls have gotten their
     //  time in the sun.
     controller.sleep(0);
     this._firstWindowOpened = true;
     // wrap the creation because
     mark_action("winhelp", "new MozMillController()", [aWindowType]);
     let c = new controller.MozMillController(domWindow);
@@ -328,18 +328,18 @@ var WindowWatcher = {
   },
 
   /**
    * This is the nsITimer notification we receive...
    */
   notify: function WindowWatcher_notify() {
     if (this.monitorizeOpen()) {
       // okay, the window is opened, and we should be in its event loop now.
-      let xulWindow = this.waitingList.get(this.waitingForOpen);
-      let domWindow = xulWindow.docShell.domWindow;
+      let appWindow = this.waitingList.get(this.waitingForOpen);
+      let domWindow = appWindow.docShell.domWindow;
       let troller = new controller.MozMillController(domWindow);
       augment_controller(troller, this.waitingForOpen);
 
       this._timer.cancel();
 
       let self = this;
       function startTest() {
         self.planForWindowClose(troller.window);
@@ -422,19 +422,19 @@ var WindowWatcher = {
       },
       "Timeout waiting for modal dialog to open.",
       aTimeout || WINDOW_OPEN_TIMEOUT_MS,
       WINDOW_OPEN_CHECK_INTERVAL_MS
     );
     this.waitingForClose = null;
   },
 
-  planForWindowClose: function WindowWatcher_planForWindowClose(aXULWindow) {
-    let windowType = getWindowTypeOrId(aXULWindow.document.documentElement);
-    this.waitingList.set(windowType, aXULWindow);
+  planForWindowClose: function WindowWatcher_planForWindowClose(aAppWindow) {
+    let windowType = getWindowTypeOrId(aAppWindow.document.documentElement);
+    this.waitingList.set(windowType, aAppWindow);
     this.waitingForClose = windowType;
   },
 
   /**
    * The current windowType we are waiting to close.  Same deal as
    *  waitingForOpen, this makes the eval less crazy.
    */
   waitingForClose: null,
@@ -455,39 +455,39 @@ var WindowWatcher = {
   },
 
   /**
    * This notification gets called when windows tell the window mediator when
    *  the window title gets changed.  In theory, we could use this to be
    *  event driven with less polling (effort), but it is not to be.
    */
   onWindowTitleChange: function WindowWatcher_onWindowTitleChange(
-    aXULWindow,
+    aAppWindow,
     aNewTitle
   ) {
     mark_action("winhelp", "onWindowTitleChange", [
-      getWindowTypeForXulWindow(aXULWindow, true) +
+      getWindowTypeForAppWindow(aAppWindow, true) +
         " (" +
-        getUniqueIdForXulWindow(aXULWindow) +
+        getUniqueIdForAppWindow(aAppWindow) +
         ")",
       "changed title to",
       aNewTitle,
     ]);
   },
 
   /**
    * Used by waitForWindowOpen to check all of the windows we are monitoring and
    *  then check if we have any results.
    *
    * @return true if we found what we were |waitingForOpen|, false otherwise.
    */
   monitorizeOpen() {
     for (let iWin = this.monitoringList.length - 1; iWin >= 0; iWin--) {
-      let xulWindow = this.monitoringList[iWin];
-      if (this.consider(xulWindow)) {
+      let appWindow = this.monitoringList[iWin];
+      if (this.consider(appWindow)) {
         this.monitoringList.splice(iWin, 1);
       }
     }
 
     return (
       this.waitingList.has(this.waitingForOpen) &&
       this.waitingList.get(this.waitingForOpen) != null
     );
@@ -499,90 +499,90 @@ var WindowWatcher = {
    *
    * @return true if it closed.
    */
   monitorizeClose() {
     return this.waitingList.get(this.waitingForClose) == null;
   },
 
   /**
-   * A list of xul windows to monitor because they are loading and it's not yet
+   * A list of app windows to monitor because they are loading and it's not yet
    *  possible to tell whether they are something we are looking for.
    */
   monitoringList: [],
   /**
    * Monitor the given window's loading process until we can determine whether
    *  it is what we are looking for.
    */
-  monitorWindowLoad(aXULWindow) {
-    this.monitoringList.push(aXULWindow);
+  monitorWindowLoad(aAppWindow) {
+    this.monitoringList.push(aAppWindow);
   },
 
   /**
-   * nsIWindowMediatorListener notification that a XUL window was opened.  We
+   * nsIWindowMediatorListener notification that a app window was opened.  We
    *  check out the window, and if we were not able to fully consider it, we
    *  add it to our monitoring list.
    */
-  onOpenWindow: function WindowWatcher_onOpenWindow(aXULWindow) {
+  onOpenWindow: function WindowWatcher_onOpenWindow(aAppWindow) {
     // note: we would love to add our window activation/deactivation listeners
     //  and poke our unique id, but there is no contentViewer at this point
-    //  and so there's no place to poke our unique id.  (aXULWindow does not
+    //  and so there's no place to poke our unique id.  (aAppWindow does not
     //  let us put expandos on; it's an XPCWrappedNative and explodes.)
     // There may be nuances about outer window/inner window that make it
     //  feasible, but I have forgotten any such nuances I once knew.
 
     // It would be great to be able to indicate if the window is modal or not,
     //  but nothing is really jumping out at me to enable that...
     mark_action("winhelp", "onOpenWindow", [
-      getWindowTypeForXulWindow(aXULWindow, true) +
+      getWindowTypeForAppWindow(aAppWindow, true) +
         " (" +
-        getUniqueIdForXulWindow(aXULWindow) +
+        getUniqueIdForAppWindow(aAppWindow) +
         ")",
       "active?",
-      Services.focus.focusedWindow == aXULWindow,
+      Services.focus.focusedWindow == aAppWindow,
     ]);
 
-    if (!this.consider(aXULWindow)) {
-      this.monitorWindowLoad(aXULWindow);
+    if (!this.consider(aAppWindow)) {
+      this.monitorWindowLoad(aAppWindow);
     }
   },
 
   /**
    * Consider if the given window is something in our |waitingList|.
    *
    * @return true if we were able to fully consider the object, false if we were
    *     not and need to be called again on the window later.  This has no
    *     relation to whether the window was one in our waitingList or not.
    *     Check the waitingList structure for that.
    */
-  consider(aXULWindow) {
-    let windowType = getWindowTypeForXulWindow(aXULWindow);
+  consider(aAppWindow) {
+    let windowType = getWindowTypeForAppWindow(aAppWindow);
     if (windowType == null) {
       return false;
     }
 
     // stash the window if we were watching for it
     if (this.waitingList.has(windowType)) {
-      this.waitingList.set(windowType, aXULWindow);
+      this.waitingList.set(windowType, aAppWindow);
     }
 
     return true;
   },
 
   /**
    * Closing windows have the advantage of having to already have been loaded,
    *  so things like their windowtype are immediately available.
    */
-  onCloseWindow: function WindowWatcher_onCloseWindow(aXULWindow) {
-    let domWindow = aXULWindow.docShell.domWindow;
+  onCloseWindow: function WindowWatcher_onCloseWindow(aAppWindow) {
+    let domWindow = aAppWindow.docShell.domWindow;
     let windowType = getWindowTypeOrId(domWindow.document.documentElement);
     mark_action("winhelp", "onCloseWindow", [
-      getWindowTypeForXulWindow(aXULWindow, true) +
+      getWindowTypeForAppWindow(aAppWindow, true) +
         " (" +
-        getUniqueIdForXulWindow(aXULWindow) +
+        getUniqueIdForAppWindow(aAppWindow) +
         ")",
     ]);
     if (this.waitingList.has(windowType)) {
       this.waitingList.set(windowType, null);
     }
   },
 };
 
@@ -686,17 +686,17 @@ function wait_for_modal_dialog(aWindowTy
  *  controller's window to disappear.  You then follow this with a call to
  *  |wait_for_window_close| when you want to block on verifying the close.
  *
  * @param aController The MozmillController, potentially returned from a call to
  *     wait_for_new_window, whose window should be disappearing.
  */
 function plan_for_window_close(aController) {
   mark_action("fdh", "plan_for_window_close", [
-    getWindowTypeForXulWindow(aController.window, true),
+    getWindowTypeForAppWindow(aController.window, true),
   ]);
   WindowWatcher.ensureInited();
   WindowWatcher.planForWindowClose(aController.window);
 }
 
 /**
  * Wait for the closure of the window you noted you would listen for its close
  *  in plan_for_window_close.
@@ -1253,19 +1253,19 @@ var AugmentEverybodyWith = {
      * mark_action helper method that produces something that can be concat()ed
      *  onto a list being passed to mark_action in order to describe the focus
      *  state of the window.  For now this will be a variable-length list but
      *  could be changed to a single object in the future.
      */
     describeFocus() {
       let arr = [
         "in window:",
-        getWindowTypeForXulWindow(this.window) +
+        getWindowTypeForAppWindow(this.window) +
           " (" +
-          getUniqueIdForXulWindow(this.window) +
+          getUniqueIdForAppWindow(this.window) +
           ")",
       ];
       let focusedWinOut = {},
         focusedElement,
         curWindow = this.window;
       // Use the focus manager to walk down through focused sub-frames so
       //  in the event that there is no focused element but there is a focused
       //  sub-frame, we can know that.
--- a/mailnews/base/src/nsMessenger.cpp
+++ b/mailnews/base/src/nsMessenger.cpp
@@ -249,17 +249,17 @@ NS_IMETHODIMP nsMessenger::SetWindow(moz
       // charset on mDocshell the next time we try to load something into it.
       mCurrentDisplayCharset = "";
 
       if (aMsgWindow)
         aMsgWindow->GetTransactionManager(getter_AddRefs(mTxnMgr));
     }
 
     // we don't always have a message pane, like in the addressbook
-    // so if we don't have a docshell, use the one for the xul window.
+    // so if we don't have a docshell, use the one for the app window.
     // we do this so OpenURL() will work.
     if (!mDocShell) mDocShell = docShell;
   }  // if aWin
   else {
     // Remove the folder listener if we added it, i.e. if mWindow is non-null
     if (mWindow) {
       rv = mailSession->RemoveFolderListener(this);
       NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/compose/src/nsMsgComposeService.cpp
+++ b/mailnews/compose/src/nsMsgComposeService.cpp
@@ -17,17 +17,17 @@
 #include "nsISupportsPrimitives.h"
 #include "nsIWindowWatcher.h"
 #include "mozIDOMWindow.h"
 #include "nsIContentViewer.h"
 #include "nsIMsgWindow.h"
 #include "nsIDocShell.h"
 #include "nsPIDOMWindow.h"
 #include "mozilla/dom/Document.h"
-#include "nsIXULWindow.h"
+#include "nsIAppWindow.h"
 #include "nsIWindowMediator.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsIBaseWindow.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsMsgBaseCID.h"
 #include "nsIMsgAccountManager.h"
--- a/mailnews/compose/src/nsMsgComposeService.h
+++ b/mailnews/compose/src/nsMsgComposeService.h
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #define MSGCOMP_TRACE_PERFORMANCE 1
 
 #include "nsIMsgComposeService.h"
 #include "nsCOMPtr.h"
 #include "mozIDOMWindow.h"
-#include "nsIXULWindow.h"
+#include "nsIAppWindow.h"
 #include "nsIObserver.h"
 #include "nsWeakReference.h"
 #include "nsIWeakReference.h"
 #include "nsIMimeStreamConverter.h"
 #include "nsInterfaceHashtable.h"
 
 #include "nsICommandLineHandler.h"
 #define ICOMMANDLINEHANDLER nsICommandLineHandler