From 549fd3c05e6bc125fd59fef5a7e2aae129a9cfcc Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Mon, 22 Apr 2002 14:02:48 +0000 Subject: [PATCH] remove convertISupportsToDOMWindow in order to clean up nsIWindowMediator bug 138299 (preparation for bug 132175) git-svn-id: svn://10.0.0.236/trunk@119543 18797224-902f-48f8-a5cc-f745e15eee43 --- .../ui/composer/content/ComposerCommands.js | 2 +- .../content/editorApplicationOverlay.js | 2 +- .../xpfe/appshell/public/nsIWindowMediator.idl | 7 ------- mozilla/xpfe/appshell/src/nsWindowMediator.cpp | 9 --------- .../resources/content/tasksOverlay.js | 17 ++++++++++------- 5 files changed, 12 insertions(+), 25 deletions(-) diff --git a/mozilla/editor/ui/composer/content/ComposerCommands.js b/mozilla/editor/ui/composer/content/ComposerCommands.js index aadc7e40544..1db352e87ae 100644 --- a/mozilla/editor/ui/composer/content/ComposerCommands.js +++ b/mozilla/editor/ui/composer/content/ComposerCommands.js @@ -1886,7 +1886,7 @@ var nsPreviewCommand = while ( enumerator.hasMoreElements() ) { - browser = windowManagerInterface.convertISupportsToDOMWindow( enumerator.getNext() ); + browser = enumerator.getNext().QueryInterface(Components.interfaces.nsIDOMWindowInternal); if ( browser && (window._content.location.href == browser._content.location.href)) break; diff --git a/mozilla/editor/ui/composer/content/editorApplicationOverlay.js b/mozilla/editor/ui/composer/content/editorApplicationOverlay.js index 7a9e8498c03..9f3f5750388 100644 --- a/mozilla/editor/ui/composer/content/editorApplicationOverlay.js +++ b/mozilla/editor/ui/composer/content/editorApplicationOverlay.js @@ -127,7 +127,7 @@ function editPage(url, launchWindow, delay) var emptyWindow; while ( enumerator.hasMoreElements() ) { - var win = windowManagerInterface.convertISupportsToDOMWindow( enumerator.getNext() ); + var win = enumerator.getNext().QueryInterface(Components.interfaces.nsIDOMWindowInternal); if ( win && win.editorShell) { if (CheckOpenWindowForURIMatch(uri, win)) diff --git a/mozilla/xpfe/appshell/public/nsIWindowMediator.idl b/mozilla/xpfe/appshell/public/nsIWindowMediator.idl index ec920e06d03..7f78a398400 100644 --- a/mozilla/xpfe/appshell/public/nsIWindowMediator.idl +++ b/mozilla/xpfe/appshell/public/nsIWindowMediator.idl @@ -92,9 +92,6 @@ interface nsIWindowMediator: nsISupports */ nsIDOMWindowInternal getWindowForResource( in wstring inResource ); - /* */ - nsIDOMWindowInternal convertISupportsToDOMWindow( in nsISupports inWindow ); - /* Add the webshellwindow to the list */ [noscript] void registerWindow( in nsIXULWindow inWindow); @@ -161,7 +158,3 @@ interface nsIWindowMediator: nsISupports in unsigned long inPosition, in nsIXULWindow inBelow); }; - -%{C++ -extern nsresult NS_NewWindowMediatorFactory(nsIFactory** aResult); -%} diff --git a/mozilla/xpfe/appshell/src/nsWindowMediator.cpp b/mozilla/xpfe/appshell/src/nsWindowMediator.cpp index f9be5a862cf..fa903d35cda 100644 --- a/mozilla/xpfe/appshell/src/nsWindowMediator.cpp +++ b/mozilla/xpfe/appshell/src/nsWindowMediator.cpp @@ -831,15 +831,6 @@ nsWindowMediator::GetWindowForResource( const PRUnichar* inResource, -NS_IMETHODIMP -nsWindowMediator::ConvertISupportsToDOMWindow( nsISupports* inInterface, - nsIDOMWindowInternal** outWindow ) -{ - return inInterface->QueryInterface(NS_GET_IID(nsIDOMWindowInternal) , (void**) outWindow ); -} - - - // COM NS_IMPL_ADDREF( nsWindowMediator ); NS_IMPL_QUERY_INTERFACE3(nsWindowMediator, nsIWindowMediator, nsIRDFDataSource, nsIRDFObserver); diff --git a/mozilla/xpfe/communicator/resources/content/tasksOverlay.js b/mozilla/xpfe/communicator/resources/content/tasksOverlay.js index 52710de80dd..bb6ba9d13e9 100644 --- a/mozilla/xpfe/communicator/resources/content/tasksOverlay.js +++ b/mozilla/xpfe/communicator/resources/content/tasksOverlay.js @@ -36,6 +36,9 @@ * * ***** END LICENSE BLOCK ***** */ +const nsIDOMWindowInternal = Components.interfaces.nsIDOMWindowInternal; +const nsIWindowMediator = Components.interfaces.nsIWindowMediator; + function toNavigator() { if (!CycleWindow("navigator:browser")) @@ -74,7 +77,7 @@ function toOpenWindowByType( inType, uri ) { var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); - var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); + var windowManagerInterface = windowManager.QueryInterface(nsIWindowMediator); var topWindow = windowManagerInterface.getMostRecentWindow( inType ); @@ -115,7 +118,7 @@ function OpenBrowserWindow() function CycleWindow( aType ) { var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); - var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); + var windowManagerInterface = windowManager.QueryInterface(nsIWindowMediator); var topWindowOfType = windowManagerInterface.getMostRecentWindow( aType ); var topWindow = windowManagerInterface.getMostRecentWindow( null ); @@ -129,13 +132,13 @@ function CycleWindow( aType ) } var enumerator = windowManagerInterface.getEnumerator( aType ); - var firstWindow = windowManagerInterface.convertISupportsToDOMWindow(enumerator.getNext()); + var firstWindow = enumerator.getNext().QueryInterface(nsIDOMWindowInternal); var iWindow = firstWindow; while (iWindow != topWindow && enumerator.hasMoreElements()) - iWindow = windowManagerInterface.convertISupportsToDOMWindow(enumerator.getNext()); + iWindow = enumerator.getNext().QueryInterface(nsIDOMWindowInternal); if (enumerator.hasMoreElements()) { - iWindow = windowManagerInterface.convertISupportsToDOMWindow(enumerator.getNext()); + iWindow = enumerator.getNext().QueryInterface(nsIDOMWindowInternal); iWindow.focus(); return iWindow; } @@ -150,7 +153,7 @@ function CycleWindow( aType ) function ShowWindowFromResource( node ) { var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); - var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); + var windowManagerInterface = windowManager.QueryInterface(nsIWindowMediator); var desiredWindow = null; var url = node.getAttribute('id'); @@ -178,7 +181,7 @@ function ShowUpdateFromResource( node ) function checkFocusedWindow() { var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); - var windowManagerInterface = windowManager.QueryInterface(Components.interfaces.nsIWindowMediator); + var windowManagerInterface = windowManager.QueryInterface(nsIWindowMediator); var sep = document.getElementById("sep-window-list"); // Using double parens to avoid warning