aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-11-25 04:00:59 +0800
committerChristian Persch <chpe@src.gnome.org>2004-11-25 04:00:59 +0800
commitb18bbc79c18be7bd72f8c276979a5b3c0a262b27 (patch)
treeaa8829a031dc7da5d1837a62fc256e265f9b9c3e
parente928fbb31c12ebb194f1f3dee0433fe85285b1be (diff)
downloadgsoc2013-epiphany-b18bbc79c18be7bd72f8c276979a5b3c0a262b27.tar
gsoc2013-epiphany-b18bbc79c18be7bd72f8c276979a5b3c0a262b27.tar.gz
gsoc2013-epiphany-b18bbc79c18be7bd72f8c276979a5b3c0a262b27.tar.bz2
gsoc2013-epiphany-b18bbc79c18be7bd72f8c276979a5b3c0a262b27.tar.lz
gsoc2013-epiphany-b18bbc79c18be7bd72f8c276979a5b3c0a262b27.tar.xz
gsoc2013-epiphany-b18bbc79c18be7bd72f8c276979a5b3c0a262b27.tar.zst
gsoc2013-epiphany-b18bbc79c18be7bd72f8c276979a5b3c0a262b27.zip
Adapt to changing mozilla API here.
2004-11-24 Christian Persch <chpe@cvs.gnome.org> * configure.ac: * embed/mozilla/GtkNSSKeyPairDialogs.cpp: Adapt to changing mozilla API here.
-rw-r--r--ChangeLog7
-rw-r--r--configure.ac28
-rw-r--r--embed/mozilla/GtkNSSKeyPairDialogs.cpp50
3 files changed, 75 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 866b1562b..bdb4d24fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2004-11-24 Christian Persch <chpe@cvs.gnome.org>
+ * configure.ac:
+ * embed/mozilla/GtkNSSKeyPairDialogs.cpp:
+
+ Adapt to changing mozilla API here.
+
+2004-11-24 Christian Persch <chpe@cvs.gnome.org>
+
* embed/mozilla/mozilla-notifiers.cpp:
Lowercase the lang codes.
diff --git a/configure.ac b/configure.ac
index a489613af..fb186d61e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -285,7 +285,7 @@ AC_COMPILE_IFELSE(
nsIURI *arg1;
p->RemovePage(arg1);]]
)],
- [AC_DEFINE([MOZ_NSIGLOBALHISTORY_NSIURIP],[1],[dummy]) result=yes],
+ [AC_DEFINE([MOZ_NSIGLOBALHISTORY_NSIURIP],[1],[Define if nsIBrowserHistory methods expect nsIURI*]) result=yes],
[result=no])
AC_MSG_RESULT([$result])
@@ -303,7 +303,7 @@ AC_COMPILE_IFELSE(
[[nsIBrowserHistory *p;
p->AddPageWithDetails(nsnull,nsnull,0);]]
)],
- [AC_DEFINE([MOZ_NSIBROWSERHISTORY_ADDPAGEWITHDETAILS],[1],[dummy]) result=yes],
+ [AC_DEFINE([MOZ_NSIBROWSERHISTORY_ADDPAGEWITHDETAILS],[1],[Define if nsIBrowserHistory::AddPageWithDetails exists]) result=yes],
[result=no])
AC_MSG_RESULT([$result])
@@ -321,7 +321,7 @@ AC_COMPILE_IFELSE(
[[nsIBrowserHistory *p;
p->AddURI(nsnull,PR_FALSE,PR_FALSE,nsnull);]]
)],
- [AC_DEFINE([MOZ_NSIBROWSERHISTORY_ADDURI_WITH_REFERRER],[1],[dummy]) result=yes],
+ [AC_DEFINE([MOZ_NSIBROWSERHISTORY_ADDURI_WITH_REFERRER],[1],[Define if nsIGlobalHistory2::AddURI takes a referrer]) result=yes],
[result=no])
AC_MSG_RESULT([$result])
@@ -337,7 +337,7 @@ AC_COMPILE_IFELSE(
[[nsIXULChromeRegistry *p;
p->SelectSkin (nsEmbedCString(), PR_FALSE);]]
)],
- [AC_DEFINE([MOZ_NSIXULCHROMEREGISTRY_SELECTSKIN],[1],[dummy]) result=yes],
+ [AC_DEFINE([MOZ_NSIXULCHROMEREGISTRY_SELECTSKIN],[1],[Define if nsIXULChromeRegistry::SelectSkin exists]) result=yes],
[result=no])
AC_MSG_RESULT([$result])
@@ -357,7 +357,25 @@ AC_COMPILE_IFELSE(
[[nsIDOMNSEvent *p;
p->GetIsTrusted (nsnull);]]
)],
- [AC_DEFINE([MOZ_NSIDOMNSEVENT_GETISTRUSTED],[1],[dummy]) result=yes],
+ [AC_DEFINE([MOZ_NSIDOMNSEVENT_GETISTRUSTED],[1],[Define if nsIDOMNSEvent::GetIsTrusted exists]) result=yes],
+ [result=no])
+
+AC_MSG_RESULT([$result])
+
+dnl Added in 1.8a6 on trunk
+dnl https://bugzilla.mozilla.org/show_bug.cgi?id=223310
+AC_MSG_CHECKING([whether nsIKeygenThread takes an nsIObserver])
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pipnss/nsIKeygenThread.h>
+ #include <nsIObserver.h>]],
+ [[nsIKeygenThread *p;
+ nsIObserver *obs;
+ p->StartKeyGeneration (obs);]]
+ )],
+ [AC_DEFINE([HAVE_NSIKEYGENTHREAD_NSIOBSERVER],[1],
+ [Define if nsIKeygenThread::StartKeyGeneration takes an nsIObserver]) result=yes],
[result=no])
AC_MSG_RESULT([$result])
diff --git a/embed/mozilla/GtkNSSKeyPairDialogs.cpp b/embed/mozilla/GtkNSSKeyPairDialogs.cpp
index 4670abd06..066cd44f5 100644
--- a/embed/mozilla/GtkNSSKeyPairDialogs.cpp
+++ b/embed/mozilla/GtkNSSKeyPairDialogs.cpp
@@ -45,11 +45,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>
@@ -77,6 +81,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
@@ -111,6 +139,8 @@ NS_IMETHODIMP KeyPairHelperWindow::Close()
return NS_OK;
}
+#endif /* HAVE_NSIKEYGENTHREAD_NSIOBSERVER */
+
/* ------------------------------------------------------------ */
static void
begin_busy (GtkWidget *widget)
@@ -136,7 +166,11 @@ struct KeyPairInfo
{
GtkWidget *progress;
GtkWidget *dialog;
- KeyPairHelperWindow *helper;
+#ifdef HAVE_NSIKEYGENTHREAD_NSIOBSERVER
+ KeyPairObserver *helper;
+#else
+ KeyPairHelperWindow *helper;
+#endif /* HAVE_NSIKEYGENTHREAD_NSIOBSERVER */
};
@@ -196,7 +230,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);
@@ -219,10 +257,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
@@ -709,3 +747,5 @@ NS_IMETHODIMP KeyPairHelperWindow::GetWindowRoot(nsIDOMEventTarget * *aWindowRoo
{
MOZ_NOT_IMPLEMENTED
}
+
+#endif /* !HAVE_NSIKEYGENTHREAD_NSIOBSERVER */