aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/ContentHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'embed/mozilla/ContentHandler.cpp')
-rw-r--r--embed/mozilla/ContentHandler.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/embed/mozilla/ContentHandler.cpp b/embed/mozilla/ContentHandler.cpp
index 5b7a5ac0e..c70f460c2 100644
--- a/embed/mozilla/ContentHandler.cpp
+++ b/embed/mozilla/ContentHandler.cpp
@@ -56,8 +56,7 @@
#include "ephy-prefs.h"
#include "ephy-stock-icons.h"
-#include "AutoJSContextStack.h"
-#include "AutoWindowModalState.h"
+#include "AutoModalDialog.h"
#include "EphyUtils.h"
#include "MozDownload.h"
@@ -144,18 +143,15 @@ NS_IMETHODIMP GContentHandler::PromptForSaveToFile(
{
return BuildDownloadPath (defaultFile.get(), _retval);
}
-
- nsresult rv;
- AutoJSContextStack stack;
- rv = stack.Init ();
- if (NS_FAILED (rv)) return rv;
-
nsCOMPtr<nsIDOMWindow> parentDOMWindow (do_GetInterface (aWindowContext));
- GtkWidget *parentWindow = GTK_WIDGET (EphyUtils::FindGtkParent (parentDOMWindow));
- AutoWindowModalState modalState (parentDOMWindow);
+ AutoModalDialog modalDialog (parentDOMWindow, PR_FALSE);
+ if (!modalDialog.ShouldShow ())
+ return NS_ERROR_FAILURE;
+
+ GtkWindow *parentWindow = modalDialog.GetParent ();
- dialog = ephy_file_chooser_new (_("Save"), parentWindow,
+ dialog = ephy_file_chooser_new (_("Save"), GTK_WIDGET (parentWindow),
GTK_FILE_CHOOSER_ACTION_SAVE,
CONF_STATE_SAVE_DIR,
EPHY_FILE_FILTER_ALL);
@@ -175,7 +171,7 @@ NS_IMETHODIMP GContentHandler::PromptForSaveToFile(
do
{
g_free (filename);
- response = gtk_dialog_run (GTK_DIALOG (dialog));
+ response = modalDialog.Run (GTK_DIALOG (dialog));
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
} while (response == GTK_RESPONSE_ACCEPT
&& !ephy_gui_check_location_writable (GTK_WIDGET (dialog), filename));