aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/MozillaPrivate.cpp
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2004-02-28 18:47:03 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2004-02-28 18:47:03 +0800
commit5af89a28e1d5302f351a714a711ddc4ead5320b0 (patch)
treedf2fccd503b13c3928834db0f8f1d8544e7c574b /embed/mozilla/MozillaPrivate.cpp
parentc5cb67fcff408482f964020079910dc3475fef25 (diff)
downloadgsoc2013-epiphany-5af89a28e1d5302f351a714a711ddc4ead5320b0.tar
gsoc2013-epiphany-5af89a28e1d5302f351a714a711ddc4ead5320b0.tar.gz
gsoc2013-epiphany-5af89a28e1d5302f351a714a711ddc4ead5320b0.tar.bz2
gsoc2013-epiphany-5af89a28e1d5302f351a714a711ddc4ead5320b0.tar.lz
gsoc2013-epiphany-5af89a28e1d5302f351a714a711ddc4ead5320b0.tar.xz
gsoc2013-epiphany-5af89a28e1d5302f351a714a711ddc4ead5320b0.tar.zst
gsoc2013-epiphany-5af89a28e1d5302f351a714a711ddc4ead5320b0.zip
Use getInterface to get the dom window from the docshell, not
2004-02-28 Marco Pesenti Gritti <marco@gnome.org> * embed/mozilla/ContentHandler.cpp: Use getInterface to get the dom window from the docshell, not queryInterface. (Bug #121160) * embed/mozilla/MozillaPrivate.cpp: Do not fallback to the active window if the parent cannot be found. It just hides problems and cause more annoying behaviors (like dialogs parented on the wrong window).
Diffstat (limited to 'embed/mozilla/MozillaPrivate.cpp')
-rw-r--r--embed/mozilla/MozillaPrivate.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/embed/mozilla/MozillaPrivate.cpp b/embed/mozilla/MozillaPrivate.cpp
index d83509119..aacb2c629 100644
--- a/embed/mozilla/MozillaPrivate.cpp
+++ b/embed/mozilla/MozillaPrivate.cpp
@@ -35,27 +35,21 @@
GtkWidget *MozillaFindEmbed (nsIDOMWindow *aDOMWindow)
{
+ if (!aDOMWindow) return nsnull;
+
nsCOMPtr<nsIWindowWatcher> wwatch
(do_GetService("@mozilla.org/embedcomp/window-watcher;1"));
NS_ENSURE_TRUE (wwatch, nsnull);
- nsCOMPtr<nsIDOMWindow> domWindow;
- if (aDOMWindow)
- {
- /* this DOM window may belong to some inner frame, we need
- * to get the topmost DOM window to get the embed
- */
- aDOMWindow->GetTop (getter_AddRefs (domWindow));
- }
- else
- {
- /* get the active window */
- wwatch->GetActiveWindow (getter_AddRefs(domWindow));
- }
- NS_ENSURE_TRUE (domWindow, nsnull);
+ /* this DOM window may belong to some inner frame, we need
+ * to get the topmost DOM window to get the embed
+ */
+ nsCOMPtr<nsIDOMWindow> topWindow;
+ aDOMWindow->GetTop (getter_AddRefs (topWindow));
+ if (!topWindow) return nsnull;
nsCOMPtr<nsIWebBrowserChrome> windowChrome;
- wwatch->GetChromeForWindow (domWindow, getter_AddRefs(windowChrome));
+ wwatch->GetChromeForWindow (topWindow, getter_AddRefs(windowChrome));
NS_ENSURE_TRUE (windowChrome, nsnull);
nsCOMPtr<nsIEmbeddingSiteWindow> window (do_QueryInterface(windowChrome));