diff --git a/extensions/irc/js/lib/chatzilla-service.js b/extensions/irc/js/lib/chatzilla-service.js index 21b38077c7bf..5bf70192e467 100644 --- a/extensions/irc/js/lib/chatzilla-service.js +++ b/extensions/irc/js/lib/chatzilla-service.js @@ -131,7 +131,7 @@ function (aContentType, aCommand, aWindowTarget, aRequest) { var ass = Components.classes[ASS_CONTRACTID].getService(nsIAppShellService); - w = ass.getHiddenDOMWindow(); + w = ass.hiddenDOMWindow; var args = new Object (); args.url = channel.URI.spec; diff --git a/extensions/xmlterm/ui/xmlterm-service.js b/extensions/xmlterm/ui/xmlterm-service.js index 22861364b685..7fe74a6d2698 100644 --- a/extensions/xmlterm/ui/xmlterm-service.js +++ b/extensions/xmlterm/ui/xmlterm-service.js @@ -129,7 +129,7 @@ function (aContentType, aCommand, aWindowContext, aRequest) // Create new XMLterm window var appShellSvc = Components.classes[ASS_CONTRACTID].getService(nsIAppShellService); - var domWin = appShellSvc.getHiddenDOMWindow(); + var domWin = appShellSvc.hiddenDOMWindow; domWin.open(xmltermChromeURL,"_blank", "chrome,menubar,toolbar,resizable"); } diff --git a/xpfe/appshell/public/nsIAppShellService.idl b/xpfe/appshell/public/nsIAppShellService.idl index d221c9ffdf46..01d3d21668ed 100644 --- a/xpfe/appshell/public/nsIAppShellService.idl +++ b/xpfe/appshell/public/nsIAppShellService.idl @@ -22,12 +22,6 @@ #include "nsISupports.idl" -%{C++ -#include "nscore.h" -#include "nsCom.h" -#include "nsINativeAppSupport.h" -%} - interface nsIXULWindow; interface nsIURI; interface nsICmdLineService; @@ -37,17 +31,7 @@ interface nsIDOMWindowInternal; [ptr] native JSContext(JSContext); %{C++ -/* Forward declarations... */ -struct PRThread; -class nsIFactory; struct JSContext; - -#define NS_SIZETOCONTENT -1 - -// e5e5af70-8a38-11d2-9938-0080c7cb1080 -#define NS_IAPPSHELL_SERVICE_IID \ -{ 0xe5e5af70, 0x8a38, 0x11d2, \ - {0x99, 0x38, 0x00, 0x80, 0xc7, 0xcb, 0x10, 0x80} } %} [scriptable, uuid(E5E5AF70-8A38-11D2-9938-0080C7CB1080)] @@ -58,11 +42,13 @@ interface nsIAppShellService : nsISupports * Required initialization routine. * @param aCmdLineService is stored and passed to appshell components as * they are initialized. - * @param aNativeAppSupportOrSplashScreen is an object that can be QI'd to - * either an nsINativeAppSupport or nsISplashScreen; - * this object will be used to implement HideSplashScreen. + * @param aNativeAppSupportOrSplashScreen is an object that can be + * QI'd to either an nsINativeAppSupport or + * nsISplashScreen; this object will be used to + * implement HideSplashScreen. */ - void Initialize(in nsICmdLineService aCmdLineService, in nsISupports nativeAppSupportOrSplashScreen ); + void initialize(in nsICmdLineService aCmdLineService, + in nsISupports nativeAppSupportOrSplashScreen); /** * Starts up the profile manager with the given arguments @@ -80,16 +66,18 @@ interface nsIAppShellService : nsISupports * Runs an application event loop: normally the main event pump which * defines the lifetime of the application. */ - void Run(); + void run(); + /** + * Exit the event loop + */ + void quit(); -// Exit the event loop - void Quit(); /** * Required exit routine. Cleanly shuts down * the appshell components. */ - void Shutdown(); + void shutdown(); /** * Create a window. @@ -111,25 +99,28 @@ interface nsIAppShellService : nsISupports * @param aInitialHeight like aInitialWidth, but subtly different. * @param aResult the newly created window is returned here. */ - void CreateTopLevelWindow(in nsIXULWindow aParent, - in nsIURI aUrl, - in boolean aShowWindow, - in boolean aLoadDefaultPage, - in PRUint32 aChromeMask, - in long aInitialWidth, in long aInitialHeight, - out nsIXULWindow aResult); + const long SIZE_TO_CONTENT = -1; + nsIXULWindow createTopLevelWindow(in nsIXULWindow aParent, + in nsIURI aUrl, + in boolean aShowWindow, + in boolean aLoadDefaultPage, + in PRUint32 aChromeMask, + in long aInitialWidth, + in long aInitialHeight); - // Apply Initialize function to each app shell component. - void EnumerateAndInitializeComponents(); + /** + * Apply Initialize function to each app shell component. + */ + void enumerateAndInitializeComponents(); /** * Close a window. * @param aWindow a window. */ - void CloseTopLevelWindow(in nsIXULWindow aWindow); + void closeTopLevelWindow(in nsIXULWindow aWindow); [noscript] - void CreateHiddenWindow(); + void createHiddenWindow(); /** * Return the (singleton) application hidden window, automatically created @@ -137,7 +128,7 @@ interface nsIAppShellService : nsISupports * @param aResult the hidden window. Do not unhide hidden window. * Do not taunt hidden window. */ - void GetHiddenWindow(out nsIXULWindow aResult); + readonly attribute nsIXULWindow hiddenWindow; /** * Return the (singleton) application hidden window, automatically created @@ -145,7 +136,7 @@ interface nsIAppShellService : nsISupports * @param aResult the hidden window. Do not unhide hidden window. * Do not taunt hidden window. */ - nsIDOMWindowInternal getHiddenDOMWindow(); + readonly attribute nsIDOMWindowInternal hiddenDOMWindow; /** @@ -156,7 +147,7 @@ interface nsIAppShellService : nsISupports * @aJSContext the corresponding JavaScript context */ [noscript] - void GetHiddenWindowAndJSContext(out nsIDOMWindowInternal aHiddenDOMWindow, + void getHiddenWindowAndJSContext(out nsIDOMWindowInternal aHiddenDOMWindow, out JSContext aJSContext); /** @@ -165,25 +156,25 @@ interface nsIAppShellService : nsISupports * knows it can't quit until it's out of registered windows. * @param aWindow yes */ - void RegisterTopLevelWindow(in nsIXULWindow aWindow); + void registerTopLevelWindow(in nsIXULWindow aWindow); /** * Remove a window from the application's window registry. * @param aWindow you see the pattern */ - void UnregisterTopLevelWindow(in nsIXULWindow aWindow); + void unregisterTopLevelWindow(in nsIXULWindow aWindow); /** * Remove the splash screen (if visible). This need be called * only once per application session. */ - void HideSplashScreen(); + void hideSplashScreen(); /** * We may need to show a XUL dialog before there are any other windows. * In this case we don't nescesarily want to quit when it is closed. * Use with extreme caution. */ - attribute boolean quitOnLastWindowClosing; + }; diff --git a/xpfe/appshell/src/nsAppShellService.cpp b/xpfe/appshell/src/nsAppShellService.cpp index 0553dcc07d6d..4037e222899b 100644 --- a/xpfe/appshell/src/nsAppShellService.cpp +++ b/xpfe/appshell/src/nsAppShellService.cpp @@ -680,8 +680,8 @@ nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent, aParent->GetZlevel(&zlevel); #endif - if (aInitialWidth == NS_SIZETOCONTENT || - aInitialHeight == NS_SIZETOCONTENT) { + if (aInitialWidth == nsIAppShellService::SIZE_TO_CONTENT || + aInitialHeight == nsIAppShellService::SIZE_TO_CONTENT) { aInitialWidth = 1; aInitialHeight = 1; intrinsicallySized = PR_TRUE; diff --git a/xpfe/appshell/src/nsAppShellService.h b/xpfe/appshell/src/nsAppShellService.h index 488cb262c84a..f07f86592c6f 100644 --- a/xpfe/appshell/src/nsAppShellService.h +++ b/xpfe/appshell/src/nsAppShellService.h @@ -23,6 +23,7 @@ #define __nsAppShellService_h #include "nsIAppShellService.h" +#include "nsINativeAppSupport.h" #include "nsIObserver.h" #include "nsWeakReference.h" #include "nsIAppShell.h" diff --git a/xpfe/appshell/src/nsXULWindow.cpp b/xpfe/appshell/src/nsXULWindow.cpp index 9b39f9a65187..528c96e90daf 100644 --- a/xpfe/appshell/src/nsXULWindow.cpp +++ b/xpfe/appshell/src/nsXULWindow.cpp @@ -1267,8 +1267,8 @@ NS_IMETHODIMP nsXULWindow::CreateNewChromeWindow(PRInt32 aChromeFlags, nsCOMPtr newWindow; appShell->CreateTopLevelWindow(parent, nsnull, PR_FALSE, PR_FALSE, - aChromeFlags, NS_SIZETOCONTENT, NS_SIZETOCONTENT, - getter_AddRefs(newWindow)); + aChromeFlags, nsIAppShellService::SIZE_TO_CONTENT, + nsIAppShellService::SIZE_TO_CONTENT, getter_AddRefs(newWindow)); NS_ENSURE_TRUE(newWindow, NS_ERROR_FAILURE); diff --git a/xpfe/bootstrap/nsAppRunner.cpp b/xpfe/bootstrap/nsAppRunner.cpp index 35debf7db8e8..bd9f4ce45f95 100644 --- a/xpfe/bootstrap/nsAppRunner.cpp +++ b/xpfe/bootstrap/nsAppRunner.cpp @@ -346,7 +346,9 @@ static nsresult OpenWindow(const nsAFlatCString& aChromeURL, static nsresult OpenWindow(const nsAFlatCString& aChromeURL, const nsAFlatString& aAppArgs) { - return OpenWindow(aChromeURL, aAppArgs, NS_SIZETOCONTENT, NS_SIZETOCONTENT); + return OpenWindow(aChromeURL, aAppArgs, + nsIAppShellService::SIZE_TO_CONTENT, + nsIAppShellService::SIZE_TO_CONTENT); } static nsresult OpenWindow(const nsAFlatCString& aChromeURL, @@ -374,11 +376,11 @@ static nsresult OpenWindow(const nsAFlatCString& aChromeURL, sarg->SetData(aAppArgs.get()); nsCAutoString features("chrome,dialog=no,all"); - if (aHeight != NS_SIZETOCONTENT) { + if (aHeight != nsIAppShellService::SIZE_TO_CONTENT) { features.Append(",height="); features.AppendInt(aHeight); } - if (aWidth != NS_SIZETOCONTENT) { + if (aWidth != nsIAppShellService::SIZE_TO_CONTENT) { features.Append(",width="); features.AppendInt(aWidth); } @@ -634,8 +636,8 @@ static PRBool IsStartupCommand(const char *arg) static nsresult HandleArbitraryStartup( nsICmdLineService* cmdLineArgs, nsIPref *prefs, PRBool heedGeneralStartupPrefs) { nsresult rv; - PRInt32 height = NS_SIZETOCONTENT; - PRInt32 width = NS_SIZETOCONTENT; + PRInt32 height = nsIAppShellService::SIZE_TO_CONTENT; + PRInt32 width = nsIAppShellService::SIZE_TO_CONTENT; nsXPIDLCString tempString; // Get the value of -width option @@ -814,8 +816,8 @@ static nsresult Ensure1Window( nsICmdLineService* cmdLineArgs) } // No window exists so lets create a browser one - PRInt32 height = NS_SIZETOCONTENT; - PRInt32 width = NS_SIZETOCONTENT; + PRInt32 height = nsIAppShellService::SIZE_TO_CONTENT; + PRInt32 width = nsIAppShellService::SIZE_TO_CONTENT; // Get the value of -width option nsXPIDLCString tempString; diff --git a/xpfe/bootstrap/nsWindowCreator.cpp b/xpfe/bootstrap/nsWindowCreator.cpp index 927a741986dc..d9bda6c1fa73 100644 --- a/xpfe/bootstrap/nsWindowCreator.cpp +++ b/xpfe/bootstrap/nsWindowCreator.cpp @@ -100,8 +100,8 @@ nsWindowCreator::CreateChromeWindow(nsIWebBrowserChrome *aParent, nsCOMPtr newWindow; appShell->CreateTopLevelWindow(0, 0, PR_FALSE, PR_FALSE, - aChromeFlags, NS_SIZETOCONTENT, NS_SIZETOCONTENT, - getter_AddRefs(newWindow)); + aChromeFlags, nsIAppShellService::SIZE_TO_CONTENT, + nsIAppShellService::SIZE_TO_CONTENT, getter_AddRefs(newWindow)); nsCOMPtr thing(do_QueryInterface(newWindow)); if (thing) diff --git a/xpfe/components/filepicker/src/nsFilePicker.js b/xpfe/components/filepicker/src/nsFilePicker.js index b3513d8e7a24..bdb443e4d7cd 100644 --- a/xpfe/components/filepicker/src/nsFilePicker.js +++ b/xpfe/components/filepicker/src/nsFilePicker.js @@ -165,7 +165,7 @@ nsFilePicker.prototype = { } else { try { var appShellService = Components.classes[APPSHELL_SERV_CONTRACTID].getService(nsIAppShellService); - parent = appShellService.getHiddenDOMWindow(); + parent = appShellService.hiddenDOMWindow; } catch(ex) { debug("Can't get parent. xpconnect hates me so we can't get one from the appShellService.\n"); debug(ex + "\n"); diff --git a/xpfe/components/filepicker/src/nsFilePicker.js.in b/xpfe/components/filepicker/src/nsFilePicker.js.in index b3513d8e7a24..bdb443e4d7cd 100644 --- a/xpfe/components/filepicker/src/nsFilePicker.js.in +++ b/xpfe/components/filepicker/src/nsFilePicker.js.in @@ -165,7 +165,7 @@ nsFilePicker.prototype = { } else { try { var appShellService = Components.classes[APPSHELL_SERV_CONTRACTID].getService(nsIAppShellService); - parent = appShellService.getHiddenDOMWindow(); + parent = appShellService.hiddenDOMWindow; } catch(ex) { debug("Can't get parent. xpconnect hates me so we can't get one from the appShellService.\n"); debug(ex + "\n"); diff --git a/xpfe/components/timebomb/nsTimeBomb.cpp b/xpfe/components/timebomb/nsTimeBomb.cpp index 78e63f9e2b37..ca6dfb6a5ba5 100644 --- a/xpfe/components/timebomb/nsTimeBomb.cpp +++ b/xpfe/components/timebomb/nsTimeBomb.cpp @@ -55,19 +55,19 @@ static nsresult DisplayURI(const char *urlStr, PRBool block) nsCOMPtr window; rv = appShell->CreateTopLevelWindow(nsnull, - URL, - PR_TRUE, - PR_TRUE, - nsIWebBrowserChrome::CHROME_ALL, - NS_SIZETOCONTENT, // width - NS_SIZETOCONTENT, // height - getter_AddRefs(window)); + URL, + PR_TRUE, + PR_TRUE, + nsIWebBrowserChrome::CHROME_ALL, + nsIAppShellService::SIZE_TO_CONTENT, // width + nsIAppShellService::SIZE_TO_CONTENT, // height + getter_AddRefs(window)); if (NS_FAILED(rv)) return rv; /* * Start up the main event loop... - */ + */ if (block) rv = appShell->Run(); @@ -92,7 +92,7 @@ nsTimeBomb::Init() rv = nsServiceManager::GetService(kPrefCID, NS_GET_IID(nsIPref), getter_AddRefs(mPrefs)); NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get prefs"); - if (NS_FAILED(rv)) + if (NS_FAILED(rv)) return rv; PRTime time = LL_Zero(); diff --git a/xpfe/global/resources/content/globalOverlay.js b/xpfe/global/resources/content/globalOverlay.js index de77a9310f08..471b53df8820 100644 --- a/xpfe/global/resources/content/globalOverlay.js +++ b/xpfe/global/resources/content/globalOverlay.js @@ -40,7 +40,7 @@ function goQuitApplication() } }; if (!nativeAppSupport || !nativeAppSupport.isServerMode) - appShell.Quit(); + appShell.quit(); return true; }