1999-08-31 18:05:08 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1999-08-31 18:05:08 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
1999-08-31 18:05:08 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-08-31 18:05:08 +04:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:43:54 +03:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-08-31 18:05:08 +04:00
|
|
|
*/
|
|
|
|
#ifndef nsBrowserInstance_h___
|
|
|
|
#define nsBrowserInstance_h___
|
|
|
|
|
2000-04-16 15:19:18 +04:00
|
|
|
// Helper Classes
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsWeakReference.h"
|
|
|
|
|
|
|
|
// Interfaces Needed
|
1999-08-31 18:05:08 +04:00
|
|
|
#include "nsIBrowserInstance.h"
|
2000-04-16 15:19:18 +04:00
|
|
|
#include "nsIURIContentListener.h"
|
|
|
|
|
|
|
|
|
1999-08-31 18:05:08 +04:00
|
|
|
|
1999-09-02 00:41:30 +04:00
|
|
|
#include "nsIAppShellComponentImpl.h"
|
|
|
|
|
1999-08-31 18:05:08 +04:00
|
|
|
#include "nscore.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsISupports.h"
|
|
|
|
|
|
|
|
#include "nsIStreamObserver.h"
|
|
|
|
#include "nsIObserver.h"
|
2000-02-08 04:11:13 +03:00
|
|
|
#include "nsICmdLineHandler.h"
|
2000-04-13 12:08:52 +04:00
|
|
|
#include "nsIXULBrowserWindow.h"
|
2000-04-16 15:19:18 +04:00
|
|
|
#include "nsIWebProgressListener.h"
|
|
|
|
#include "nsIWebShell.h"
|
2000-05-03 09:33:07 +04:00
|
|
|
#include "nsIUrlbarHistory.h"
|
2000-06-24 03:54:30 +04:00
|
|
|
#include "nsISHistory.h"
|
2000-01-06 03:18:15 +03:00
|
|
|
|
2000-03-11 03:46:37 +03:00
|
|
|
class nsIDocShell;
|
1999-08-31 18:05:08 +04:00
|
|
|
class nsIScriptContext;
|
2000-09-01 05:54:35 +04:00
|
|
|
class nsIDOMWindowInternal;
|
1999-08-31 18:05:08 +04:00
|
|
|
class nsIDOMNode;
|
|
|
|
class nsIURI;
|
|
|
|
class nsIWebShellWindow;
|
|
|
|
class nsIFindComponent;
|
|
|
|
|
2000-07-04 22:51:14 +04:00
|
|
|
#define SH_IN_FRAMES
|
1999-08-31 18:05:08 +04:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsBrowserInstance:
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class nsBrowserInstance : public nsIBrowserInstance,
|
1999-12-07 17:06:36 +03:00
|
|
|
public nsIURIContentListener,
|
2000-04-16 15:19:18 +04:00
|
|
|
public nsIWebProgressListener,
|
|
|
|
public nsSupportsWeakReference
|
|
|
|
{
|
1999-08-31 18:05:08 +04:00
|
|
|
public:
|
|
|
|
|
|
|
|
nsBrowserInstance();
|
|
|
|
virtual ~nsBrowserInstance();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
NS_DECL_NSIBROWSERINSTANCE
|
|
|
|
|
|
|
|
NS_DEFINE_STATIC_CID_ACCESSOR( NS_BROWSERINSTANCE_CID )
|
|
|
|
|
1999-11-18 10:19:39 +03:00
|
|
|
// URI Content listener
|
|
|
|
NS_DECL_NSIURICONTENTLISTENER
|
1999-10-05 08:49:58 +04:00
|
|
|
|
2000-12-15 02:38:00 +03:00
|
|
|
// WebProgress listener
|
2000-04-16 15:19:18 +04:00
|
|
|
NS_DECL_NSIWEBPROGRESSLISTENER
|
|
|
|
|
2000-08-23 04:53:04 +04:00
|
|
|
static PRUint32 gRefCnt;
|
|
|
|
|
2000-09-11 06:12:18 +04:00
|
|
|
protected:
|
|
|
|
|
|
|
|
nsresult GetContentAreaDocShell(nsIDocShell** outDocShell);
|
|
|
|
nsresult GetContentWindow(nsIDOMWindowInternal** outContentWindow);
|
|
|
|
nsresult GetContentAreaDocLoader(nsIDocumentLoader** outDocLoader);
|
|
|
|
|
|
|
|
nsresult GetFocussedContentWindow(nsIDOMWindowInternal** outFocussedWindow);
|
|
|
|
|
2000-05-28 13:27:10 +04:00
|
|
|
void ReinitializeContentVariables();
|
|
|
|
|
2000-09-11 06:12:18 +04:00
|
|
|
nsresult InitializeSearch(nsIDOMWindowInternal* windowToSearch, nsIFindComponent *finder );
|
|
|
|
|
2000-04-21 03:15:39 +04:00
|
|
|
NS_IMETHOD EnsureXULBrowserWindow();
|
1999-08-31 18:05:08 +04:00
|
|
|
|
2000-12-15 02:38:00 +03:00
|
|
|
// helper methods for dealing with document loading...
|
|
|
|
nsresult StartDocumentLoad(nsIDOMWindow *aDOMWindow,
|
|
|
|
nsIChannel *aChannel);
|
|
|
|
|
|
|
|
nsresult EndDocumentLoad(nsIDOMWindow *aDOMWindow,
|
|
|
|
nsIChannel *aChannel,
|
|
|
|
nsresult aResult);
|
|
|
|
|
2000-02-15 07:45:34 +03:00
|
|
|
PRBool mIsClosed;
|
1999-08-31 18:05:08 +04:00
|
|
|
|
2000-04-13 12:08:52 +04:00
|
|
|
nsCOMPtr<nsIXULBrowserWindow> mXULBrowserWindow;
|
2000-06-24 03:54:30 +04:00
|
|
|
#ifdef SH_IN_FRAMES
|
|
|
|
nsCOMPtr<nsISHistory> mSessionHistory;
|
|
|
|
#endif
|
1999-08-31 18:05:08 +04:00
|
|
|
nsIScriptContext *mContentScriptContext; // weak reference
|
|
|
|
|
2000-05-28 13:27:10 +04:00
|
|
|
nsWeakPtr mContentWindowWeak;
|
|
|
|
nsWeakPtr mContentAreaDocShellWeak;
|
|
|
|
nsWeakPtr mContentAreaDocLoaderWeak;
|
1999-08-31 18:05:08 +04:00
|
|
|
|
|
|
|
nsIWebShellWindow *mWebShellWin; // weak reference
|
2000-03-11 03:46:37 +03:00
|
|
|
nsIDocShell * mDocShell; // weak reference
|
2000-09-01 05:54:35 +04:00
|
|
|
nsIDOMWindowInternal* mDOMWindow; // weak reference
|
2000-05-28 13:27:10 +04:00
|
|
|
|
2000-05-03 09:33:07 +04:00
|
|
|
nsCOMPtr<nsIUrlbarHistory> mUrlbarHistory; //We own this
|
1999-08-31 18:05:08 +04:00
|
|
|
nsCOMPtr<nsISupports> mSearchContext; // at last, something we really own
|
1999-09-02 00:41:30 +04:00
|
|
|
nsInstanceCounter mInstanceCounter;
|
2000-09-13 02:02:39 +04:00
|
|
|
nsCOMPtr<nsIInputStream> mPostData; // Post data for current page.
|
2000-10-29 02:17:53 +04:00
|
|
|
#ifdef DEBUG_warren
|
1999-08-31 18:05:08 +04:00
|
|
|
PRIntervalTime mLoadStartTime;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsBrowserInstance_h___
|