diff options
author | Christian Persch <chpe@src.gnome.org> | 2008-05-19 05:50:08 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2008-05-19 05:50:08 +0800 |
commit | 1d5298f2586e48798d193a75315f71005a4d1c55 (patch) | |
tree | 27c11705b26617130ed8ac98e772d6f0063fab5d | |
parent | b881c34315251cc603d9eb91a1a3d9ebb749c76e (diff) | |
download | gsoc2013-epiphany-1d5298f2586e48798d193a75315f71005a4d1c55.tar gsoc2013-epiphany-1d5298f2586e48798d193a75315f71005a4d1c55.tar.gz gsoc2013-epiphany-1d5298f2586e48798d193a75315f71005a4d1c55.tar.bz2 gsoc2013-epiphany-1d5298f2586e48798d193a75315f71005a4d1c55.tar.lz gsoc2013-epiphany-1d5298f2586e48798d193a75315f71005a4d1c55.tar.xz gsoc2013-epiphany-1d5298f2586e48798d193a75315f71005a4d1c55.tar.zst gsoc2013-epiphany-1d5298f2586e48798d193a75315f71005a4d1c55.zip |
Implement nsIXULAppInfo so we get the "Gecko/DATE" part in the UA right. Use the 2.22.2 release date as the fixed date/build ID.
svn path=/branches/gnome-2-22/; revision=8228
-rw-r--r-- | configure.ac | 15 | ||||
-rw-r--r-- | embed/mozilla/EphyXULAppInfo.cpp | 130 | ||||
-rw-r--r-- | embed/mozilla/EphyXULAppInfo.h | 48 | ||||
-rw-r--r-- | embed/mozilla/Makefile.am | 7 | ||||
-rw-r--r-- | embed/mozilla/MozRegisterComponents.cpp | 17 |
5 files changed, 211 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 3b911c63a..fe2548971 100644 --- a/configure.ac +++ b/configure.ac @@ -20,16 +20,23 @@ m4_define([epiphany_version_minor],[22]) m4_define([epiphany_version_micro],[1]) m4_define([epiphany_version_extra],[.2]) m4_define([epiphany_version],[epiphany_version_major.epiphany_version_minor.epiphany_version_micro()epiphany_version_extra]) +m4_define([epiphany_build_id],[20080528]) # The date of the 2.22.2 release # This can be either "trunk" or "branches/gnome-x-y" m4_define([epiphany_branch],["branches/gnome-2-22"]) AC_INIT([GNOME Web Browser],[epiphany_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=epiphany],[epiphany]) -GNOME_COMMON_INIT - AC_PREREQ([2.59]) +AC_CANONICAL_HOST +AC_DEFINE_UNQUOTED([EPHY_HOST],["$host"],[The host]) +AC_DEFINE_UNQUOTED([EPHY_HOST_CPU],["$host_cpu"],[The host CPU type]) +AC_DEFINE_UNQUOTED([EPHY_HOST_VENDOR],["$host_vendor"],[The host vendor]) +AC_DEFINE_UNQUOTED([EPHY_HOST_OS],["$host_os"],[The host OS]) + +GNOME_COMMON_INIT + AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_SRCDIR([configure.ac]) @@ -48,9 +55,7 @@ AC_SUBST([EPIPHANY_MAJOR_VERSION], [epiphany_version_major]) AC_SUBST([EPIPHANY_MINOR_VERSION], [epiphany_version_minor]) AC_SUBST([EPIPHANY_MICRO_VERSION], [epiphany_version_micro]) -# Build ID -BUILDID="$(TZ=UTC0 date +'%Y%m%d')" -AC_SUBST([BUILDID]) +AC_DEFINE([EPHY_BUILD_ID],["epiphany_build_id"],[The build date]) AM_INIT_AUTOMAKE([1.9 foreign dist-bzip2 no-dist-gzip tar-ustar]) diff --git a/embed/mozilla/EphyXULAppInfo.cpp b/embed/mozilla/EphyXULAppInfo.cpp new file mode 100644 index 000000000..1319431ec --- /dev/null +++ b/embed/mozilla/EphyXULAppInfo.cpp @@ -0,0 +1,130 @@ +/* + * Copyright © 2008 Christian Persch + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "mozilla-config.h" +#include "config.h" + +#include <nsStringGlue.h> + +#include "EphyXULAppInfo.h" + +NS_IMPL_ISUPPORTS2 (EphyXULAppInfo, nsIXULRuntime, nsIXULAppInfo) + +EphyXULAppInfo::EphyXULAppInfo () + : mLogConsoleErrors (PR_TRUE) +{ +} + +EphyXULAppInfo::~EphyXULAppInfo () +{ +} + +/* readonly attribute ACString vendor; */ +NS_IMETHODIMP +EphyXULAppInfo::GetVendor(nsACString & aVendor) +{ + aVendor.Assign ("GNOME"); + return NS_OK; +} + +/* readonly attribute ACString name; */ +NS_IMETHODIMP +EphyXULAppInfo::GetName(nsACString & aName) +{ + aName.Assign ("GNOME Web Browser"); + return NS_OK; +} + +/* readonly attribute ACString ID; */ +NS_IMETHODIMP +EphyXULAppInfo::GetID(nsACString & aID) +{ + aID.Assign ("{8cbd4d83-3182-4d7e-9889-a8d77bf1f205}"); + return NS_OK; +} + +/* readonly attribute ACString version; */ +NS_IMETHODIMP +EphyXULAppInfo::GetVersion(nsACString & aVersion) +{ + aVersion.Assign (VERSION); + return NS_OK; +} + +/* readonly attribute ACString appBuildID; */ +NS_IMETHODIMP +EphyXULAppInfo::GetAppBuildID(nsACString & aAppBuildID) +{ + aAppBuildID.Assign (EPHY_BUILD_ID); + return NS_OK; +} + +/* readonly attribute ACString platformVersion; */ +NS_IMETHODIMP +EphyXULAppInfo::GetPlatformVersion(nsACString & aPlatformVersion) +{ + aPlatformVersion.Assign ("1.9"); + return NS_OK; +} + +/* readonly attribute ACString platformBuildID; */ +NS_IMETHODIMP +EphyXULAppInfo::GetPlatformBuildID(nsACString & aPlatformBuildID) +{ + aPlatformBuildID.Assign (EPHY_BUILD_ID); + return NS_OK; +} + +/* readonly attribute boolean inSafeMode; */ +NS_IMETHODIMP +EphyXULAppInfo::GetInSafeMode(PRBool *aInSafeMode) +{ + *aInSafeMode = PR_FALSE; + return NS_OK; +} + +/* attribute boolean logConsoleErrors; */ +NS_IMETHODIMP +EphyXULAppInfo::GetLogConsoleErrors(PRBool *aLogConsoleErrors) +{ + *aLogConsoleErrors = mLogConsoleErrors; + return NS_OK; +} + +NS_IMETHODIMP +EphyXULAppInfo::SetLogConsoleErrors(PRBool aLogConsoleErrors) +{ + mLogConsoleErrors = aLogConsoleErrors; + return NS_OK; +} + +/* readonly attribute AUTF8String OS; */ +NS_IMETHODIMP +EphyXULAppInfo::GetOS(nsACString & aOS) +{ + aOS.Assign (EPHY_HOST_OS); + return NS_OK; +} + +/* readonly attribute AUTF8String XPCOMABI; */ +NS_IMETHODIMP +EphyXULAppInfo::GetXPCOMABI(nsACString & aXPCOMABI) +{ + aXPCOMABI.Assign (EPHY_HOST_CPU "-gcc3"); + return NS_OK; +} diff --git a/embed/mozilla/EphyXULAppInfo.h b/embed/mozilla/EphyXULAppInfo.h new file mode 100644 index 000000000..5f5cf9d59 --- /dev/null +++ b/embed/mozilla/EphyXULAppInfo.h @@ -0,0 +1,48 @@ +/* + * Copyright © 2008 Christian Persch + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef EPHY_XUL_APP_INFO_H +#define EPHY_XUL_APP_INFO_H + +#include <nsIXULAppInfo.h> +#include <nsIXULRuntime.h> + +#include <nsAutoPtr.h> +#include <nsCOMPtr.h> + +#define EPHY_XUL_APP_INFO_CLASSNAME "Epiphany XUL App Info" + +/* 3032bcd2-663c-4583-88bf-6f251123f6dd */ +#define EPHY_XUL_APP_INFO_CID { 0x3032bcd2, 0x663c, 0x4583, { 0x88, 0xbf, 0x6f, 0x25, 0x11, 0x23, 0xf6, 0xdd } } + +class EphyXULAppInfo : public nsIXULAppInfo, + public nsIXULRuntime +{ + public: + EphyXULAppInfo (); + virtual ~EphyXULAppInfo(); + + NS_DECL_ISUPPORTS + NS_DECL_NSIXULAPPINFO + NS_DECL_NSIXULRUNTIME + + private: + PRBool mLogConsoleErrors; +}; + +#endif /* EPHY_XUL_APP_INFO_H */ diff --git a/embed/mozilla/Makefile.am b/embed/mozilla/Makefile.am index 2788e1350..0491bac8a 100644 --- a/embed/mozilla/Makefile.am +++ b/embed/mozilla/Makefile.am @@ -64,6 +64,13 @@ libephymozillaembed_la_SOURCES = \ mozilla-notifiers.cpp \ mozilla-notifiers.h +if HAVE_GECKO_1_9 +libephymozillaembed_la_SOURCES += \ + EphyXULAppInfo.cpp \ + EphyXULAppInfo.h \ + $(NULL) +endif + if !HAVE_GECKO_1_9 libephymozillaembed_la_SOURCES += \ EphyBadCertRejector.cpp \ diff --git a/embed/mozilla/MozRegisterComponents.cpp b/embed/mozilla/MozRegisterComponents.cpp index 73e946170..06196242b 100644 --- a/embed/mozilla/MozRegisterComponents.cpp +++ b/embed/mozilla/MozRegisterComponents.cpp @@ -44,6 +44,7 @@ #ifdef HAVE_GECKO_1_9 #include <nsIClassInfoImpl.h> +#include <nsXULAppAPI.h> #endif #ifdef HAVE_MOZILLA_PSM @@ -77,6 +78,10 @@ #include "GeckoFormSigningDialog.h" #endif +#ifdef HAVE_GECKO_1_9 +#include "EphyXULAppInfo.h" +#endif + NS_GENERIC_FACTORY_CONSTRUCTOR(EphyAboutModule) NS_GENERIC_FACTORY_CONSTRUCTOR(EphyContentPolicy) NS_GENERIC_FACTORY_CONSTRUCTOR(EphyPromptService) @@ -104,7 +109,9 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(GtkNSSSecurityWarningDialogs) NS_GENERIC_FACTORY_CONSTRUCTOR(GeckoFormSigningDialog) #endif -#define XPINSTALL_CONTRACTID NS_CONTENT_HANDLER_CONTRACTID_PREFIX "application/x-xpinstall" +#ifdef HAVE_GECKO_1_9 +NS_GENERIC_FACTORY_CONSTRUCTOR(EphyXULAppInfo) +#endif /* class information */ NS_DECL_CLASSINFO(EphySidebar) @@ -112,6 +119,14 @@ NS_DECL_CLASSINFO(EphySidebar) /* FIXME: uninstall XPI handler */ static const nsModuleComponentInfo sAppComps[] = { +#ifdef HAVE_GECKO_1_9 + { + EPHY_XUL_APP_INFO_CLASSNAME, + EPHY_XUL_APP_INFO_CID, + XULAPPINFO_SERVICE_CONTRACTID, + EphyXULAppInfoConstructor + }, +#endif { MOZ_DOWNLOAD_CLASSNAME, MOZ_DOWNLOAD_CID, |