зеркало из https://github.com/mozilla/gecko-dev.git
Dispatch a notification that a newly-opened window has been initialized (bug 326784). r+sr=bzbarsky.
This commit is contained in:
Родитель
f0a9209f86
Коммит
a084fa9ff9
|
@ -96,6 +96,8 @@ interface nsIWindowWatcher : nsISupports {
|
|||
@note This method should try to set the default charset for the new
|
||||
window to the default charset of aParent. This is not guaranteed,
|
||||
however.
|
||||
@note This method may dispatch a "toplevel-window-ready" notification
|
||||
via nsIObserverService if the window did not already exist.
|
||||
*/
|
||||
nsIDOMWindow openWindow(in nsIDOMWindow aParent, in string aUrl,
|
||||
in string aName, in string aFeatures,
|
||||
|
|
|
@ -839,6 +839,16 @@ nsWindowWatcher::OpenWindowJSInternal(nsIDOMWindow *aParent,
|
|||
}
|
||||
}
|
||||
|
||||
if (windowIsNew) {
|
||||
// Notify observers that the window is open and ready.
|
||||
// The window has not yet started to load a document.
|
||||
nsCOMPtr<nsIObserverService> obsSvc =
|
||||
do_GetService("@mozilla.org/observer-service;1");
|
||||
if (obsSvc) {
|
||||
obsSvc->NotifyObservers(*_retval, "toplevel-window-ready", nsnull);
|
||||
}
|
||||
}
|
||||
|
||||
if (uriToLoad) { // get the script principal and pass it to docshell
|
||||
JSContextAutoPopper contextGuard;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче