aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-11-25 05:16:10 +0800
committerChristian Persch <chpe@src.gnome.org>2004-11-25 05:16:10 +0800
commit506fe28922fa97b95f9b7843d2fffaf69cdee359 (patch)
treef95341b2bd1388983ef1c56c15c8ed4aaf3027db /embed/mozilla
parentf537e60e880ab0082c1fc3d65775ae1f8b74c47f (diff)
downloadgsoc2013-epiphany-506fe28922fa97b95f9b7843d2fffaf69cdee359.tar
gsoc2013-epiphany-506fe28922fa97b95f9b7843d2fffaf69cdee359.tar.gz
gsoc2013-epiphany-506fe28922fa97b95f9b7843d2fffaf69cdee359.tar.bz2
gsoc2013-epiphany-506fe28922fa97b95f9b7843d2fffaf69cdee359.tar.lz
gsoc2013-epiphany-506fe28922fa97b95f9b7843d2fffaf69cdee359.tar.xz
gsoc2013-epiphany-506fe28922fa97b95f9b7843d2fffaf69cdee359.tar.zst
gsoc2013-epiphany-506fe28922fa97b95f9b7843d2fffaf69cdee359.zip
Adapt to changing mozilla API here. Thanks to Crispin for the patch
2004-11-24 Christian Persch <chpe@cvs.gnome.org> * configure.in: * embed/mozilla/GtkNSSKeyPairDialogs.cpp: Adapt to changing mozilla API here. Thanks to Crispin for the patch (adapted from galeon).
Diffstat (limited to 'embed/mozilla')
-rw-r--r--embed/mozilla/GtkNSSKeyPairDialogs.cpp50
1 files changed, 45 insertions, 5 deletions
diff --git a/embed/mozilla/GtkNSSKeyPairDialogs.cpp b/embed/mozilla/GtkNSSKeyPairDialogs.cpp
index fbeb681c7..09d0d8c1b 100644
--- a/embed/mozilla/GtkNSSKeyPairDialogs.cpp
+++ b/embed/mozilla/GtkNSSKeyPairDialogs.cpp
@@ -49,11 +49,15 @@
#include <nsIInterfaceRequestor.h>
#include <nsIInterfaceRequestorUtils.h>
#include <nsIKeygenThread.h>
-#include <nsIDOMWindow.h>
+#ifdef HAVE_NSIKEYGENTHREAD_NSIOBSERVER
+#include <nsIObserver.h>
+#else /* !HAVE_NSIKEYGENTHREAD_NSIOBSERVER */
+#include <nsIDOMWindow.h>
#ifdef ALLOW_PRIVATE_API
#include "nsIDOMWindowInternal.h"
-#endif
+#endif /* ALLOW_PRIVATE_API */
+#endif /* HAVE_NSIKEYGENTHREAD_NSIOBSERVER */
#include <gtk/gtkdialog.h>
#include <gtk/gtkprogressbar.h>
@@ -81,6 +85,30 @@ GtkNSSKeyPairDialogs::~GtkNSSKeyPairDialogs ()
NS_IMPL_ISUPPORTS1 (GtkNSSKeyPairDialogs,
nsIGeneratingKeypairInfoDialogs)
+#ifdef HAVE_NSIKEYGENTHREAD_NSIOBSERVER
+
+class KeyPairObserver : public nsIObserver
+{
+public:
+ NS_DECL_NSIOBSERVER
+ NS_DECL_ISUPPORTS
+
+ KeyPairObserver() : close_called (FALSE) {};
+ virtual ~KeyPairObserver() {};
+
+ gboolean close_called;
+};
+
+NS_IMPL_ISUPPORTS1 (KeyPairObserver, nsIObserver);
+
+NS_IMETHODIMP KeyPairObserver::Observe (nsISupports *aSubject, const char *aTopic,
+ const PRUnichar *aData)
+{
+ close_called = TRUE;
+ return NS_OK;
+}
+
+#else /* !HAVE_NSIKEYGENTHREAD_NSIOBSERVER */
/* ------------------------------------------------------------
* A dummy implementation of nsIDomWindowInternal so that
@@ -115,6 +143,8 @@ NS_IMETHODIMP KeyPairHelperWindow::Close()
return NS_OK;
}
+#endif /* HAVE_NSIKEYGENTHREAD_NSIOBSERVER */
+
/* ------------------------------------------------------------ */
static void
begin_busy (GtkWidget *widget)
@@ -140,7 +170,11 @@ struct KeyPairInfo
{
GtkWidget *progress;
GtkWidget *dialog;
- KeyPairHelperWindow *helper;
+#ifdef HAVE_NSIKEYGENTHREAD_NSIOBSERVER
+ KeyPairObserver *helper;
+#else
+ KeyPairHelperWindow *helper;
+#endif /* HAVE_NSIKEYGENTHREAD_NSIOBSERVER */
};
@@ -198,7 +232,11 @@ GtkNSSKeyPairDialogs::DisplayGeneratingKeypairInfo (nsIInterfaceRequestor *ctx,
/* Create a helper class that just waits for close events
* from the other thread */
- KeyPairHelperWindow *helper = new KeyPairHelperWindow;
+#ifdef HAVE_NSIKEYGENTHREAD_NSIOBSERVER
+ nsCOMPtr<KeyPairObserver> helper = new KeyPairObserver;
+#else
+ nsCOMPtr<KeyPairHelperWindow> helper = new KeyPairHelperWindow;
+#endif
KeyPairInfo callback_data = { progress, dialog, helper };
timeout_id = g_timeout_add (100, (GSourceFunc)generating_timeout_cb, &callback_data);
@@ -221,10 +259,10 @@ GtkNSSKeyPairDialogs::DisplayGeneratingKeypairInfo (nsIInterfaceRequestor *ctx,
g_source_remove (timeout_id);
end_busy (dialog);
gtk_widget_destroy (dialog);
- delete helper;
return NS_OK;
}
+#ifndef HAVE_NSIKEYGENTHREAD_NSIOBSERVER
/*************************************************************
* Misc functions for the nsIDomWindowInternal implementation
@@ -712,4 +750,6 @@ NS_IMETHODIMP KeyPairHelperWindow::GetWindowRoot(nsIDOMEventTarget * *aWindowRoo
MOZ_NOT_IMPLEMENTED
}
+#endif /* !HAVE_NSIKEYGENTHREAD_NSIOBSERVER */
+
#endif