aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-10-06 23:12:23 +0800
committerChristian Persch <chpe@src.gnome.org>2006-10-06 23:12:23 +0800
commit7fe19ecdd665138af915d404ca57e969704c516e (patch)
treeb27aebb6af8851278e8dafe9ffb572debcc25548 /embed
parent0a0723e05c55ed32eed1797f649af5389a4fe8db (diff)
downloadgsoc2013-epiphany-7fe19ecdd665138af915d404ca57e969704c516e.tar.gz
gsoc2013-epiphany-7fe19ecdd665138af915d404ca57e969704c516e.tar.zst
gsoc2013-epiphany-7fe19ecdd665138af915d404ca57e969704c516e.zip
Use the top DOM window here, and adapt to gecko 1.8.1.
2006-10-06 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/AutoWindowModalState.cpp: Use the top DOM window here, and adapt to gecko 1.8.1.
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/AutoWindowModalState.cpp33
1 files changed, 28 insertions, 5 deletions
diff --git a/embed/mozilla/AutoWindowModalState.cpp b/embed/mozilla/AutoWindowModalState.cpp
index ca7596b38..20100e60c 100644
--- a/embed/mozilla/AutoWindowModalState.cpp
+++ b/embed/mozilla/AutoWindowModalState.cpp
@@ -25,19 +25,42 @@
AutoWindowModalState::AutoWindowModalState (nsIDOMWindow *aWindow)
{
-#ifdef HAVE_GECKO_1_9
- mWindow = do_QueryInterface (aWindow);
+#ifdef HAVE_GECKO_1_8_1
+ if (aWindow) {
+ nsresult rv;
+ nsCOMPtr<nsIDOMWindow> topWin;
+ rv = aWindow->GetTop (getter_AddRefs (topWin));
+ if (NS_SUCCEEDED (rv)) {
+ mWindow = do_QueryInterface (topWin);
+ }
+ NS_ASSERTION (mWindow, "Should have a window here!");
+ }
+
if (mWindow) {
+#ifdef HAVE_GECKO_1_9
mWindow->EnterModalState ();
+#else
+ nsCOMPtr<nsPIDOMWindow_MOZILLA_1_8_BRANCH> window (do_QueryInterface (mWindow));
+ NS_ENSURE_TRUE (window, );
+
+ window->EnterModalState ();
+#endif /* HAVE_GECKO_1_9 */
}
-#endif
+#endif /* HAVE_GECKO_1_8_1 */
}
AutoWindowModalState::~AutoWindowModalState()
{
-#ifdef HAVE_GECKO_1_9
+#ifdef HAVE_GECKO_1_8_1
if (mWindow) {
+#ifdef HAVE_GECKO_1_9
mWindow->LeaveModalState ();
+#else
+ nsCOMPtr<nsPIDOMWindow_MOZILLA_1_8_BRANCH> window (do_QueryInterface (mWindow));
+ NS_ENSURE_TRUE (window, );
+
+ window->LeaveModalState ();
+#endif /* HAVE_GECKO_1_9 */
}
-#endif
+#endif /* HAVE_GECKO_1_8_1 */
}