/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef nsPIDOMWindow_h__ #define nsPIDOMWindow_h__ #include "nsIDOMWindow.h" #include "nsCOMPtr.h" #include "nsAutoPtr.h" #include "nsTArray.h" #include "mozilla/dom/EventTarget.h" #include "js/TypeDecls.h" #include "nsRefPtrHashtable.h" #define DOM_WINDOW_DESTROYED_TOPIC "dom-window-destroyed" #define DOM_WINDOW_FROZEN_TOPIC "dom-window-frozen" #define DOM_WINDOW_THAWED_TOPIC "dom-window-thawed" class nsIArray; class nsIContent; class nsICSSDeclaration; class nsIDocShell; class nsIDocShellLoadInfo; class nsIDocument; class nsIIdleObserver; class nsIScriptTimeoutHandler; class nsIURI; class nsPerformance; class nsPIWindowRoot; class nsXBLPrototypeHandler; struct nsTimeout; namespace mozilla { namespace dom { class AudioContext; class Element; class ServiceWorkerRegistrationMainThread; } // namespace dom namespace gfx { class VRHMDInfo; } // namespace gfx } // namespace mozilla // Popup control state enum. The values in this enum must go from most // permissive to least permissive so that it's safe to push state in // all situations. Pushing popup state onto the stack never makes the // current popup state less permissive (see // nsGlobalWindow::PushPopupControlState()). enum PopupControlState { openAllowed = 0, // open that window without worries openControlled, // it's a popup, but allow it openAbused, // it's a popup. disallow it, but allow domain override. openOverridden // disallow window open }; enum UIStateChangeType { UIStateChangeType_NoChange, UIStateChangeType_Set, UIStateChangeType_Clear }; #define NS_PIDOMWINDOW_IID \ { 0x775dabc9, 0x8f43, 0x4277, \ { 0x9a, 0xdb, 0xf1, 0x99, 0x0d, 0x77, 0xcf, 0xfb } } class nsPIDOMWindow : public nsIDOMWindowInternal { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_PIDOMWINDOW_IID) virtual nsPIDOMWindow* GetPrivateRoot() = 0; // Outer windows only. virtual void ActivateOrDeactivate(bool aActivate) = 0; // this is called GetTopWindowRoot to avoid conflicts with nsIDOMWindow::GetWindowRoot /** * |top| gets the root of the window hierarchy. * * This function does not cross chrome-content boundaries, so if this * window's parent is of a different type, |top| will return this window. * * When script reads the top property, we run GetScriptableTop, which * will not cross an