michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * 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: /** michael@0: * nsIWindowCreator2 is an extension of nsIWindowCreator which allows michael@0: * additional information about the context of the window creation to michael@0: * be passed. michael@0: * michael@0: * @see nsIWindowCreator michael@0: * @see nsIWindowWatcher michael@0: * michael@0: * @status michael@0: */ michael@0: michael@0: #include "nsIWindowCreator.idl" michael@0: michael@0: interface nsIURI; michael@0: interface nsIWebBrowserChrome; michael@0: michael@0: [scriptable, uuid(f673ec81-a4b0-11d6-964b-eb5a2bf216fc)] michael@0: michael@0: interface nsIWindowCreator2 : nsIWindowCreator { michael@0: michael@0: /** michael@0: * Definitions for contextFlags michael@0: */ michael@0: michael@0: // Likely that the window is an advertising popup. michael@0: const unsigned long PARENT_IS_LOADING_OR_RUNNING_TIMEOUT = 0x00000001; michael@0: michael@0: /** Create a new window. Gecko will/may call this method, if made michael@0: available to it, to create new windows. michael@0: @param parent Parent window, if any. Null if not. The newly created michael@0: window should be made a child/dependent window of michael@0: the parent, if any (and if the concept applies michael@0: to the underlying OS). michael@0: @param chromeFlags Chrome features from nsIWebBrowserChrome michael@0: @param contextFlags Flags about the context of the window being created. michael@0: @param uri The URL for which this window is intended. It can be null michael@0: or zero-length. The implementation of this interface michael@0: may use the URL to help determine what sort of window michael@0: to open or whether to cancel window creation. It will not michael@0: load the URL. michael@0: @param cancel Return |true| to reject window creation. If true the michael@0: implementation has determined the window should not michael@0: be created at all. The caller should not default michael@0: to any possible backup scheme for creating the window. michael@0: @return the new window. Will be null if canceled or an error occurred. michael@0: */ michael@0: nsIWebBrowserChrome createChromeWindow2(in nsIWebBrowserChrome parent, michael@0: in uint32_t chromeFlags, michael@0: in uint32_t contextFlags, michael@0: in nsIURI uri, michael@0: out boolean cancel); michael@0: };