epiphany r8228 - in branches/gnome-2-22: . embed/mozilla



Author: chpe
Date: Sun May 18 21:50:08 2008
New Revision: 8228
URL: http://svn.gnome.org/viewvc/epiphany?rev=8228&view=rev

Log:
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.


Added:
   branches/gnome-2-22/embed/mozilla/EphyXULAppInfo.cpp
   branches/gnome-2-22/embed/mozilla/EphyXULAppInfo.h
Modified:
   branches/gnome-2-22/configure.ac
   branches/gnome-2-22/embed/mozilla/Makefile.am
   branches/gnome-2-22/embed/mozilla/MozRegisterComponents.cpp

Modified: branches/gnome-2-22/configure.ac
==============================================================================
--- branches/gnome-2-22/configure.ac	(original)
+++ branches/gnome-2-22/configure.ac	Sun May 18 21:50:08 2008
@@ -20,16 +20,23 @@
 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_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])
 

Added: branches/gnome-2-22/embed/mozilla/EphyXULAppInfo.cpp
==============================================================================
--- (empty file)
+++ branches/gnome-2-22/embed/mozilla/EphyXULAppInfo.cpp	Sun May 18 21:50:08 2008
@@ -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;
+}

Added: branches/gnome-2-22/embed/mozilla/EphyXULAppInfo.h
==============================================================================
--- (empty file)
+++ branches/gnome-2-22/embed/mozilla/EphyXULAppInfo.h	Sun May 18 21:50:08 2008
@@ -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 */

Modified: branches/gnome-2-22/embed/mozilla/Makefile.am
==============================================================================
--- branches/gnome-2-22/embed/mozilla/Makefile.am	(original)
+++ branches/gnome-2-22/embed/mozilla/Makefile.am	Sun May 18 21:50:08 2008
@@ -64,6 +64,13 @@
 	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		\

Modified: branches/gnome-2-22/embed/mozilla/MozRegisterComponents.cpp
==============================================================================
--- branches/gnome-2-22/embed/mozilla/MozRegisterComponents.cpp	(original)
+++ branches/gnome-2-22/embed/mozilla/MozRegisterComponents.cpp	Sun May 18 21:50:08 2008
@@ -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(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 @@
 /* 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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]