diff --git a/webshell/tests/viewer/nsBrowserWindow.h b/webshell/tests/viewer/nsBrowserWindow.h index a97d47258136..d28a11a58491 100644 --- a/webshell/tests/viewer/nsBrowserWindow.h +++ b/webshell/tests/viewer/nsBrowserWindow.h @@ -26,7 +26,6 @@ #include "nsIStreamListener.h" #include "nsIProgressEventSink.h" #include "nsIWebShell.h" -#include "nsIScriptContextOwner.h" #include "nsIDocumentLoaderObserver.h" #include "nsString.h" #include "nsVoidArray.h" diff --git a/webshell/tests/viewer/nsViewerApp.cpp b/webshell/tests/viewer/nsViewerApp.cpp index ac2eec38ed3b..d03478a2a0fc 100644 --- a/webshell/tests/viewer/nsViewerApp.cpp +++ b/webshell/tests/viewer/nsViewerApp.cpp @@ -39,11 +39,13 @@ #include "nsIComponentManager.h" #include "nsIServiceManager.h" #include "nsIEventQueueService.h" +#include "nsIInterfaceRequestor.h" #include "nsWebCrawler.h" #include "nsSpecialSystemDirectory.h" // For exe dir #include "prprf.h" #include "plstr.h" #include "prenv.h" +#include "nsIScriptGlobalObject.h" // Needed for Dialog GUI #include "nsICheckButton.h" @@ -1450,8 +1452,6 @@ nsViewerApp::CreateSiteWalker(nsBrowserWindow* aWindow) #ifdef XP_PC #include "jsconsres.h" -static NS_DEFINE_IID(kIScriptContextOwnerIID, NS_ISCRIPTCONTEXTOWNER_IID); - static void DestroyConsole() { if (gConsole) { @@ -1472,11 +1472,10 @@ static void ShowConsole(nsBrowserWindow* aWindow) MAKEINTRESOURCE(ACCELERATOR_TABLE)); } - nsIScriptContextOwner *owner = nsnull; - nsIScriptContext *context = nsnull; - // XXX needs to change to aWindow->mWebShell - if (NS_OK == aWindow->mWebShell->QueryInterface(kIScriptContextOwnerIID, (void **)&owner)) { - if (NS_OK == owner->GetScriptContext(&context)) { + nsIScriptContext *context = nsnull; + nsCOMPtr scriptGlobal(do_GetInterface(aWindow->mWebShell)); + if (scriptGlobal) { + if (NS_OK == scriptGlobal->GetContext(&context)) { // create the console gConsole = JSConsole::CreateConsole(); @@ -1487,8 +1486,6 @@ static void ShowConsole(nsBrowserWindow* aWindow) context->Release(); gConsole->SetNotification(DestroyConsole); } - - NS_RELEASE(owner); } else { MessageBox(hWnd, "Unable to load JavaScript", "Viewer Error", MB_ICONSTOP); diff --git a/webshell/tests/viewer/nsXPBaseWindow.h b/webshell/tests/viewer/nsXPBaseWindow.h index 532c0a47f402..4c8200b8ebcc 100644 --- a/webshell/tests/viewer/nsXPBaseWindow.h +++ b/webshell/tests/viewer/nsXPBaseWindow.h @@ -25,7 +25,6 @@ #include "nsIXPBaseWindow.h" #include "nsIStreamListener.h" #include "nsIWebShell.h" -#include "nsIScriptContextOwner.h" #include "nsString.h" #include "nsVoidArray.h" #include "nsCRT.h"