From 1bca516fb7c24aaa7def03ec8ddba71c8d626b91 Mon Sep 17 00:00:00 2001 From: "bryner%brianryner.com" Date: Wed, 15 Feb 2006 02:21:58 +0000 Subject: [PATCH] Dispatch observer service notifications when dom windows are created and destroyed. Bug 326742, r+sr=jst. git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@190054 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 8bb86347c99..d345891a469 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -8078,6 +8078,16 @@ nsDocShell::EnsureScriptEnvironment() // Note that mScriptGlobal has taken a reference to the script // context, so we don't have to. + // Notify observers that we've created a new outer window. + // The matching notification for domwindowdestroyed is in + // nsGlobalWindow::~nsGlobalWindow(). + nsCOMPtr win(do_QueryInterface(mScriptGlobal)); + nsCOMPtr obsSvc = + do_GetService("@mozilla.org/observer-service;1"); + if (obsSvc) { + obsSvc->NotifyObservers(win, "domwindowcreated", nsnull); + } + return NS_OK; }