You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.
Note: This component has an
activeWindowattribute. The application must keep this attribute current by setting it as the active window changes, as some clients may expect it to be always to be up-to-date.
Also, because windows must notify the component when they are created or destroyed, this component should keep only a weak reference to any window, not an owning reference. Note that there is no public interface for such notifications. This is taken care of automatically by common embedding code. Embedding clients need do nothing special about this requirement.
nsIWindowCreator.nsIDOMWindow nsIWindowWatcher::openWindow( in nsIDOMWindow aParent, in string aUrl, in string aName, in string aFeatures, in nsISupports aArguments)
aUrl: Theurl which will be loaded into the new window. Must already be escaped, if applicable. It can be
aArguments:Extra argument(s) to the new window, to be attached as the
nsISupportsArraywill be unwound into multiple arguments (but not recursively!). It can be
aObserver:The object to be notified when windows are opened or closed. Its Observe method will be called with the following parameters:
nsIObserver.An enumerator which will itself return
nsISupportsobjects which can be QIed to an
creator:The callback. If it is
null, the callback will be cleared and window creation capabilities lost.
Retrieves the chrome window mapped to the given DOM window. WindowWatcher keeps a list of all top-level DOM windows currently open, along with their corresponding chrome interfaces. DOM Windows lack a (public) means of retrieving their corresponding chrome directly, so use this method.nsIDOMWindow nsIWindowWatcher::getWindowByName( in wstring aTargetName, in nsIDOMWindow aCurrentWindow)
aCurrentWindow:A starting point in the window hierarchy to begin the search. If
null,each toplevel window will be searched.
The WindowWatcher serves as a global storage facility for the current active (frontmost non-floating-palette-type) window, storing and returning it on demand. Users must keep this attribute current, including after the topmost window is closed. This attribute obviously can return
nullif no windows are open, but should otherwise always return a valid window.
| Written by:Ellen Evans | Comments, questions, complaints?