aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/GtkNSSSecurityWarningDialogs.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/GtkNSSSecurityWarningDialogs.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/GtkNSSSecurityWarningDialogs.cpp')
-rw-r--r--embed/mozilla/GtkNSSSecurityWarningDialogs.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/embed/mozilla/GtkNSSSecurityWarningDialogs.cpp b/embed/mozilla/GtkNSSSecurityWarningDialogs.cpp
index b50b3762a..4e8d80c6d 100644
--- a/embed/mozilla/GtkNSSSecurityWarningDialogs.cpp
+++ b/embed/mozilla/GtkNSSSecurityWarningDialogs.cpp
@@ -62,9 +62,7 @@
#include <nsIServiceManager.h>
#include <nsServiceManagerUtils.h>
-#include "AutoJSContextStack.h"
-#include "AutoWindowModalState.h"
-#include "EphyUtils.h"
+#include "AutoModalDialog.h"
#include "GtkNSSSecurityWarningDialogs.h"
@@ -236,28 +234,30 @@ GtkNSSSecurityWarningDialogs::DoDialog (nsIInterfaceRequestor *aContext,
* https://bugzilla.mozilla.org/show_bug.cgi?id=277587
*/
nsCOMPtr<nsIDOMWindow> domWin (do_GetInterface (aContext));
- GtkWidget *parent = EphyUtils::FindGtkParent (domWin);
- AutoJSContextStack stack;
- rv = stack.Init ();
- if (NS_FAILED (rv)) return;
+ AutoModalDialog modalDialog (domWin, PR_FALSE);
+ if (!modalDialog.ShouldShow ())
+ {
+ *_retval = PR_FALSE;
+ return;
+ }
- AutoWindowModalState modalState (domWin);
+ GtkWindow *parent = modalDialog.GetParent ();
- GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW (parent),
+ GtkWidget *dialog = gtk_message_dialog_new (parent,
GTK_DIALOG_MODAL, aType,
- aButtons, aPrimary);
+ aButtons, "%s", aPrimary);
- if (parent && GTK_WINDOW (parent)->group)
+ if (parent && parent->group)
{
- gtk_window_group_add_window (GTK_WINDOW (parent)->group,
+ gtk_window_group_add_window (parent->group,
GTK_WINDOW (dialog));
}
if (aSecondary)
{
gtk_message_dialog_format_secondary_text
- (GTK_MESSAGE_DIALOG (dialog), aSecondary);
+ (GTK_MESSAGE_DIALOG (dialog), "%s", aSecondary);
}
if (aButtonText)
@@ -271,7 +271,7 @@ GtkNSSSecurityWarningDialogs::DoDialog (nsIInterfaceRequestor *aContext,
gtk_window_set_title (GTK_WINDOW (dialog), aTitle);
gtk_window_set_icon_name (GTK_WINDOW (dialog), EPHY_STOCK_EPHY);
- int response = gtk_dialog_run (GTK_DIALOG (dialog));
+ int response = modalDialog.Run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
*_retval = (response == GTK_RESPONSE_ACCEPT || response == GTK_RESPONSE_OK);