2001-09-25 22:43:09 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
1998-07-24 05:05:42 +00:00
|
|
|
*
|
2001-09-25 22:43:09 +00: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/
|
1998-07-24 05:05:42 +00:00
|
|
|
*
|
2001-09-25 22:43:09 +00: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.
|
1998-07-24 05:05:42 +00:00
|
|
|
*
|
1999-11-06 03:40:37 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2001-09-25 22:43:09 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 03:40:37 +00:00
|
|
|
*
|
2000-02-08 13:40:10 +00:00
|
|
|
* Contributor(s):
|
2001-04-18 06:06:31 +00:00
|
|
|
* Travis Bogard <travis@netscape.com>
|
|
|
|
* Dan Rosen <dr@netscape.com>
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
* Vidur Apparao <vidur@netscape.com>
|
|
|
|
* Johnny Stenback <jst@netscape.com>
|
2001-09-25 22:43:09 +00:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the NPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the NPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2001-04-18 06:06:31 +00:00
|
|
|
|
1998-07-24 05:05:42 +00:00
|
|
|
#ifndef nsGlobalWindow_h___
|
|
|
|
#define nsGlobalWindow_h___
|
|
|
|
|
2000-02-08 13:40:10 +00:00
|
|
|
// Local Includes
|
|
|
|
// Helper Classes
|
1999-10-14 10:58:25 +00:00
|
|
|
#include "nsCOMPtr.h"
|
2000-05-14 05:26:06 +00:00
|
|
|
#include "nsWeakReference.h"
|
2000-03-24 00:11:48 +00:00
|
|
|
#include "nsHashtable.h"
|
2000-02-08 13:40:10 +00:00
|
|
|
|
|
|
|
// Interfaces Needed
|
|
|
|
#include "nsDOMWindowList.h"
|
|
|
|
#include "nsIBaseWindow.h"
|
|
|
|
#include "nsIChromeEventHandler.h"
|
|
|
|
#include "nsIControllers.h"
|
|
|
|
#include "nsIDocShellTreeOwner.h"
|
|
|
|
#include "nsIDocShellTreeItem.h"
|
2000-05-03 13:03:17 +00:00
|
|
|
#include "nsIDOMViewCSS.h"
|
1999-09-21 14:18:52 +00:00
|
|
|
#include "nsIDOMEventReceiver.h"
|
2000-02-08 13:40:10 +00:00
|
|
|
#include "nsIDOMNavigator.h"
|
1999-08-03 23:16:48 +00:00
|
|
|
#include "nsIDOMNSLocation.h"
|
2000-09-01 01:54:35 +00:00
|
|
|
#include "nsIDOMWindowInternal.h"
|
2001-05-17 02:15:27 +00:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2001-09-05 21:28:38 +00:00
|
|
|
#include "nsIInterfaceRequestorUtils.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
#include "nsIDOMJSWindow.h"
|
2002-02-09 03:36:55 +00:00
|
|
|
#include "nsIDOMChromeWindow.h"
|
2000-02-08 13:40:10 +00:00
|
|
|
#include "nsIScriptGlobalObject.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
#include "nsIScriptObjectPrincipal.h"
|
2000-02-08 13:40:10 +00:00
|
|
|
#include "nsITimer.h"
|
|
|
|
#include "nsIWebBrowserChrome.h"
|
1999-10-14 10:58:25 +00:00
|
|
|
#include "nsPIDOMWindow.h"
|
2000-02-09 05:26:02 +00:00
|
|
|
#include "nsIEventListenerManager.h"
|
|
|
|
#include "nsIDOMDocument.h"
|
2000-05-11 19:17:07 +00:00
|
|
|
#include "nsIDOMCrypto.h"
|
|
|
|
#include "nsIDOMPkcs11.h"
|
2000-02-16 09:37:33 +00:00
|
|
|
#include "nsISidebar.h"
|
2000-07-13 21:48:25 +00:00
|
|
|
#include "nsIPrincipal.h"
|
2001-01-23 22:29:41 +00:00
|
|
|
#include "nsPluginArray.h"
|
2001-07-23 05:36:52 +00:00
|
|
|
#include "nsMimeTypeArray.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
#include "nsIXPCScriptable.h"
|
2002-02-20 03:33:52 +00:00
|
|
|
#include "nsPoint.h"
|
|
|
|
#include "nsSize.h"
|
1998-07-24 05:05:42 +00:00
|
|
|
|
1999-04-28 20:33:43 +00:00
|
|
|
#define DEFAULT_HOME_PAGE "www.mozilla.org"
|
|
|
|
#define PREF_BROWSER_STARTUP_HOMEPAGE "browser.startup.homepage"
|
|
|
|
|
1999-06-09 19:04:18 +00:00
|
|
|
class nsIDOMBarProp;
|
1999-05-27 21:06:51 +00:00
|
|
|
class nsIDocument;
|
1999-09-21 01:05:01 +00:00
|
|
|
class nsIContent;
|
1998-07-24 05:05:42 +00:00
|
|
|
class nsIPresContext;
|
|
|
|
class nsIDOMEvent;
|
1999-10-06 22:07:42 +00:00
|
|
|
class nsIScrollableView;
|
1998-07-24 05:05:42 +00:00
|
|
|
|
|
|
|
typedef struct nsTimeoutImpl nsTimeoutImpl;
|
|
|
|
|
1999-06-09 19:04:18 +00:00
|
|
|
class BarPropImpl;
|
1998-08-13 04:34:53 +00:00
|
|
|
class LocationImpl;
|
|
|
|
class NavigatorImpl;
|
1999-01-28 23:12:54 +00:00
|
|
|
class ScreenImpl;
|
|
|
|
class HistoryImpl;
|
2000-08-11 04:31:08 +00:00
|
|
|
class nsIDocShellLoadInfo;
|
1998-08-13 04:34:53 +00:00
|
|
|
|
2000-02-08 13:40:10 +00:00
|
|
|
//*****************************************************************************
|
|
|
|
// GlobalWindowImpl: Global Object for Scripting
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
//*****************************************************************************
|
2001-07-24 22:39:11 +00:00
|
|
|
// Beware that all scriptable interfaces implemented by
|
|
|
|
// GlobalWindowImpl will be reachable from JS, if you make this class
|
|
|
|
// implement new interfaces you better know what you're
|
|
|
|
// doing. Security wise this is very sensitive code. --
|
|
|
|
// jst@netscape.com
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
class GlobalWindowImpl : public nsIScriptGlobalObject,
|
|
|
|
public nsIDOMWindowInternal,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
public nsIDOMJSWindow,
|
2001-01-18 07:44:29 +00:00
|
|
|
public nsIScriptObjectPrincipal,
|
|
|
|
public nsIDOMEventReceiver,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
public nsPIDOMWindow,
|
2001-01-18 07:44:29 +00:00
|
|
|
public nsIDOMViewCSS,
|
2001-05-17 02:15:27 +00:00
|
|
|
public nsSupportsWeakReference,
|
|
|
|
public nsIInterfaceRequestor
|
1998-07-24 05:05:42 +00:00
|
|
|
{
|
|
|
|
public:
|
2001-01-18 07:44:29 +00:00
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
// nsIScriptGlobalObject
|
|
|
|
NS_IMETHOD SetContext(nsIScriptContext *aContext);
|
|
|
|
NS_IMETHOD GetContext(nsIScriptContext **aContext);
|
2001-10-02 00:54:44 +00:00
|
|
|
NS_IMETHOD SetNewDocument(nsIDOMDocument *aDocument,
|
|
|
|
PRBool removeEventListeners);
|
2001-01-18 07:44:29 +00:00
|
|
|
NS_IMETHOD SetDocShell(nsIDocShell* aDocShell);
|
|
|
|
NS_IMETHOD GetDocShell(nsIDocShell** aDocShell);
|
|
|
|
NS_IMETHOD SetOpenerWindow(nsIDOMWindowInternal *aOpener);
|
|
|
|
NS_IMETHOD SetGlobalObjectOwner(nsIScriptGlobalObjectOwner* aOwner);
|
|
|
|
NS_IMETHOD GetGlobalObjectOwner(nsIScriptGlobalObjectOwner** aOwner);
|
2001-02-15 05:07:46 +00:00
|
|
|
NS_IMETHOD HandleDOMEvent(nsIPresContext* aPresContext, nsEvent* aEvent,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
nsIDOMEvent** aDOMEvent, PRUint32 aFlags,
|
2001-01-18 07:44:29 +00:00
|
|
|
nsEventStatus* aEventStatus);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_IMETHOD_(JSObject *) GetGlobalJSObject();
|
|
|
|
NS_IMETHOD OnFinalize(JSObject *aJSObject);
|
2002-02-09 02:48:31 +00:00
|
|
|
NS_IMETHOD SetScriptsEnabled(PRBool aEnabled, PRBool aFireTimeouts);
|
2001-01-18 07:44:29 +00:00
|
|
|
|
|
|
|
// nsIScriptObjectPrincipal
|
|
|
|
NS_IMETHOD GetPrincipal(nsIPrincipal **prin);
|
|
|
|
|
|
|
|
// nsIDOMWindow
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIDOMWINDOW
|
2001-01-18 07:44:29 +00:00
|
|
|
|
|
|
|
// nsIDOMWindowInternal
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIDOMWINDOWINTERNAL
|
|
|
|
|
|
|
|
// nsIDOMJSWindow
|
|
|
|
NS_DECL_NSIDOMJSWINDOW
|
2001-01-18 07:44:29 +00:00
|
|
|
|
|
|
|
// nsIDOMEventTarget
|
2002-04-20 01:48:32 +00:00
|
|
|
NS_IMETHOD AddEventListener(const nsAString& aType,
|
|
|
|
nsIDOMEventListener* aListener,
|
|
|
|
PRBool aUseCapture);
|
|
|
|
NS_IMETHOD RemoveEventListener(const nsAString& aType,
|
|
|
|
nsIDOMEventListener* aListener,
|
|
|
|
PRBool aUseCapture);
|
|
|
|
NS_IMETHOD DispatchEvent(nsIDOMEvent* aEvent, PRBool *_retval);
|
2001-01-18 07:44:29 +00:00
|
|
|
|
|
|
|
// nsIDOMEventReceiver
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_IMETHOD AddEventListenerByIID(nsIDOMEventListener *aListener,
|
2001-01-18 07:44:29 +00:00
|
|
|
const nsIID& aIID);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_IMETHOD RemoveEventListenerByIID(nsIDOMEventListener *aListener,
|
2001-01-18 07:44:29 +00:00
|
|
|
const nsIID& aIID);
|
|
|
|
NS_IMETHOD GetListenerManager(nsIEventListenerManager** aInstancePtrResult);
|
2002-04-20 01:48:32 +00:00
|
|
|
NS_IMETHOD GetNewListenerManager(nsIEventListenerManager **aInstancePtrResult);
|
2001-01-18 07:44:29 +00:00
|
|
|
NS_IMETHOD HandleEvent(nsIDOMEvent *aEvent);
|
|
|
|
|
|
|
|
// nsPIDOMWindow
|
|
|
|
NS_IMETHOD GetPrivateParent(nsPIDOMWindow** aResult);
|
|
|
|
NS_IMETHOD GetPrivateRoot(nsIDOMWindowInternal** aResult);
|
|
|
|
NS_IMETHOD GetObjectProperty(const PRUnichar* aProperty,
|
|
|
|
nsISupports** aObject);
|
|
|
|
NS_IMETHOD Activate();
|
|
|
|
NS_IMETHOD Deactivate();
|
|
|
|
NS_IMETHOD GetChromeEventHandler(nsIChromeEventHandler** aHandler);
|
|
|
|
NS_IMETHOD HasMutationListeners(PRUint32 aMutationEventType,
|
|
|
|
PRBool* aResult);
|
|
|
|
NS_IMETHOD SetMutationListeners(PRUint32 aEventType);
|
|
|
|
NS_IMETHOD GetRootFocusController(nsIFocusController** aResult);
|
2002-02-06 03:48:20 +00:00
|
|
|
NS_IMETHOD GetExtantDocument(nsIDOMDocument** aDocument);
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_IMETHOD ReallyCloseWindow();
|
2002-04-12 02:15:43 +00:00
|
|
|
NS_IMETHOD IsLoadingOrRunningTimeout(PRBool* aResult);
|
2000-06-23 00:42:21 +00:00
|
|
|
|
2002-04-17 04:17:16 +00:00
|
|
|
NS_IMETHOD GetFrameElementInternal(nsIDOMElement** aFrameElement);
|
|
|
|
NS_IMETHOD SetFrameElementInternal(nsIDOMElement* aFrameElement);
|
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
// nsIDOMViewCSS
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIDOMVIEWCSS
|
2000-05-03 13:03:17 +00:00
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
// nsIDOMAbstractView
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIDOMABSTRACTVIEW
|
2000-02-08 13:40:10 +00:00
|
|
|
|
2001-05-17 02:15:27 +00:00
|
|
|
// nsIInterfaceRequestor
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
// Object Management
|
|
|
|
GlobalWindowImpl();
|
2000-02-08 13:40:10 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
static void ShutDown();
|
2002-06-19 04:09:57 +00:00
|
|
|
static PRBool IsCallerChrome();
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2000-02-08 13:40:10 +00:00
|
|
|
protected:
|
2001-01-18 07:44:29 +00:00
|
|
|
// Object Management
|
|
|
|
virtual ~GlobalWindowImpl();
|
|
|
|
void CleanUp();
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2001-10-31 23:52:52 +00:00
|
|
|
// Get the parent, returns null if this is a toplevel window
|
|
|
|
void GetParentInternal(nsIDOMWindowInternal **parent);
|
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
// Window Control Functions
|
2002-03-24 00:16:18 +00:00
|
|
|
NS_IMETHOD OpenInternal(const nsAString& aUrl,
|
|
|
|
const nsAString& aName,
|
|
|
|
const nsAString& aOptions,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
PRBool aDialog, jsval *argv, PRUint32 argc,
|
|
|
|
nsISupports *aExtraArgument, nsIDOMWindow **aReturn);
|
2001-01-18 07:44:29 +00:00
|
|
|
static void CloseWindow(nsISupports* aWindow);
|
|
|
|
|
|
|
|
// Timeout Functions
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
nsresult SetTimeoutOrInterval(PRBool aIsInterval, PRInt32* aReturn);
|
2001-08-15 05:35:02 +00:00
|
|
|
void RunTimeout(nsTimeoutImpl *aTimeout);
|
2001-01-18 07:44:29 +00:00
|
|
|
void DropTimeout(nsTimeoutImpl *aTimeout, nsIScriptContext* aContext=nsnull);
|
|
|
|
void HoldTimeout(nsTimeoutImpl *aTimeout);
|
2002-03-27 00:55:57 +00:00
|
|
|
nsresult ClearTimeoutOrInterval();
|
2001-01-18 07:44:29 +00:00
|
|
|
void ClearAllTimeouts();
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
void InsertTimeoutIntoList(nsTimeoutImpl **aInsertionPoint,
|
2001-01-18 07:44:29 +00:00
|
|
|
nsTimeoutImpl *aTimeout);
|
2001-10-24 06:58:11 +00:00
|
|
|
static void TimerCallback(nsITimer *aTimer, void *aClosure);
|
2001-01-18 07:44:29 +00:00
|
|
|
|
|
|
|
// Helper Functions
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
nsresult GetTreeOwner(nsIDocShellTreeOwner** aTreeOwner);
|
|
|
|
nsresult GetTreeOwner(nsIBaseWindow** aTreeOwner);
|
|
|
|
nsresult GetWebBrowserChrome(nsIWebBrowserChrome** aBrowserChrome);
|
|
|
|
nsresult GetScrollInfo(nsIScrollableView** aScrollableView, float* aP2T,
|
|
|
|
float* aT2P);
|
2001-06-20 01:25:09 +00:00
|
|
|
nsresult SecurityCheckURL(const char *aURL);
|
2001-08-31 04:06:39 +00:00
|
|
|
PRBool CheckForAbusePoint();
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2002-02-05 05:47:22 +00:00
|
|
|
void FlushPendingNotifications(PRBool aFlushReflows);
|
|
|
|
void EnsureReflowFlushAndPaint();
|
2001-01-18 07:44:29 +00:00
|
|
|
nsresult CheckSecurityWidthAndHeight(PRInt32* width, PRInt32* height);
|
|
|
|
nsresult CheckSecurityLeftAndTop(PRInt32* left, PRInt32* top);
|
2002-05-17 22:24:06 +00:00
|
|
|
static nsresult CheckSecurityIsChromeCaller(PRBool *isChrome);
|
|
|
|
|
2002-03-24 00:49:22 +00:00
|
|
|
void MakeScriptDialogTitle(const nsAString &aInTitle, nsAString &aOutTitle);
|
2000-02-08 13:40:10 +00:00
|
|
|
|
2001-09-30 19:56:32 +00:00
|
|
|
// Helper for window.find()
|
2002-03-24 00:16:18 +00:00
|
|
|
nsresult FindInternal(const nsAString& aStr, PRBool caseSensitive,
|
2001-09-30 19:56:32 +00:00
|
|
|
PRBool backwards, PRBool wrapAround, PRBool wholeWord,
|
|
|
|
PRBool searchInFrames, PRBool showDialog,
|
|
|
|
PRBool *aReturn);
|
|
|
|
|
1998-07-24 05:05:42 +00:00
|
|
|
protected:
|
2001-02-17 19:02:25 +00:00
|
|
|
// When adding new member variables, be careful not to create cycles
|
|
|
|
// through JavaScript. If there is any chance that a member variable
|
|
|
|
// could own objects that are implemented in JavaScript, then those
|
|
|
|
// objects will keep the global object (this object) alive. To prevent
|
|
|
|
// these cycles, ownership of such members must be released in
|
|
|
|
// |CleanUp| and |SetDocShell|.
|
2001-01-18 07:44:29 +00:00
|
|
|
nsCOMPtr<nsIScriptContext> mContext;
|
|
|
|
nsCOMPtr<nsIDOMDocument> mDocument;
|
|
|
|
nsCOMPtr<nsIDOMWindowInternal> mOpener;
|
|
|
|
nsCOMPtr<nsIControllers> mControllers;
|
|
|
|
nsCOMPtr<nsIEventListenerManager> mListenerManager;
|
|
|
|
nsCOMPtr<nsISidebar> mSidebar;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
JSObject* mJSObject;
|
2001-01-18 07:44:29 +00:00
|
|
|
NavigatorImpl* mNavigator;
|
|
|
|
ScreenImpl* mScreen;
|
|
|
|
HistoryImpl* mHistory;
|
|
|
|
nsDOMWindowList* mFrames;
|
|
|
|
LocationImpl* mLocation;
|
|
|
|
BarPropImpl* mMenubar;
|
|
|
|
BarPropImpl* mToolbar;
|
|
|
|
BarPropImpl* mLocationbar;
|
|
|
|
BarPropImpl* mPersonalbar;
|
|
|
|
BarPropImpl* mStatusbar;
|
|
|
|
BarPropImpl* mScrollbars;
|
|
|
|
nsTimeoutImpl* mTimeouts;
|
|
|
|
nsTimeoutImpl** mTimeoutInsertionPoint;
|
|
|
|
nsTimeoutImpl* mRunningTimeout;
|
|
|
|
PRUint32 mTimeoutPublicIdCounter;
|
|
|
|
PRUint32 mTimeoutFiringDepth;
|
2001-08-15 05:35:02 +00:00
|
|
|
PRPackedBool mTimeoutsWereCleared;
|
2001-07-13 01:30:44 +00:00
|
|
|
PRPackedBool mFirstDocumentLoad;
|
|
|
|
PRPackedBool mIsScopeClear;
|
2001-08-31 04:06:39 +00:00
|
|
|
PRPackedBool mIsDocumentLoaded; // true between onload and onunload events
|
2002-03-08 21:48:28 +00:00
|
|
|
PRTime mLastMouseButtonAction;
|
2002-02-20 03:33:52 +00:00
|
|
|
PRPackedBool mFullScreen;
|
2001-01-18 07:44:29 +00:00
|
|
|
nsString mStatus;
|
|
|
|
nsString mDefaultStatus;
|
|
|
|
|
2002-02-20 03:33:52 +00:00
|
|
|
// state preservation for full screen mode
|
|
|
|
nsPoint* mOriginalPos;
|
|
|
|
nsSize* mOriginalSize;
|
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
nsIScriptGlobalObjectOwner* mGlobalObjectOwner; // Weak Reference
|
|
|
|
nsIDocShell* mDocShell; // Weak Reference
|
|
|
|
PRUint32 mMutationBits;
|
|
|
|
nsCOMPtr<nsIChromeEventHandler> mChromeEventHandler; // [Strong] We break it when we get torn down.
|
|
|
|
nsCOMPtr<nsIDOMCrypto> mCrypto;
|
|
|
|
nsCOMPtr<nsIDOMPkcs11> mPkcs11;
|
|
|
|
nsCOMPtr<nsIPrincipal> mDocumentPrincipal;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2002-04-17 04:17:16 +00:00
|
|
|
nsIDOMElement* mFrameElement; // WEAK
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
friend class nsDOMScriptableHelper;
|
|
|
|
static nsIXPConnect *sXPConnect;
|
2002-05-17 22:24:06 +00:00
|
|
|
static nsIScriptSecurityManager *sSecMan;
|
1998-07-24 05:05:42 +00:00
|
|
|
};
|
|
|
|
|
2002-02-09 03:36:55 +00:00
|
|
|
/*
|
|
|
|
* nsGlobalChromeWindow inherits from GlobalWindowImpl. It is the global
|
|
|
|
* object created for a Chrome Window only.
|
|
|
|
*/
|
|
|
|
class nsGlobalChromeWindow : public GlobalWindowImpl,
|
|
|
|
public nsIDOMChromeWindow
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
// nsIDOMChromeWindow interface
|
|
|
|
NS_DECL_NSIDOMCHROMEWINDOW
|
|
|
|
|
|
|
|
protected:
|
|
|
|
nsresult GetMainWidget(nsIWidget** aMainWidget);
|
|
|
|
|
|
|
|
nsString mTitle;
|
|
|
|
};
|
|
|
|
|
2001-02-15 05:07:46 +00:00
|
|
|
/*
|
1998-07-24 05:05:42 +00:00
|
|
|
* Timeout struct that holds information about each JavaScript
|
|
|
|
* timeout.
|
|
|
|
*/
|
|
|
|
struct nsTimeoutImpl {
|
2001-08-15 05:35:02 +00:00
|
|
|
nsTimeoutImpl() {
|
|
|
|
memset(this, 0, sizeof(*this));
|
|
|
|
|
|
|
|
MOZ_COUNT_CTOR(nsTimeoutImpl);
|
|
|
|
}
|
|
|
|
|
|
|
|
~nsTimeoutImpl() {
|
|
|
|
MOZ_COUNT_DTOR(nsTimeoutImpl);
|
|
|
|
}
|
|
|
|
|
1998-07-24 05:05:42 +00:00
|
|
|
PRInt32 ref_count; /* reference count to shared usage */
|
|
|
|
GlobalWindowImpl *window; /* window for which this timeout fires */
|
1999-07-12 23:40:01 +00:00
|
|
|
JSString *expr; /* the JS expression to evaluate */
|
1998-07-24 05:05:42 +00:00
|
|
|
JSObject *funobj; /* or function to call, if !expr */
|
2001-07-11 09:09:30 +00:00
|
|
|
nsCOMPtr<nsITimer> timer; /* The actual timer object */
|
1998-07-24 05:05:42 +00:00
|
|
|
jsval *argv; /* function actual arguments */
|
|
|
|
PRUint16 argc; /* and argument count */
|
|
|
|
PRUint16 spare; /* alignment padding */
|
|
|
|
PRUint32 public_id; /* Returned as value of setTimeout() */
|
|
|
|
PRInt32 interval; /* Non-zero if repetitive timeout */
|
|
|
|
PRInt64 when; /* nominal time to run this timeout */
|
2001-08-15 05:35:02 +00:00
|
|
|
nsCOMPtr<nsIPrincipal> principal; /* principals with which to execute */
|
1998-07-24 05:05:42 +00:00
|
|
|
char *filename; /* filename of setTimeout call */
|
|
|
|
PRUint32 lineno; /* line number of setTimeout call */
|
(13163, r=alecf, scc, waterson, others; names available on request)
- Fix most of bug 13163 (see TODO for rest). This entails adding a version-string argument to nsIScriptContext::EvaluateString and passing it around lots of places in content sinks.
- Fix leaks and confusion about mSecurityManager and mNameSpaceManager in nsJSEnvironment.cpp. These still need to move from nsJSContext to nsGlobalWindow or thereabouts, jband and vidur are looking at that.
- Added comments and expanded tabs in nsJSEnvironment.cpp, esp. to EvaluateString. Also changed various nsresult vars to be named rv. Also restored brace/style conformity to nsJSProtocolHandler.cpp.
- Factored CompileFunction from AddScriptEventListener to pave the way for brutal sharing of compiled JS event handlers via JS_CloneFunctionObject.
- Lots of nsCOMPtr uses added. I'm using one for mNameSpaceManager. Hold mSecurityManager as a service explicitly, on the other hand (awaiting scc's fix to allow comptrs for services), and release in nsJSContext's dtor (fixing a leak). These two managers should be moved to the window object -- TODO item below.
- Hold JSRuntimeService along with JSRuntime for live of nsJSEnvironment, fix for shaver.
- Fix window.setTimeout etc. so the filename and line number of the timeout expr is propagated. This meant factoring nsJSUtils.cpp code.
- Fix all content sinks to use the same, and up-to-date JavaScript version parsing (whether for script type or for old language attribute); also fix SplitMimeType clones to strip whitespace.
- With waterson, fix bug in brutal-sharing version of XUL content sink: script src= should not evaluate the inline content of its tag.
1999-10-31 00:43:30 +00:00
|
|
|
const char *version; /* JS language version string constant */
|
2001-08-15 05:35:02 +00:00
|
|
|
PRUint32 firingDepth; /* stack depth at which timeout is
|
|
|
|
firing */
|
1998-07-24 05:05:42 +00:00
|
|
|
nsTimeoutImpl *next;
|
|
|
|
};
|
|
|
|
|
2000-02-08 13:40:10 +00:00
|
|
|
//*****************************************************************************
|
|
|
|
// NavigatorImpl: Script "navigator" object
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
//*****************************************************************************
|
1998-07-24 05:05:42 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
class NavigatorImpl : public nsIDOMNavigator,
|
|
|
|
public nsIDOMJSNavigator
|
2000-02-08 13:40:10 +00:00
|
|
|
{
|
1998-07-24 05:05:42 +00:00
|
|
|
public:
|
2001-01-23 22:29:41 +00:00
|
|
|
NavigatorImpl(nsIDocShell *aDocShell);
|
2001-01-18 07:44:29 +00:00
|
|
|
virtual ~NavigatorImpl();
|
2000-02-08 13:40:10 +00:00
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
NS_DECL_ISUPPORTS
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIDOMNAVIGATOR
|
|
|
|
NS_DECL_NSIDOMJSNAVIGATOR
|
2001-07-23 05:36:52 +00:00
|
|
|
|
2001-01-23 22:29:41 +00:00
|
|
|
void SetDocShell(nsIDocShell *aDocShell);
|
2001-07-23 05:36:52 +00:00
|
|
|
nsresult RefreshMIMEArray();
|
2001-01-23 22:29:41 +00:00
|
|
|
|
1998-07-24 05:05:42 +00:00
|
|
|
protected:
|
2001-07-23 05:36:52 +00:00
|
|
|
MimeTypeArrayImpl* mMimeTypes;
|
2001-01-23 22:29:41 +00:00
|
|
|
PluginArrayImpl* mPlugins;
|
|
|
|
nsIDocShell* mDocShell; // weak reference
|
2002-02-13 04:20:46 +00:00
|
|
|
|
|
|
|
static jsval sPrefInternal_id;
|
1998-07-24 05:05:42 +00:00
|
|
|
};
|
|
|
|
|
1999-06-23 03:29:44 +00:00
|
|
|
class nsIURI;
|
1998-12-16 05:40:20 +00:00
|
|
|
|
2000-02-08 13:40:10 +00:00
|
|
|
//*****************************************************************************
|
|
|
|
// LocationImpl: Script "location" object
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
//*****************************************************************************
|
2000-02-08 13:40:10 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
class LocationImpl : public nsIDOMLocation,
|
|
|
|
public nsIDOMNSLocation
|
1999-08-03 23:16:48 +00:00
|
|
|
{
|
1998-08-13 04:34:53 +00:00
|
|
|
public:
|
2001-01-18 07:44:29 +00:00
|
|
|
LocationImpl(nsIDocShell *aDocShell);
|
|
|
|
virtual ~LocationImpl();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
NS_IMETHOD_(void) SetDocShell(nsIDocShell *aDocShell);
|
|
|
|
|
|
|
|
// nsIDOMLocation
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIDOMLOCATION
|
2001-01-18 07:44:29 +00:00
|
|
|
|
|
|
|
// nsIDOMNSLocation
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIDOMNSLOCATION
|
2001-01-18 07:44:29 +00:00
|
|
|
|
1998-08-13 04:34:53 +00:00
|
|
|
protected:
|
2002-03-06 07:48:55 +00:00
|
|
|
nsresult GetURI(nsIURI** aURL);
|
|
|
|
nsresult GetWritableURI(nsIURI** aURL);
|
|
|
|
nsresult SetURI(nsIURI* aURL);
|
2002-03-24 00:16:18 +00:00
|
|
|
nsresult SetHrefWithBase(const nsAString& aHref, nsIURI* aBase,
|
1999-08-03 23:16:48 +00:00
|
|
|
PRBool aReplace);
|
2002-03-24 00:16:18 +00:00
|
|
|
nsresult SetHrefWithContext(JSContext* cx, const nsAString& aHref,
|
2001-05-15 20:58:31 +00:00
|
|
|
PRBool aReplace);
|
|
|
|
|
2001-11-17 17:26:18 +00:00
|
|
|
nsresult GetSourceURL(JSContext* cx, nsIURI** sourceURL);
|
|
|
|
nsresult GetSourceBaseURL(JSContext* cx, nsIURI** sourceURL);
|
|
|
|
nsresult GetSourceDocument(JSContext* cx, nsIDocument** aDocument);
|
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
nsresult CheckURL(nsIURI *url, nsIDocShellLoadInfo** aLoadInfo);
|
1998-08-13 04:34:53 +00:00
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
nsIDocShell *mDocShell; // Weak Reference
|
1998-08-13 04:34:53 +00:00
|
|
|
};
|
|
|
|
|
1999-12-13 23:13:33 +00:00
|
|
|
#define DOM_CONTROLLER
|
|
|
|
#ifdef DOM_CONTROLLER
|
|
|
|
class nsIContentViewerEdit;
|
1999-12-14 01:38:17 +00:00
|
|
|
|
|
|
|
class nsISelectionController;
|
|
|
|
|
|
|
|
class nsDOMWindowController : public nsIController
|
1999-12-13 23:13:33 +00:00
|
|
|
{
|
|
|
|
public:
|
2000-09-01 01:54:35 +00:00
|
|
|
nsDOMWindowController( nsIDOMWindowInternal* aWindow );
|
2002-05-22 00:39:21 +00:00
|
|
|
virtual ~nsDOMWindowController();
|
2001-01-18 07:44:29 +00:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSICONTROLLER
|
2001-02-15 05:07:46 +00:00
|
|
|
|
1999-12-13 23:13:33 +00:00
|
|
|
private:
|
Fixes bug 66597, bug 103284, bug 114440, bug 120023, bug 128741, bug 19259. Cleans up browse with caret, makes it work with XML content docs, creates keyboard toggle for it (Accel+shift+K), synchronizes focus and document selection so that users can tab navigate relative to their last find or click in text, or vice versa, makes tabbing move relative to named anchor that has been jumped to. r=bryner, sr=alecf, a=asa
2002-03-10 06:21:48 +00:00
|
|
|
nsresult GetEventStateManager(nsIEventStateManager **esm);
|
2002-04-02 01:56:12 +00:00
|
|
|
static int PR_CALLBACK BrowseWithCaretPrefCallback(const char* aPrefName, void* instance_data);
|
1999-12-14 01:38:17 +00:00
|
|
|
nsresult GetPresShell(nsIPresShell **aPresShell);
|
2001-02-15 05:07:46 +00:00
|
|
|
nsresult GetEditInterface( nsIContentViewerEdit** aEditInterface);
|
1999-12-14 01:38:17 +00:00
|
|
|
nsresult GetSelectionController(nsISelectionController ** aSelCon);
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
nsresult DoCommandWithEditInterface(const nsCString& aCommandName);
|
|
|
|
nsresult DoCommandWithSelectionController(const nsCString& aCommandName);
|
2001-04-18 06:06:31 +00:00
|
|
|
|
2000-09-01 01:54:35 +00:00
|
|
|
nsIDOMWindowInternal *mWindow;
|
2001-02-15 05:07:46 +00:00
|
|
|
PRBool mBrowseWithCaret;
|
1999-12-13 23:13:33 +00:00
|
|
|
};
|
|
|
|
#endif // DOM_CONTROLLER
|
|
|
|
|
1998-07-24 05:05:42 +00:00
|
|
|
#endif /* nsGlobalWindow_h___ */
|