aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/GeckoCookiePromptService.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2008-02-18 21:40:59 +0800
committerChristian Persch <chpe@src.gnome.org>2008-02-18 21:40:59 +0800
commitb3924f2a5509596645492d232c9b3dcf1ad35965 (patch)
treec05f7f1fea2ddbf17d10a9e2edc05b043e537104 /embed/mozilla/GeckoCookiePromptService.cpp
parent72305c8033e66e792bde1060b7d7377935cedfb4 (diff)
downloadgsoc2013-epiphany-b3924f2a5509596645492d232c9b3dcf1ad35965.tar
gsoc2013-epiphany-b3924f2a5509596645492d232c9b3dcf1ad35965.tar.gz
gsoc2013-epiphany-b3924f2a5509596645492d232c9b3dcf1ad35965.tar.bz2
gsoc2013-epiphany-b3924f2a5509596645492d232c9b3dcf1ad35965.tar.lz
gsoc2013-epiphany-b3924f2a5509596645492d232c9b3dcf1ad35965.tar.xz
gsoc2013-epiphany-b3924f2a5509596645492d232c9b3dcf1ad35965.tar.zst
gsoc2013-epiphany-b3924f2a5509596645492d232c9b3dcf1ad35965.zip
Fix prompt service for xr 1.9 wrt. DOM notifications. Bug #504445.
svn path=/trunk/; revision=7967
Diffstat (limited to 'embed/mozilla/GeckoCookiePromptService.cpp')
-rw-r--r--embed/mozilla/GeckoCookiePromptService.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/embed/mozilla/GeckoCookiePromptService.cpp b/embed/mozilla/GeckoCookiePromptService.cpp
index 1b32265f5..b228e7c93 100644
--- a/embed/mozilla/GeckoCookiePromptService.cpp
+++ b/embed/mozilla/GeckoCookiePromptService.cpp
@@ -36,8 +36,7 @@
#include "ephy-gui.h"
#include "ephy-stock-icons.h"
-#include "AutoJSContextStack.h"
-#include "AutoWindowModalState.h"
+#include "AutoModalDialog.h"
#include "EphyUtils.h"
#include "GeckoCookiePromptService.h"
@@ -72,22 +71,20 @@ GeckoCookiePromptService::CookieDialog (nsIDOMWindow *aParent,
// TODO short-circuit and accept session cookies as per preference
// TODO until mozilla starts supporting it natively?
- GtkWidget *parent = EphyUtils::FindGtkParent (aParent);
- NS_ENSURE_TRUE(parent, NS_ERROR_INVALID_POINTER);
-
- nsresult rv;
- AutoJSContextStack stack;
- rv = stack.Init ();
- if (NS_FAILED (rv)) {
- return rv;
+ AutoModalDialog modalDialog (aParent, PR_FALSE);
+ if (!modalDialog.ShouldShow ()) {
+ *_retval = PR_FALSE;
+ *_checkValue = PR_FALSE;
+ return NS_OK;
}
- AutoWindowModalState modalState (aParent);
+ GtkWindow *parent = modalDialog.GetParent ();
+ NS_ENSURE_TRUE(parent, NS_ERROR_INVALID_POINTER);
nsCString host(aHostname);
GtkWidget *dialog = gtk_message_dialog_new
- (GTK_WINDOW (parent),
+ (parent,
GTK_DIALOG_MODAL /* FIXME mozilla sucks! */,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_NONE,
@@ -141,7 +138,7 @@ GeckoCookiePromptService::CookieDialog (nsIDOMWindow *aParent,
_("_Accept"), GTK_RESPONSE_ACCEPT);
gtk_dialog_set_default_response (gdialog, GTK_RESPONSE_ACCEPT);
- int response = gtk_dialog_run (gdialog);
+ int response = modalDialog.Run (gdialog);
if (response == GTK_RESPONSE_ACCEPT || response == GTK_RESPONSE_REJECT) {
*_retval = (response == GTK_RESPONSE_ACCEPT);