aboutsummaryrefslogtreecommitdiffstats
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
parent0a0723e05c55ed32eed1797f649af5389a4fe8db (diff)
downloadgsoc2013-epiphany-7fe19ecdd665138af915d404ca57e969704c516e.tar
gsoc2013-epiphany-7fe19ecdd665138af915d404ca57e969704c516e.tar.gz
gsoc2013-epiphany-7fe19ecdd665138af915d404ca57e969704c516e.tar.bz2
gsoc2013-epiphany-7fe19ecdd665138af915d404ca57e969704c516e.tar.lz
gsoc2013-epiphany-7fe19ecdd665138af915d404ca57e969704c516e.tar.xz
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.
-rw-r--r--ChangeLog6
-rw-r--r--embed/mozilla/AutoWindowModalState.cpp33
2 files changed, 34 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index f49323856..01092d1f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2006-10-05 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/GeckoSpellCheckEngine.cpp:
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 */
}