diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2006-10-06 23:12:23 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2006-10-06 23:12:23 +0800 |
commit | 7fe19ecdd665138af915d404ca57e969704c516e (patch) | |
tree | b27aebb6af8851278e8dafe9ffb572debcc25548 | |
parent | 0a0723e05c55ed32eed1797f649af5389a4fe8db (diff) | |
download | gsoc2013-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-- | ChangeLog | 6 | ||||
-rw-r--r-- | embed/mozilla/AutoWindowModalState.cpp | 33 |
2 files changed, 34 insertions, 5 deletions
@@ -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 */ } |