diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2006-02-03 06:25:18 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2006-02-03 06:25:18 +0800 |
commit | b5d229937e31e9cec6cf599ae816e22888237aa0 (patch) | |
tree | 9b62c3b002838151fb7383f874cc29502a447eac /embed/mozilla/PrintingPromptService.cpp | |
parent | fd6923b630ae9629a99fa527baabb47d4454913a (diff) | |
download | gsoc2013-epiphany-b5d229937e31e9cec6cf599ae816e22888237aa0.tar gsoc2013-epiphany-b5d229937e31e9cec6cf599ae816e22888237aa0.tar.gz gsoc2013-epiphany-b5d229937e31e9cec6cf599ae816e22888237aa0.tar.bz2 gsoc2013-epiphany-b5d229937e31e9cec6cf599ae816e22888237aa0.tar.lz gsoc2013-epiphany-b5d229937e31e9cec6cf599ae816e22888237aa0.tar.xz gsoc2013-epiphany-b5d229937e31e9cec6cf599ae816e22888237aa0.tar.zst gsoc2013-epiphany-b5d229937e31e9cec6cf599ae816e22888237aa0.zip |
Helper class that pushes a null JS context on the stack, and pops it in
2006-02-02 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/Makefile.am:
* embed/mozilla/AutoJSContextStack.cpp:
* embed/mozilla/AutoJSContextStack.h:
Helper class that pushes a null JS context on the stack,
and pops it in the destructor.
* embed/mozilla/ContentHandler.cpp:
* embed/mozilla/EphyPromptService.cpp:
* embed/mozilla/FilePicker.cpp:
* embed/mozilla/GtkNSSClientAuthDialogs.cpp:
* embed/mozilla/GtkNSSDialogs.cpp:
* embed/mozilla/GtkNSSKeyPairDialogs.cpp:
* embed/mozilla/GtkNSSSecurityWarningDialogs.cpp:
* embed/mozilla/PrintingPromptService.cpp:
Push a null JS context on the stack when we run a recursive
mainloop. Fixes the epiphany equivalend of camino bug
https://bugzilla.mozilla.org/show_bug.cgi?id=179307.
Diffstat (limited to 'embed/mozilla/PrintingPromptService.cpp')
-rw-r--r-- | embed/mozilla/PrintingPromptService.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/embed/mozilla/PrintingPromptService.cpp b/embed/mozilla/PrintingPromptService.cpp index 2770f0d30..218c63b81 100644 --- a/embed/mozilla/PrintingPromptService.cpp +++ b/embed/mozilla/PrintingPromptService.cpp @@ -24,6 +24,10 @@ #include "config.h" +#include "PrintingPromptService.h" +#include "EphyUtils.h" +#include "AutoJSContextStack.h" + #include <gtk/gtkdialog.h> #include <libgnomeprintui/gnome-print-dialog.h> @@ -31,8 +35,6 @@ #include "print-dialog.h" #include "ephy-embed.h" #include "ephy-command-manager.h" -#include "EphyUtils.h" -#include "PrintingPromptService.h" #include "eel-gconf-extensions.h" #include "ephy-prefs.h" #include "ephy-debug.h" @@ -72,6 +74,11 @@ NS_IMETHODIMP GPrintingPromptService::ShowPrintDialog(nsIDOMWindow *parent, nsIW return NS_ERROR_ABORT; } + nsresult rv; + AutoJSContextStack stack; + rv = stack.Init (); + if (NS_FAILED (rv)) return rv; + EphyEmbed *embed = EPHY_EMBED (EphyUtils::FindEmbed (parent)); NS_ENSURE_TRUE (embed, NS_ERROR_FAILURE); @@ -136,7 +143,8 @@ NS_IMETHODIMP GPrintingPromptService::ShowProgress(nsIDOMWindow *parent, nsIWebB } /* void showPageSetup (in nsIDOMWindow parent, in nsIPrintSettings printSettings, in nsIObserver printObserver); */ -NS_IMETHODIMP GPrintingPromptService::ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings, +NS_IMETHODIMP GPrintingPromptService::ShowPageSetup(nsIDOMWindow *parent, + nsIPrintSettings *printSettings, nsIObserver *printObserver) { EphyDialog *dialog; @@ -148,6 +156,10 @@ NS_IMETHODIMP GPrintingPromptService::ShowPageSetup(nsIDOMWindow *parent, nsIPri return rv; } + AutoJSContextStack stack; + rv = stack.Init (); + if (NS_FAILED (rv)) return rv; + dialog = ephy_print_setup_dialog_new (); ephy_dialog_set_modal (dialog, TRUE); |