aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-09-21 19:09:32 +0800
committerChristian Persch <chpe@src.gnome.org>2004-09-21 19:09:32 +0800
commit5e58a03b8d5fb6e18e8c56d0e86ac96d90522b6f (patch)
tree6fb8fd3d114376d615725f54e73f3da8d51b95ca
parent695c95a8a47d6d2c1092bd6a379743d3939961bc (diff)
downloadgsoc2013-epiphany-5e58a03b8d5fb6e18e8c56d0e86ac96d90522b6f.tar
gsoc2013-epiphany-5e58a03b8d5fb6e18e8c56d0e86ac96d90522b6f.tar.gz
gsoc2013-epiphany-5e58a03b8d5fb6e18e8c56d0e86ac96d90522b6f.tar.bz2
gsoc2013-epiphany-5e58a03b8d5fb6e18e8c56d0e86ac96d90522b6f.tar.lz
gsoc2013-epiphany-5e58a03b8d5fb6e18e8c56d0e86ac96d90522b6f.tar.xz
gsoc2013-epiphany-5e58a03b8d5fb6e18e8c56d0e86ac96d90522b6f.tar.zst
gsoc2013-epiphany-5e58a03b8d5fb6e18e8c56d0e86ac96d90522b6f.zip
Fix mozilla API checks to correctly detect firefox libraries.
2004-09-21 Christian Persch <chpe@cvs.gnome.org> * configure.ac: * embed/mozilla/ContentHandler.cpp: * embed/mozilla/ContentHandler.h: * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * embed/mozilla/EphyContentPolicy.cpp: * embed/mozilla/FilePicker.cpp: * embed/mozilla/GlobalHistory.cpp: * embed/mozilla/GtkNSSKeyPairDialogs.cpp: * embed/mozilla/Makefile.am: * embed/mozilla/MozDownload.cpp: * embed/mozilla/mozilla-download.cpp: * embed/mozilla/mozilla-embed-single.cpp: * embed/mozilla/mozilla-embed.cpp: * embed/mozilla/mozilla-notifiers.cpp: Fix mozilla API checks to correctly detect firefox libraries.
-rw-r--r--ChangeLog20
-rw-r--r--configure.ac272
-rw-r--r--embed/mozilla/ContentHandler.cpp14
-rw-r--r--embed/mozilla/ContentHandler.h3
-rw-r--r--embed/mozilla/EphyBrowser.cpp2
-rw-r--r--embed/mozilla/EphyBrowser.h4
-rw-r--r--embed/mozilla/EphyContentPolicy.cpp14
-rw-r--r--embed/mozilla/FilePicker.cpp28
-rw-r--r--embed/mozilla/GlobalHistory.cpp14
-rw-r--r--embed/mozilla/GtkNSSKeyPairDialogs.cpp12
-rw-r--r--embed/mozilla/Makefile.am4
-rw-r--r--embed/mozilla/MozDownload.cpp4
-rw-r--r--embed/mozilla/mozilla-download.cpp3
-rw-r--r--embed/mozilla/mozilla-embed-single.cpp6
-rw-r--r--embed/mozilla/mozilla-embed.cpp6
-rw-r--r--embed/mozilla/mozilla-notifiers.cpp4
16 files changed, 247 insertions, 163 deletions
diff --git a/ChangeLog b/ChangeLog
index 560577ba1..0071e6363 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2004-09-21 Christian Persch <chpe@cvs.gnome.org>
+
+ * configure.ac:
+ * embed/mozilla/ContentHandler.cpp:
+ * embed/mozilla/ContentHandler.h:
+ * embed/mozilla/EphyBrowser.cpp:
+ * embed/mozilla/EphyBrowser.h:
+ * embed/mozilla/EphyContentPolicy.cpp:
+ * embed/mozilla/FilePicker.cpp:
+ * embed/mozilla/GlobalHistory.cpp:
+ * embed/mozilla/GtkNSSKeyPairDialogs.cpp:
+ * embed/mozilla/Makefile.am:
+ * embed/mozilla/MozDownload.cpp:
+ * embed/mozilla/mozilla-download.cpp:
+ * embed/mozilla/mozilla-embed-single.cpp:
+ * embed/mozilla/mozilla-embed.cpp:
+ * embed/mozilla/mozilla-notifiers.cpp:
+
+ Fix mozilla API checks to correctly detect firefox libraries.
+
2004-09-21 Marco Pesenti Gritti <marco@gnome.org>
* embed/ephy-download.c: (update_remaining_time):
diff --git a/configure.ac b/configure.ac
index 82df6b22c..fc827714e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,16 +95,6 @@ AC_SUBST([LIBBONOBO_IDL])
BONOBO_ACTIVATION_IDL="`$PKG_CONFIG --variable=idldir bonobo-activation-2.0`"
AC_SUBST([BONOBO_ACTIVATION_IDL])
-PKG_CHECK_MODULES(MOZILLA_COMPONENT, mozilla-gtkmozembed mozilla-xpcom)
-AC_SUBST([MOZILLA_COMPONENT_CFLAGS])
-AC_SUBST([MOZILLA_COMPONENT_LIBS])
-
-MOZILLA_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir mozilla-gtkmozembed`"
-AC_SUBST([MOZILLA_INCLUDE_ROOT])
-
-MOZILLA_HOME="`$PKG_CONFIG --variable=libdir mozilla-gtkmozembed`"
-AC_SUBST([MOZILLA_HOME])
-
dnl whether to build with DEBUG defined
AC_ARG_WITH([mozilla-debug],
AC_HELP_STRING([--mozilla-debug],[Whether mozilla is a debug build]),
@@ -135,6 +125,51 @@ dnl ******************
AC_CHECK_FUNCS([mkdtemp])
+dnl ******************
+dnl Mozilla name check
+dnl ******************
+
+AC_MSG_CHECKING([which mozilla to use])
+
+MOZILLA=
+AC_ARG_WITH([mozilla],
+ AC_HELP_STRING([--with-mozilla@<:@=mozilla|firefox|thunderbird@:>@],
+ [Whether to use mozilla, firefox or thunderbird gtkmozembed (default: mozilla)]),
+ [MOZILLA="$withval"])
+
+dnl try to autodetect: if mozilla exists, use it, else try firefox, then thunderbird
+if test "x$MOZILLA" = "x"; then
+ if pkg-config --exists mozilla-gtkmozembed; then
+ MOZILLA=mozilla
+ elif pkg-config --exists firefox-gtkmozembed; then
+ MOZILLA=firefox
+ elif pkg-config --exists thunderbird-gtkmozembed; then
+ MOZILLA=thunderbird
+ else
+ AC_MSG_ERROR([no mozilla installation found])
+ fi
+elif test "x$with_mozilla" != "xmozilla" -a "x$with_mozilla" != "xfirefox" -a "x$with_mozilla" != "xthunderbird"; then
+ AC_MSG_ERROR([unknown mozilla name ($MOZILLA)])
+fi
+
+AC_MSG_RESULT([$MOZILLA])
+
+case "$MOZILLA" in
+mozilla) min_version=1.7 ;;
+firefox) min_version=0.10 ;;
+thunderbird) min_version=0.8 ;;
+esac
+
+PKG_CHECK_MODULES(MOZILLA_COMPONENT, $MOZILLA-gtkmozembed >= $min_version $MOZILLA-xpcom >= $min_version)
+AC_SUBST(MOZILLA_COMPONENT_CFLAGS)
+AC_SUBST(MOZILLA_COMPONENT_LIBS)
+
+MOZILLA_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir $MOZILLA-gtkmozembed`"
+AC_SUBST(MOZILLA_INCLUDE_ROOT)
+
+MOZILLA_HOME="`$PKG_CONFIG --variable=libdir $MOZILLA-gtkmozembed`"
+AC_SUBST(MOZILLA_HOME)
+
dnl *************************************************************************
dnl This is from Mozilla's configure.in. They set almost all the config stuff
dnl they need in mozilla-config.h Except for this compiler flag, which can't
@@ -163,96 +198,149 @@ AC_CACHE_CHECK([for compiler -fshort-wchar option],
if test "$ac_cv_have_usable_wchar_option" != "yes"; then
AM_CXXFLAGS=$_SAVE_AM_CXXFLAGS
fi
-CXXFLAGS=$_SAVE_CXXFLAGS
-AC_LANG_POP([C++])
-
-dnl *********************
-dnl Mozilla version check
-dnl *********************
-AC_MSG_CHECKING([for mozilla version])
-MOZILLA_VERSION="`$PKG_CONFIG --modversion mozilla-gtkmozembed`"
+dnl **********************************
+dnl now tests for mozilla API variance
+dnl **********************************
-AC_ARG_WITH([mozilla-snapshot],
- AC_HELP_STRING([--with-mozilla-snapshot@<:@=1.7|1.8a1|1.8a2|trunk@:>@],
- [Which mozilla version to build against, guessed: @<:@guessed@:>@]),
- [autodetect=" (guessed: $MOZILLA_VERSION)"; MOZILLA_VERSION="$withval"])
+dnl FIXME find a m4/autoconf guru who can distill this into a nice macro
-AC_MSG_RESULT([$MOZILLA_VERSION$autodetect])
+CXXFLAGS="$_SAVE_CXXFLAGS $AM_CXXFLAGS -I$MOZILLA_INCLUDE_ROOT `pkg-config --cflags $MOZILLA-xpcom`"
+
+dnl Changed from PRUnichar* to nsAString& in 1.8a1 and on aviary branch
+
+AC_MSG_CHECKING([whether nsIFilePicker methods expect nsAString&])
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <nsEmbedString.h>
+ #include <widget/nsIFilePicker.h>]],
+ [[nsIFilePicker *p;
+ p->SetDefaultString (nsEmbedString());]]
+ )],
+ [AC_DEFINE([MOZ_NSIFILEPICKER_NSASTRING_],[1],[Define if nsIFilePicker uses nsAString&]) result=yes],
+ [AC_DEFINE([MOZ_NSIFILEPICKER_PRUNICHARP],[1],[Define if nsIFilePicker uses PRUnichar*]) result=no])
-dnl Test for the "trunk" version
-if test $MOZILLA_VERSION = "trunk"; then
- MOZILLA_VERSION=9.0 # use a high number
-fi
-
-dnl Split up the version string ( 1.7rc1 -> 1 7 rc 1 )
-version=$(echo $MOZILLA_VERSION | sed -e 's/\(@<:@0-9@:>@\+\|@<:@a-z@:>@\+\)/\1 /g' -e 's/\.//g')
-
-set -- $version;
-
-case $1 in
- @<:@0-9@:>@)
- AC_DEFINE_UNQUOTED([MOZILLA_MAJOR], [$1], [Define to the Mozilla major version.])
- ;;
- *)
- AC_ERROR([Invalid mozilla major version component: $1])
- ;;
-esac
-
-case $2 in
- @<:@0-9@:>@)
- AC_DEFINE_UNQUOTED([MOZILLA_MINOR], [$2], [Define to the Mozilla minor version.])
- ;;
- *)
- AC_ERROR([Invalid mozilla minor version component: $2])
- ;;
-esac
-
-micro=$3
-type=4
-case $3 in
- @<:@0-9@:>@) # e.g. 1.4.1
- ;;
- "") # e.g. 1.7
- micro=0
- ;;
- a) type=1
- micro=$4
- ;;
-
- b) type=2
- micro=$4
- ;;
-
- rc) type=3
- micro=$4
- ;;
- *)
- AC_ERROR([Invalid mozilla version component: $3])
-esac
+AC_MSG_RESULT([$result])
+
+dnl Changed from char* to nsAString& in 1.8a1
+
+AC_MSG_CHECKING([whether nsIMIMEInfo methods expect nsAString&])
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <nsEmbedString.h>
+ #include <mimetype/nsIMIMEInfo.h>]],
+ [[nsIMIMEInfo *p;
+ p->SetDescription (nsEmbedString());]]
+ )],
+ [AC_DEFINE([MOZ_NSIMIMEINFO_NSACSTRING_],[1],[Define if nsIMIMEInfo uses nsAString&]) result=yes],
+ [result=no])
+
+AC_MSG_RESULT([$result])
+
+dnl Changed in 1.8a1 and again in 1.8a3 to its present form (variant 2);
+dnl variant 1 is on 1.7 branch. Aviary branch also has variant 2.
+
+AC_MSG_CHECKING([for nsIContentPolicy API])
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <nsEmbedString.h>
+ #include <nsIURI.h>
+ #include <content/nsIContentPolicy.h>]],
+ [[nsIContentPolicy *p;
+ nsISupports *arg4;
+ p->ShouldLoad(0,nsnull,nsnull,arg4,nsEmbedCString(),nsnull,nsnull);]]
+ )],
+ [AC_DEFINE([MOZ_NSICONTENTPOLICY_VARIANT_2],[1],[dummy]) result=2],
+ [AC_DEFINE([MOZ_NSICONTENTPOLICY_VARIANT_1],[1],[dummy]) result=1])
+
+AC_MSG_RESULT([variant $result])
+
+dnl Changed from char* to nsIURI* in 1.7.4 on 1.7 branch,
+dnl in 1.8a3 on trunk and on aviary branch
+
+AC_MSG_CHECKING([whether nsIBrowserHistory methods expect nsIURI*])
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <nsIURI.h>
+ #include <nsIGlobalHistory.h>
+ #include <docshell/nsIGlobalHistory2.h>
+ #include <history/nsIBrowserHistory.h>]],
+ [[nsIBrowserHistory* p;
+ nsIURI *arg1;
+ p->RemovePage(arg1);]]
+ )],
+ [AC_DEFINE([MOZ_NSIGLOBALHISTORY_NSIURIP],[1],[dummy]) result=yes],
+ [AC_DEFINE([MOZ_NSIGLOBALHISTORY_CHARP],[1],[dummy]) result=no])
+
+AC_MSG_RESULT([$result])
+
+dnl This is only present in new-toolkit apps
+
+AC_MSG_CHECKING([for nsIBrowserHistory::AddPageWithDetails])
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <nsIURI.h>
+ #include <nsIGlobalHistory.h>
+ #include <docshell/nsIGlobalHistory2.h>
+ #include <history/nsIBrowserHistory.h>]],
+ [[nsIBrowserHistory *p;
+ p->AddPageWithDetails(nsnull,nsnull,0);]]
+ )],
+ [AC_DEFINE([MOZ_NSIBROWSERHISTORY_ADDPAGEWITHDETAILS],[1],[dummy]) result=yes],
+ [result=no])
+
+AC_MSG_RESULT([$result])
+
+dnl Changed from char* to nsACString& in mozilla 1.8a2
+
+AC_MSG_CHECKING([whether nsIProtocolProxyService::ConfigureFromPAC expects nsACString&])
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <nsEmbedString.h>
+ #include <necko/nsIProtocolProxyService.h>]],
+ [[nsIProtocolProxyService *p;
+ p->ConfigureFromPAC (nsEmbedCString());]]
+ )],
+ [AC_DEFINE([MOZ_NSIPROTOCOLPROXYSERVICE_NSACSTRING_],[1],[dummy]) result=yes],
+ [result=no])
+
+AC_MSG_RESULT([$result])
+
+dnl Firefox doesn't have this API (?)
+
+AC_MSG_CHECKING([for nsIXULChromeRegistry API])
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <nsEmbedString.h>
+ #include <content/nsIChromeRegistry.h>]],
+ [[nsIXULChromeRegistry *p;
+ p->SelectSkin (nsEmbedCString(), PR_FALSE);]]
+ )],
+ [AC_DEFINE([MOZ_NSIXULCHROMEREGISTRY_SELECTSKIN],[1],[dummy]) result=yes],
+ [result=no])
+
+AC_MSG_RESULT([$result])
+
+dnl check for broken reload in GtkMozEmbed
+dnl FIXME: I have NO IDEA how to do this. For now, just always enable our workaround
+dnl
+dnl This is fixed since 1.7.4 on 1.7 branch, and since 1.8a3 on trunk
-if test "$micro" = "" ; then
- micro=0
-fi
+AC_MSG_CHECKING([for broken reload])
-if test "$5" != "" ; then
- AC_ERROR([Unexpected mozilla version component: $5])
-fi
+AC_DEFINE([GTKMOZEMBED_BROKEN_RELOAD],[1],[Define if GtkMozEmbed has broken reload])
-AC_DEFINE_UNQUOTED([MOZILLA_TYPE], [$type], [Define to the Mozilla release type.])
-AC_DEFINE_UNQUOTED([MOZILLA_MICRO], [$micro], [Define to the Mozilla micro version.])
+AC_MSG_RESULT([couldn't autodetect, assuming yes])
-if test "$1" -lt 1 -o \( "$1" -eq 1 -a "$2" -lt 7 \) -o \( "$1" -eq 1 -a "$2" -eq 7 -a "$type" -lt 4 \); then
- AC_ERROR([
-*****************************************************************************
-Epiphany can be built using Mozilla 1.7, 1.7.x, 1.7 branch, 1.8a2, or trunk
-snapshot, but the version available is $MOZILLA_VERSION.
-
-When using Mozilla trunk snapshot, a successful build is not guaranteed due
-to the frequently changing state of the Mozilla interfaces and the limited
-resources of the Epiphany team to support non-release Mozilla snapshots.
-*****************************************************************************])
-fi
+CXXFLAGS=$_SAVE_CXXFLAGS
+AC_LANG_POP(C++)
AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/pipnss/nsIX509Cert.h],
[AC_DEFINE(HAVE_MOZILLA_PSM, 1,
diff --git a/embed/mozilla/ContentHandler.cpp b/embed/mozilla/ContentHandler.cpp
index 96aa15e7f..422597d03 100644
--- a/embed/mozilla/ContentHandler.cpp
+++ b/embed/mozilla/ContentHandler.cpp
@@ -61,7 +61,7 @@ class GContentHandler;
NS_IMPL_ISUPPORTS1(GContentHandler, nsIHelperAppLauncherDialog)
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIMIMEINFO_NSACSTRING_
GContentHandler::GContentHandler()
{
LOG ("GContentHandler ctor (%p)", this)
@@ -77,7 +77,7 @@ GContentHandler::~GContentHandler()
{
LOG ("GContentHandler dtor (%p)", this)
-#if !MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifndef MOZ_NSIMIMEINFO_NSACSTRING_
nsMemory::Free (mMimeType);
#endif
}
@@ -101,7 +101,7 @@ NS_IMETHODIMP GContentHandler::Show(nsIHelperAppLauncher *aLauncher,
NS_ENSURE_SUCCESS (rv, rv);
single = EPHY_EMBED_SINGLE (ephy_embed_shell_get_embed_single (embed_shell));
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIMIMEINFO_NSACSTRING_
g_signal_emit_by_name (single, "handle_content", mMimeType.get(),
mUrl.get(), &handled);
#else
@@ -241,7 +241,7 @@ NS_METHOD GContentHandler::Init (void)
mLauncher->GetMIMEInfo (getter_AddRefs(MIMEInfo));
NS_ENSURE_TRUE (MIMEInfo, NS_ERROR_FAILURE);
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIMIMEINFO_NSACSTRING_
rv = MIMEInfo->GetMIMEType (mMimeType);
#else
rv = MIMEInfo->GetMIMEType (&mMimeType);
@@ -359,7 +359,7 @@ NS_METHOD GContentHandler::MIMEDoAction (void)
auto_downloads = eel_gconf_get_boolean (CONF_AUTO_DOWNLOADS);
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIMIMEINFO_NSACSTRING_
mHelperApp = gnome_vfs_mime_get_default_application (mMimeType.get());
mPermission = ephy_embed_shell_check_mime (embed_shell, mMimeType.get());
#else
@@ -402,7 +402,7 @@ NS_METHOD GContentHandler::MIMEDoAction (void)
/* HACK we use the application description to ask
MozDownload to open the file when download
is finished */
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIMIMEINFO_NSACSTRING_
mimeInfo->SetApplicationDescription (desc);
#else
mimeInfo->SetApplicationDescription (desc.get());
@@ -410,7 +410,7 @@ NS_METHOD GContentHandler::MIMEDoAction (void)
}
else
{
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIMIMEINFO_NSACSTRING_
mimeInfo->SetApplicationDescription (nsEmbedString ());
#else
mimeInfo->SetApplicationDescription (nsnull);
diff --git a/embed/mozilla/ContentHandler.h b/embed/mozilla/ContentHandler.h
index df77559d4..a4d561a6e 100644
--- a/embed/mozilla/ContentHandler.h
+++ b/embed/mozilla/ContentHandler.h
@@ -25,7 +25,6 @@
#include "config.h"
#endif
-#include "mozilla-version.h"
#include "ephy-embed-shell.h"
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
@@ -84,7 +83,7 @@ class GContentHandler : public nsIHelperAppLauncherDialog
nsEmbedCString mUrl;
nsEmbedCString mScheme;
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIMIMEINFO_NSACSTRING_
nsEmbedCString mMimeType;
#else
char *mMimeType;
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp
index 40eb42a35..77a2ed9eb 100644
--- a/embed/mozilla/EphyBrowser.cpp
+++ b/embed/mozilla/EphyBrowser.cpp
@@ -411,7 +411,7 @@ nsresult EphyBrowser::GoToHistoryIndex (PRInt16 index)
return ContentNav->GotoIndex (index);
}
-#if (!MOZILLA_IS_BRANCH (1, 7) || !MOZILLA_CHECK_VERSION3 (1, 7, 4)) && !MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 3)
+#ifdef GTKMOZEMBED_BROKEN_RELOAD
/* Workaround for broken reload with frames, see mozilla bug
* http://bugzilla.mozilla.org/show_bug.cgi?id=246392
*/
diff --git a/embed/mozilla/EphyBrowser.h b/embed/mozilla/EphyBrowser.h
index 03fc9e750..d7fc5a148 100644
--- a/embed/mozilla/EphyBrowser.h
+++ b/embed/mozilla/EphyBrowser.h
@@ -25,8 +25,6 @@
#include "config.h"
#endif
-#include "mozilla-version.h"
-
#include "ephy-encodings.h"
#include "ephy-embed.h"
@@ -112,7 +110,7 @@ public:
nsresult GetSHUrlAtIndex (PRInt32 index, nsACString &url);
nsresult GoToHistoryIndex (PRInt16 index);
-#if (!MOZILLA_IS_BRANCH (1, 7) || !MOZILLA_CHECK_VERSION3 (1, 7, 4)) && !MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 3)
+#ifdef GTKMOZEMBED_BROKEN_RELOAD
enum ReloadType { RELOAD_NORMAL = 0,
RELOAD_FORCE = 1,
RELOAD_ENCODING_CHANGE = 2 };
diff --git a/embed/mozilla/EphyContentPolicy.cpp b/embed/mozilla/EphyContentPolicy.cpp
index 8654afe38..65b26b05b 100644
--- a/embed/mozilla/EphyContentPolicy.cpp
+++ b/embed/mozilla/EphyContentPolicy.cpp
@@ -27,8 +27,6 @@
#include "EphyContentPolicy.h"
-#include "mozilla-version.h"
-
#include "eel-gconf-extensions.h"
#include "ephy-debug.h"
@@ -61,16 +59,12 @@ EphyContentPolicy::~EphyContentPolicy()
g_slist_free (mSafeProtocols);
}
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSICONTENTPOLICY_VARIANT_2
NS_IMETHODIMP
EphyContentPolicy::ShouldLoad(PRUint32 aContentType,
nsIURI *aContentLocation,
nsIURI *aRequestingLocation,
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 3)
nsISupports *aContext,
-#else
- nsIDOMNode *aRequestingNode,
-#endif
const nsACString &aMimeTypeGuess,
nsISupports *aExtra,
PRInt16 *aDecision)
@@ -109,11 +103,7 @@ NS_IMETHODIMP
EphyContentPolicy::ShouldProcess(PRUint32 aContentType,
nsIURI *aContentLocation,
nsIURI *aRequestingLocation,
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 3)
nsISupports *aContext,
-#else
- nsIDOMNode *aRequestingNode,
-#endif
const nsACString &aMimeType,
nsISupports *aExtra,
PRInt16 *aDecision)
@@ -168,4 +158,4 @@ NS_IMETHODIMP EphyContentPolicy::ShouldProcess(PRInt32 contentType,
*_retval = PR_TRUE;
return NS_OK;
}
-#endif /* MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1) */
+#endif /* MOZ_NSICONTENTPOLICY_VARIANT_2 || MOZ_NSICONTENTPOLICY_VARIANT_3 */
diff --git a/embed/mozilla/FilePicker.cpp b/embed/mozilla/FilePicker.cpp
index 2223dafbe..a0e90f781 100644
--- a/embed/mozilla/FilePicker.cpp
+++ b/embed/mozilla/FilePicker.cpp
@@ -28,8 +28,6 @@
#include "FilePicker.h"
#include "MozillaPrivate.h"
-#include "mozilla-version.h"
-
#include <nsCOMPtr.h>
#include <nsEmbedString.h>
#include <nsIServiceManager.h>
@@ -40,7 +38,7 @@
#include <nsIDOMWindow.h>
#include <nsNetCID.h>
-#if !MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifndef MOZ_NSIFILEPICKER_NSASTRING_
#include <nsIDOMWindowInternal.h>
#endif
@@ -76,7 +74,7 @@ GFilePicker::~GFilePicker()
}
/* void init (in nsIDOMWindow parent, in AString title, in short mode); */
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIFILEPICKER_NSASTRING_
NS_IMETHODIMP GFilePicker::Init(nsIDOMWindow *parent, const nsAString& title, PRInt16 mode)
#else
NS_IMETHODIMP GFilePicker::Init(nsIDOMWindowInternal *parent, const PRUnichar *title, PRInt16 mode)
@@ -85,12 +83,12 @@ NS_IMETHODIMP GFilePicker::Init(nsIDOMWindowInternal *parent, const PRUnichar *t
LOG ("GFilePicker::Init")
GtkWidget *gtkparent = MozillaFindGtkParent (parent);
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#if defined(MOZ_NSIFILEPICKER_NSASTRING_)
NS_ENSURE_TRUE (gtkparent, NS_ERROR_FAILURE);
#endif
nsEmbedCString cTitle;
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIFILEPICKER_NSASTRING_
NS_UTF16ToCString (title, NS_CSTRING_ENCODING_UTF8, cTitle);
#else
NS_UTF16ToCString (nsEmbedString(title), NS_CSTRING_ENCODING_UTF8, cTitle);
@@ -181,7 +179,7 @@ NS_IMETHODIMP GFilePicker::AppendFilters(PRInt32 filterMask)
}
/* void appendFilter (in AString title, in AString filter); */
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIFILEPICKER_NSASTRING_
NS_IMETHODIMP GFilePicker::AppendFilter(const nsAString& title, const nsAString& filter)
#else
NS_IMETHODIMP GFilePicker::AppendFilter(const PRUnichar *title, const PRUnichar *filter)
@@ -191,14 +189,14 @@ NS_IMETHODIMP GFilePicker::AppendFilter(const PRUnichar *title, const PRUnichar
LOG ("GFilePicker::AppendFilter")
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIFILEPICKER_NSASTRING_
if (!filter.Length()) return NS_ERROR_FAILURE;
#else
if (!filter) return NS_ERROR_FAILURE;
#endif
nsEmbedCString pattern;
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIFILEPICKER_NSASTRING_
NS_UTF16ToCString (filter, NS_CSTRING_ENCODING_UTF8, pattern);
#else
NS_UTF16ToCString (nsEmbedString(filter), NS_CSTRING_ENCODING_UTF8, pattern);
@@ -217,7 +215,7 @@ NS_IMETHODIMP GFilePicker::AppendFilter(const PRUnichar *title, const PRUnichar
}
nsEmbedCString cTitle;
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIFILEPICKER_NSASTRING_
NS_UTF16ToCString (title, NS_CSTRING_ENCODING_UTF8, cTitle);
#else
NS_UTF16ToCString (nsEmbedString(title), NS_CSTRING_ENCODING_UTF8, cTitle);
@@ -233,7 +231,7 @@ NS_IMETHODIMP GFilePicker::AppendFilter(const PRUnichar *title, const PRUnichar
}
/* attribute AString defaultString; */
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIFILEPICKER_NSASTRING_
NS_IMETHODIMP GFilePicker::GetDefaultString(nsAString& aDefaultString)
#else
NS_IMETHODIMP GFilePicker::GetDefaultString(PRUnichar **aDefaultString)
@@ -243,7 +241,7 @@ NS_IMETHODIMP GFilePicker::GetDefaultString(PRUnichar **aDefaultString)
LOG ("GFilePicker::GetDefaultString")
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIFILEPICKER_NSASTRING_
aDefaultString = mDefaultString;
#else
*aDefaultString = NS_StringCloneData (mDefaultString);
@@ -252,7 +250,7 @@ NS_IMETHODIMP GFilePicker::GetDefaultString(PRUnichar **aDefaultString)
return NS_OK;
}
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIFILEPICKER_NSASTRING_
NS_IMETHODIMP GFilePicker::SetDefaultString(const nsAString& aDefaultString)
#else
NS_IMETHODIMP GFilePicker::SetDefaultString(const PRUnichar *aDefaultString)
@@ -281,7 +279,7 @@ NS_IMETHODIMP GFilePicker::SetDefaultString(const PRUnichar *aDefaultString)
}
/* attribute AString defaultExtension; */
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIFILEPICKER_NSASTRING_
NS_IMETHODIMP GFilePicker::GetDefaultExtension(nsAString& aDefaultExtension)
#else
NS_IMETHODIMP GFilePicker::GetDefaultExtension(PRUnichar **aDefaultExtension)
@@ -292,7 +290,7 @@ NS_IMETHODIMP GFilePicker::GetDefaultExtension(PRUnichar **aDefaultExtension)
return NS_ERROR_NOT_IMPLEMENTED;
}
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIFILEPICKER_NSASTRING_
NS_IMETHODIMP GFilePicker::SetDefaultExtension(const nsAString& aDefaultExtension)
#else
NS_IMETHODIMP GFilePicker::SetDefaultExtension(const PRUnichar *aDefaultExtension)
diff --git a/embed/mozilla/GlobalHistory.cpp b/embed/mozilla/GlobalHistory.cpp
index 27932779d..c2ba7a1ae 100644
--- a/embed/mozilla/GlobalHistory.cpp
+++ b/embed/mozilla/GlobalHistory.cpp
@@ -25,8 +25,6 @@
#include "config.h"
#endif
-#include "mozilla-version.h"
-
#include "ephy-embed-shell.h"
#include "GlobalHistory.h"
@@ -133,7 +131,7 @@ NS_IMETHODIMP MozGlobalHistory::HidePage(nsIURI *aURI)
return NS_ERROR_NOT_IMPLEMENTED;
}
-#if (MOZILLA_IS_BRANCH (1, 7) && MOZILLA_CHECK_VERSION3 (1, 7, 4)) || MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 3)
+#ifdef MOZ_NSIGLOBALHISTORY_NSIURIP
/* void removePage (in nsIURI aURI); */
NS_IMETHODIMP MozGlobalHistory::RemovePage(nsIURI *aURI)
{
@@ -179,7 +177,7 @@ NS_IMETHODIMP MozGlobalHistory::GetCount(PRUint32 *aCount)
return NS_ERROR_NOT_IMPLEMENTED;
}
-#if (MOZILLA_IS_BRANCH (1, 7) && MOZILLA_CHECK_VERSION3 (1, 7, 4)) || MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 3)
+#ifdef MOZ_NSIGLOBALHISTORY_NSIURIP
/* void markPageAsTyped (in AUTF8String aURI) */
NS_IMETHODIMP MozGlobalHistory::MarkPageAsTyped(nsIURI *aURI)
{
@@ -192,3 +190,11 @@ NS_IMETHODIMP MozGlobalHistory::MarkPageAsTyped(const char *url)
return NS_ERROR_NOT_IMPLEMENTED;
}
#endif
+
+#ifdef MOZ_NSIBROWSERHISTORY_ADDPAGEWITHDETAILS
+/* void addPageWithDetails (in nsIURI aURI, in wstring aTitle, in long long aLastVisited); */
+NS_IMETHODIMP MozGlobalHistory::AddPageWithDetails(nsIURI *aURI, const PRUnichar *aTitle, PRInt64 aLastVisited)
+{
+ return NS_ERROR_NOT_IMPLEMENTED;
+}
+#endif
diff --git a/embed/mozilla/GtkNSSKeyPairDialogs.cpp b/embed/mozilla/GtkNSSKeyPairDialogs.cpp
index d84739cc9..55fa5968c 100644
--- a/embed/mozilla/GtkNSSKeyPairDialogs.cpp
+++ b/embed/mozilla/GtkNSSKeyPairDialogs.cpp
@@ -43,8 +43,6 @@
#ifdef HAVE_MOZILLA_PSM
-#include "mozilla-version.h"
-
#include "MozillaPrivate.h"
#include <nsIServiceManager.h>
@@ -95,9 +93,7 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMWINDOWINTERNAL
NS_DECL_NSIDOMWINDOW
-#if !MOZILLA_IS_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
NS_DECL_NSIDOMWINDOW2
-#endif
KeyPairHelperWindow();
virtual ~KeyPairHelperWindow();
@@ -105,11 +101,7 @@ public:
gboolean close_called;
};
-#if !MOZILLA_IS_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
NS_IMPL_ISUPPORTS3(KeyPairHelperWindow, nsIDOMWindowInternal, nsIDOMWindow, nsIDOMWindow2)
-#else
-NS_IMPL_ISUPPORTS2(KeyPairHelperWindow, nsIDOMWindowInternal, nsIDOMWindow)
-#endif
KeyPairHelperWindow::KeyPairHelperWindow()
{
@@ -716,13 +708,9 @@ NS_IMETHODIMP KeyPairHelperWindow::SizeToContent()
MOZ_NOT_IMPLEMENTED
}
-#if !MOZILLA_IS_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
-
NS_IMETHODIMP KeyPairHelperWindow::GetWindowRoot(nsIDOMEventTarget * *aWindowRoot)
{
MOZ_NOT_IMPLEMENTED
}
#endif
-
-#endif
diff --git a/embed/mozilla/Makefile.am b/embed/mozilla/Makefile.am
index f309b0449..1b83bfa1c 100644
--- a/embed/mozilla/Makefile.am
+++ b/embed/mozilla/Makefile.am
@@ -19,6 +19,7 @@ INCLUDES = \
-I$(MOZILLA_INCLUDE_ROOT)/mimetype \
-I$(MOZILLA_INCLUDE_ROOT)/necko \
-I$(MOZILLA_INCLUDE_ROOT)/nkcache \
+ -I$(MOZILLA_INCLUDE_ROOT)/passwordmgr \
-I$(MOZILLA_INCLUDE_ROOT)/pipboot \
-I$(MOZILLA_INCLUDE_ROOT)/pipnss \
-I$(MOZILLA_INCLUDE_ROOT)/shistory \
@@ -88,5 +89,4 @@ libephymozillaembed_la_SOURCES = \
mozilla-embed-single.cpp \
mozilla-embed-single.h \
mozilla-notifiers.cpp \
- mozilla-notifiers.h \
- mozilla-version.h
+ mozilla-notifiers.h
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp
index fdb8e3b75..c615f8be1 100644
--- a/embed/mozilla/MozDownload.cpp
+++ b/embed/mozilla/MozDownload.cpp
@@ -47,8 +47,6 @@
#include "config.h"
#endif
-#include "mozilla-version.h"
-
#include "mozilla-download.h"
#include "eel-gconf-extensions.h"
#include "ephy-prefs.h"
@@ -340,7 +338,7 @@ MozDownload::OnStateChange (nsIWebProgress *aWebProgress, nsIRequest *aRequest,
else if (NS_SUCCEEDED (aStatus))
{
GnomeVFSMimeApplication *helperApp;
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIMIMEINFO_NSACSTRING_
nsEmbedCString mimeType;
rv = mMIMEInfo->GetMIMEType (mimeType);
NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE);
diff --git a/embed/mozilla/mozilla-download.cpp b/embed/mozilla/mozilla-download.cpp
index 3b66cbaf8..9360de066 100644
--- a/embed/mozilla/mozilla-download.cpp
+++ b/embed/mozilla/mozilla-download.cpp
@@ -25,7 +25,6 @@
#endif
#include "mozilla-download.h"
-#include "mozilla-version.h"
#include "ephy-debug.h"
@@ -191,7 +190,7 @@ impl_get_mime (EphyDownload *download)
mozDownload->GetMIMEInfo (getter_AddRefs(mime));
if (!mime) return g_strdup ("application/octet-stream");
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1)
+#ifdef MOZ_NSIMIMEINFO_NSACSTRING_
mime->GetMIMEType(mimeType);
#else
char *tmp = nsnull;
diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp
index 356a83dc4..025d3347d 100644
--- a/embed/mozilla/mozilla-embed-single.cpp
+++ b/embed/mozilla/mozilla-embed-single.cpp
@@ -26,7 +26,6 @@
#endif
#include "mozilla-embed-single.h"
-#include "mozilla-version.h"
#include "ephy-cookie-manager.h"
#include "ephy-password-manager.h"
@@ -404,6 +403,8 @@ getUILang (nsAString& aUILang)
static nsresult
mozilla_init_chrome (void)
{
+/* FIXME: can we just omit this on new-toolkit ? */
+#ifdef MOZ_NSIXULCHROMEREGISTRY_SELECTSKIN
nsresult rv;
nsEmbedString uiLang;
@@ -425,6 +426,9 @@ mozilla_init_chrome (void)
NS_UTF16ToCString (uiLang, NS_CSTRING_ENCODING_UTF8, cUILang);
return chromeRegistry->SelectLocale (cUILang, PR_FALSE);
+#else
+ return NS_OK;
+#endif
}
static void
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index 95e854cf9..7d98478cf 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -503,7 +503,7 @@ static void
impl_reload (EphyEmbed *embed,
gboolean force)
{
-#if (MOZILLA_IS_BRANCH (1,7) && MOZILLA_CHECK_VERSION3 (1, 7, 4)) || MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 3)
+#ifndef GTKMOZEMBED_BROKEN_RELOAD
guint32 mflags;
mflags = GTK_MOZ_EMBED_FLAG_RELOADNORMAL;
@@ -711,14 +711,12 @@ impl_set_encoding (EphyEmbed *embed,
if (NS_FAILED (rv)) return;
}
-#if (MOZILLA_IS_BRANCH (1,7) && MOZILLA_CHECK_VERSION3 (1, 7, 4)) || MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 3)
+#ifndef GTKMOZEMBED_BROKEN_RELOAD
gtk_moz_embed_reload (GTK_MOZ_EMBED (embed),
GTK_MOZ_EMBED_FLAG_RELOADCHARSETCHANGE);
#else
/* Workaround for broken reload with frames, see mozilla bug
* http://bugzilla.mozilla.org/show_bug.cgi?id=246392
- * Replace #if 0 with appropriate MOZILLA_CHECK_VERSION4 once the bug
- * has been fixed
*/
mpriv->browser->Reload (EphyBrowser::RELOAD_ENCODING_CHANGE);
#endif
diff --git a/embed/mozilla/mozilla-notifiers.cpp b/embed/mozilla/mozilla-notifiers.cpp
index e49c1f86e..c00a18b6f 100644
--- a/embed/mozilla/mozilla-notifiers.cpp
+++ b/embed/mozilla/mozilla-notifiers.cpp
@@ -25,8 +25,6 @@
#include "config.h"
#endif
-#include "mozilla-version.h"
-
#include "ephy-embed-single.h"
#include "ephy-embed-shell.h"
#include "mozilla-notifiers.h"
@@ -370,7 +368,7 @@ mozilla_proxy_autoconfig_notifier (GConfClient *client,
char *url = eel_gconf_get_string (entry->key);
if (url && url[0] != '\0')
{
-#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 2)
+#ifdef MOZ_NSIPROTOCOLPROXYSERVICE_NSACSTRING_
pps->ConfigureFromPAC (nsEmbedCString (url));
#else
pps->ConfigureFromPAC (url);