michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsAppStartup_h__ michael@0: #define nsAppStartup_h__ michael@0: michael@0: #include "nsIAppStartup.h" michael@0: #include "nsIWindowCreator2.h" michael@0: #include "nsIObserver.h" michael@0: #include "nsWeakReference.h" michael@0: michael@0: #include "nsINativeAppSupport.h" michael@0: #include "nsIAppShell.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: #if defined(XP_WIN) michael@0: //XPerf-backed probes michael@0: #include "mozilla/perfprobe.h" michael@0: #include "nsAutoPtr.h" michael@0: #endif //defined(XP_WIN) michael@0: michael@0: michael@0: struct PLEvent; michael@0: michael@0: // {7DD4D320-C84B-4624-8D45-7BB9B2356977} michael@0: #define NS_TOOLKIT_APPSTARTUP_CID \ michael@0: { 0x7dd4d320, 0xc84b, 0x4624, { 0x8d, 0x45, 0x7b, 0xb9, 0xb2, 0x35, 0x69, 0x77 } } michael@0: michael@0: michael@0: class nsAppStartup MOZ_FINAL : public nsIAppStartup, michael@0: public nsIWindowCreator2, michael@0: public nsIObserver, michael@0: public nsSupportsWeakReference michael@0: { michael@0: public: michael@0: NS_DECL_THREADSAFE_ISUPPORTS michael@0: NS_DECL_NSIAPPSTARTUP michael@0: NS_DECL_NSIWINDOWCREATOR michael@0: NS_DECL_NSIWINDOWCREATOR2 michael@0: NS_DECL_NSIOBSERVER michael@0: michael@0: nsAppStartup(); michael@0: nsresult Init(); michael@0: michael@0: private: michael@0: ~nsAppStartup() { } michael@0: michael@0: void CloseAllWindows(); michael@0: michael@0: friend class nsAppExitEvent; michael@0: michael@0: nsCOMPtr mAppShell; michael@0: michael@0: int32_t mConsiderQuitStopper; // if > 0, Quit(eConsiderQuit) fails michael@0: bool mRunning; // Have we started the main event loop? michael@0: bool mShuttingDown; // Quit method reentrancy check michael@0: bool mStartingUp; // Have we passed final-ui-startup? michael@0: bool mAttemptingQuit; // Quit(eAttemptQuit) still trying michael@0: bool mRestart; // Quit(eRestart) michael@0: bool mInterrupted; // Was startup interrupted by an interactive prompt? michael@0: bool mIsSafeModeNecessary; // Whether safe mode is necessary michael@0: bool mStartupCrashTrackingEnded; // Whether startup crash tracking has already ended michael@0: bool mRestartTouchEnvironment; // Quit (eRestartTouchEnvironment) michael@0: michael@0: #if defined(XP_WIN) michael@0: //Interaction with OS-provided profiling probes michael@0: typedef mozilla::probes::ProbeManager ProbeManager; michael@0: typedef mozilla::probes::Probe Probe; michael@0: nsRefPtr mProbesManager; michael@0: nsRefPtr mPlacesInitCompleteProbe; michael@0: nsRefPtr mSessionWindowRestoredProbe; michael@0: nsRefPtr mXPCOMShutdownProbe; michael@0: #endif michael@0: }; michael@0: michael@0: #endif // nsAppStartup_h__