aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-01-06 04:48:47 +0800
committerChristian Persch <chpe@src.gnome.org>2005-01-06 04:48:47 +0800
commit1bb2458bbd832096bb10d850524c560129224b46 (patch)
tree88fc19b5bacfe02b7de2be652d7d265dc9f7c2c8
parenta5d0e720fade615d0009a42d38b195a2db57b959 (diff)
downloadgsoc2013-epiphany-1bb2458bbd832096bb10d850524c560129224b46.tar
gsoc2013-epiphany-1bb2458bbd832096bb10d850524c560129224b46.tar.gz
gsoc2013-epiphany-1bb2458bbd832096bb10d850524c560129224b46.tar.bz2
gsoc2013-epiphany-1bb2458bbd832096bb10d850524c560129224b46.tar.lz
gsoc2013-epiphany-1bb2458bbd832096bb10d850524c560129224b46.tar.xz
gsoc2013-epiphany-1bb2458bbd832096bb10d850524c560129224b46.tar.zst
gsoc2013-epiphany-1bb2458bbd832096bb10d850524c560129224b46.zip
Only implement nsITransfer if possible.
2005-01-05 Christian Persch <chpe@cvs.gnome.org> * configure.ac: * embed/mozilla/MozDownload.cpp: * embed/mozilla/MozDownload.h: Only implement nsITransfer if possible.
-rw-r--r--ChangeLog8
-rw-r--r--configure.ac10
-rw-r--r--doc/reference/tmpl/ephy-embed-persist.sgml23
-rw-r--r--doc/reference/tmpl/ephy-embed.sgml42
-rw-r--r--doc/reference/tmpl/ephy-window.sgml8
-rw-r--r--doc/reference/tmpl/epiphany-unused.sgml70
-rw-r--r--embed/mozilla/MozDownload.cpp54
-rw-r--r--embed/mozilla/MozDownload.h25
8 files changed, 143 insertions, 97 deletions
diff --git a/ChangeLog b/ChangeLog
index 89dd60ec4..25d827475 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-01-05 Christian Persch <chpe@cvs.gnome.org>
+
+ * configure.ac:
+ * embed/mozilla/MozDownload.cpp:
+ * embed/mozilla/MozDownload.h:
+
+ Only implement nsITransfer if possible.
+
2005-01-05 Crispin Flowerday <gnome@flowerday.cx>
* embed/ephy-embed-event.c: (ephy_embed_event_context_get_type):
diff --git a/configure.ac b/configure.ac
index dcaea7d15..83f79150e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,7 +15,7 @@ dnl You should have received a copy of the GNU General Public License along
dnl with this program; if not, write to the Free Software Foundation, Inc.,
dnl 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-AC_INIT([GNOME Web Browser],[1.5.3.90],[http://bugzilla.gnome.org/enter_bug.cgi?product=epiphany],[epiphany])
+AC_INIT([GNOME Web Browser],[1.5.4],[http://bugzilla.gnome.org/enter_bug.cgi?product=epiphany],[epiphany])
GNOME_COMMON_INIT
@@ -382,6 +382,7 @@ 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::StartKeyGeneration takes an nsIObserver])
AC_COMPILE_IFELSE(
@@ -413,6 +414,13 @@ AC_COMPILE_IFELSE(
AC_MSG_RESULT([$result])
+dnl exists since 1.8a6
+
+AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/nsITransfer.h],
+ [AC_DEFINE([HAVE_NSITRANSFER_H],[1],[Define if nsITransfer.h exists])],
+ [AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/uriloader/nsITransfer.h],
+ [AC_DEFINE([HAVE_NSITRANSFER_H],[1],[Define if nsITransfer.h exists])])])
+
dnl check for broken reload in GtkMozEmbed
dnl This is fixed since 1.7.4 on 1.7 branch, and since 1.8a3 on trunk
diff --git a/doc/reference/tmpl/ephy-embed-persist.sgml b/doc/reference/tmpl/ephy-embed-persist.sgml
index 36eb73882..b4a48fa41 100644
--- a/doc/reference/tmpl/ephy-embed-persist.sgml
+++ b/doc/reference/tmpl/ephy-embed-persist.sgml
@@ -60,29 +60,6 @@ save_page (EphyEmbed *embed,
</para>
-<!-- ##### ENUM EmbedPersistFlags ##### -->
-<para>
-Determines how the #EphyEmbedPersist should act.
-</para>
-
-@EMBED_PERSIST_COPY_PAGE: If set, download a copy of the page being browsed by
- the #EphyEmbedPersist's #EphyEmbed. This should be
- specified with ephy_embed_persist_set_embed(). If
- unset, ephy_embed_persist_set_source() must have been
- called.
-@EMBED_PERSIST_MAINDOC: If set and %EMBED_PERSIST_COPY_PAGE is set, download the
- #EphyEmbedPersist's #EphyEmbed's page's frameset. If
- unset, download the currently-focused frame.
-@EMBED_PERSIST_NO_VIEW: If set, do not display this download in the download
- manager.
-@EMBED_PERSIST_ASK_DESTINATION: If set, display a filechooser dialog. You must
- call ephy_embed_persist_set_fc_title() and
- ephy_embed_persist_set_fc_parent() before
- ephy_embed_persist_save() if this is the case.
- If unset, use the destination specified with
- ephy_embed_persist_set_dest().
-@EMBED_PERSIST_DO_CONVERSION:
-
<!-- ##### FUNCTION ephy_embed_persist_set_dest ##### -->
<para>
diff --git a/doc/reference/tmpl/ephy-embed.sgml b/doc/reference/tmpl/ephy-embed.sgml
index 0568038a1..7c5a35a4d 100644
--- a/doc/reference/tmpl/ephy-embed.sgml
+++ b/doc/reference/tmpl/ephy-embed.sgml
@@ -195,6 +195,8 @@ be done by casting).
@:
@:
@:
+@:
+@:
@:
<!-- ##### SIGNAL EphyEmbed::ge-security-change ##### -->
@@ -267,22 +269,6 @@ be done by casting).
@activate:
@has_modified_forms:
-<!-- ##### ENUM EmbedState ##### -->
-<para>
-Represents the state of an #EphyEmbed with regards to networking negotiations.
-</para>
-
-@EMBED_STATE_UNKNOWN:
-@EMBED_STATE_START:
-@EMBED_STATE_REDIRECTING:
-@EMBED_STATE_TRANSFERRING:
-@EMBED_STATE_NEGOTIATING:
-@EMBED_STATE_STOP:
-@EMBED_STATE_IS_REQUEST:
-@EMBED_STATE_IS_DOCUMENT:
-@EMBED_STATE_IS_NETWORK:
-@EMBED_STATE_IS_WINDOW:
-
<!-- ##### ENUM EphyEmbedChrome ##### -->
<para>
Determines which aspects of the user interface should be displayed. Most of the
@@ -298,30 +284,6 @@ windows opened with JavaScript often use a nonstandard chrome.
to display its statusbar.
@EPHY_EMBED_CHROME_BOOKMARKSBAR:
-<!-- ##### ENUM EmbedPrintPreviewNavType ##### -->
-<para>
-Specifies the action to perform in ephy_embed_print_preview_navigate().
-</para>
-
-@PRINTPREVIEW_GOTO_PAGENUM:
-@PRINTPREVIEW_PREV_PAGE:
-@PRINTPREVIEW_NEXT_PAGE:
-@PRINTPREVIEW_HOME:
-@PRINTPREVIEW_END:
-
-<!-- ##### ENUM EmbedSecurityLevel ##### -->
-<para>
-Represents the security status of an #EphyEmbed. For example, a page with an
-invalid SSL certificate will have an #EmbedSecurityLevel of %STATE_IS_BROKEN.
-</para>
-
-@STATE_IS_UNKNOWN:
-@STATE_IS_INSECURE:
-@STATE_IS_BROKEN:
-@STATE_IS_SECURE_MED:
-@STATE_IS_SECURE_LOW:
-@STATE_IS_SECURE_HIGH:
-
<!-- ##### FUNCTION ephy_embed_load_url ##### -->
<para>
diff --git a/doc/reference/tmpl/ephy-window.sgml b/doc/reference/tmpl/ephy-window.sgml
index 9f9b902f6..752176ebc 100644
--- a/doc/reference/tmpl/ephy-window.sgml
+++ b/doc/reference/tmpl/ephy-window.sgml
@@ -157,14 +157,6 @@ These are restricted to ephy_window_set_zoom() and ephy_window_load_url().
@window:
-<!-- ##### FUNCTION ephy_window_print ##### -->
-<para>
-
-</para>
-
-@window:
-
-
<!-- ##### FUNCTION ephy_window_set_print_preview ##### -->
<para>
diff --git a/doc/reference/tmpl/epiphany-unused.sgml b/doc/reference/tmpl/epiphany-unused.sgml
index 3ef56148b..017cc3b2b 100644
--- a/doc/reference/tmpl/epiphany-unused.sgml
+++ b/doc/reference/tmpl/epiphany-unused.sgml
@@ -38,6 +38,40 @@ mozilla-embed-event
</para>
+<!-- ##### ENUM EmbedPersistFlags ##### -->
+<para>
+Determines how the #EphyEmbedPersist should act.
+</para>
+
+@EMBED_PERSIST_COPY_PAGE: If set, download a copy of the page being browsed by
+ the #EphyEmbedPersist's #EphyEmbed. This should be
+ specified with ephy_embed_persist_set_embed(). If
+ unset, ephy_embed_persist_set_source() must have been
+ called.
+@EMBED_PERSIST_MAINDOC: If set and %EMBED_PERSIST_COPY_PAGE is set, download the
+ #EphyEmbedPersist's #EphyEmbed's page's frameset. If
+ unset, download the currently-focused frame.
+@EMBED_PERSIST_NO_VIEW: If set, do not display this download in the download
+ manager.
+@EMBED_PERSIST_ASK_DESTINATION: If set, display a filechooser dialog. You must
+ call ephy_embed_persist_set_fc_title() and
+ ephy_embed_persist_set_fc_parent() before
+ ephy_embed_persist_save() if this is the case.
+ If unset, use the destination specified with
+ ephy_embed_persist_set_dest().
+@EMBED_PERSIST_DO_CONVERSION:
+
+<!-- ##### ENUM EmbedPrintPreviewNavType ##### -->
+<para>
+Specifies the action to perform in ephy_embed_print_preview_navigate().
+</para>
+
+@PRINTPREVIEW_GOTO_PAGENUM:
+@PRINTPREVIEW_PREV_PAGE:
+@PRINTPREVIEW_NEXT_PAGE:
+@PRINTPREVIEW_HOME:
+@PRINTPREVIEW_END:
+
<!-- ##### ENUM EmbedReloadFlags ##### -->
<para>
@@ -46,6 +80,35 @@ mozilla-embed-event
@EMBED_RELOAD_NORMAL:
@EMBED_RELOAD_FORCE: Bypass cache and proxy while reloading a web page
+<!-- ##### ENUM EmbedSecurityLevel ##### -->
+<para>
+Represents the security status of an #EphyEmbed. For example, a page with an
+invalid SSL certificate will have an #EmbedSecurityLevel of %STATE_IS_BROKEN.
+</para>
+
+@STATE_IS_UNKNOWN:
+@STATE_IS_INSECURE:
+@STATE_IS_BROKEN:
+@STATE_IS_SECURE_MED:
+@STATE_IS_SECURE_LOW:
+@STATE_IS_SECURE_HIGH:
+
+<!-- ##### ENUM EmbedState ##### -->
+<para>
+Represents the state of an #EphyEmbed with regards to networking negotiations.
+</para>
+
+@EMBED_STATE_UNKNOWN:
+@EMBED_STATE_START:
+@EMBED_STATE_REDIRECTING:
+@EMBED_STATE_TRANSFERRING:
+@EMBED_STATE_NEGOTIATING:
+@EMBED_STATE_STOP:
+@EMBED_STATE_IS_REQUEST:
+@EMBED_STATE_IS_DOCUMENT:
+@EMBED_STATE_IS_NETWORK:
+@EMBED_STATE_IS_WINDOW:
+
<!-- ##### SIGNAL EphyEmbedPersist::cancelled ##### -->
<para>
@@ -300,6 +363,13 @@ A string identifier unique to this #EphyNodeDb
@tab:
@Returns:
+<!-- ##### FUNCTION ephy_window_print ##### -->
+<para>
+
+</para>
+
+@window:
+
<!-- ##### FUNCTION mozilla_embed_event_new ##### -->
<para>
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp
index 23c48fcd7..e65974476 100644
--- a/embed/mozilla/MozDownload.cpp
+++ b/embed/mozilla/MozDownload.cpp
@@ -79,7 +79,11 @@ MozDownload::~MozDownload()
NS_ASSERTION (!mEphyDownload, "MozillaDownload still alive!");
}
+#ifdef HAVE_NSITRANSFER_H
+NS_IMPL_ISUPPORTS1(MozDownload, nsITransfer)
+#else
NS_IMPL_ISUPPORTS3(MozDownload, nsIDownload, nsITransfer, nsIWebProgressListener)
+#endif
NS_IMETHODIMP
MozDownload::InitForEmbed (nsIURI *aSource, nsIURI *aTarget, const PRUnichar *aDisplayName,
@@ -151,6 +155,7 @@ MozDownload::GetSource(nsIURI **aSource)
return NS_OK;
}
+#ifndef HAVE_NSITRANSFER_H
NS_IMETHODIMP
MozDownload::GetTarget(nsIURI **aTarget)
{
@@ -159,6 +164,7 @@ MozDownload::GetTarget(nsIURI **aTarget)
return NS_OK;
}
+#endif
NS_IMETHODIMP
MozDownload::GetTargetFile (nsILocalFile** aTargetFile)
@@ -175,6 +181,7 @@ MozDownload::GetTargetFile (nsILocalFile** aTargetFile)
return rv;
}
+#ifndef HAVE_NSITRANSFER_H
NS_IMETHODIMP
MozDownload::GetPersist(nsIWebBrowserPersist **aPersist)
{
@@ -183,6 +190,7 @@ MozDownload::GetPersist(nsIWebBrowserPersist **aPersist)
return NS_OK;
}
+#endif
NS_IMETHODIMP
MozDownload::GetPercentComplete(PRInt32 *aPercentComplete)
@@ -193,6 +201,7 @@ MozDownload::GetPercentComplete(PRInt32 *aPercentComplete)
return NS_OK;
}
+#ifndef HAVE_NSITRANSFER_H
#ifdef MOZ_NSIDOWNLOAD_GETSIZE
/* readonly attribute PRUint64 amountTransferred; */
NS_IMETHODIMP
@@ -207,52 +216,53 @@ MozDownload::GetSize(PRUint64 *aSize)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
-#endif /* MOZ_NSIDOWNLOAD_GETSIZE */
NS_IMETHODIMP
-MozDownload::GetTotalProgress(PRInt32 *aTotalProgress)
+MozDownload::GetStartTime(PRInt64 *aStartTime)
{
- NS_ENSURE_ARG_POINTER(aTotalProgress);
- *aTotalProgress = mTotalProgress;
+ NS_ENSURE_ARG_POINTER(aStartTime);
+ *aStartTime = mStartTime;
return NS_OK;
}
+#endif /* MOZ_NSIDOWNLOAD_GETSIZE */
NS_IMETHODIMP
-MozDownload::GetCurrentProgress(PRInt32 *aCurrentProgress)
+MozDownload::GetDisplayName(PRUnichar * *aDisplayName)
{
- NS_ENSURE_ARG_POINTER(aCurrentProgress);
- *aCurrentProgress = mCurrentProgress;
-
- return NS_OK;
+ return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
-MozDownload::GetState(EphyDownloadState *aDownloadState)
+MozDownload::SetDisplayName(const PRUnichar * aDisplayName)
{
- NS_ENSURE_ARG_POINTER(aDownloadState);
- *aDownloadState = mDownloadState;
-
- return NS_OK;
+ return NS_ERROR_NOT_IMPLEMENTED;
}
+#endif /* !HAVE_NSITRANSFER_H */
NS_IMETHODIMP
-MozDownload::GetDisplayName(PRUnichar * *aDisplayName)
+MozDownload::GetTotalProgress(PRInt32 *aTotalProgress)
{
- return NS_ERROR_NOT_IMPLEMENTED;
+ NS_ENSURE_ARG_POINTER(aTotalProgress);
+ *aTotalProgress = mTotalProgress;
+
+ return NS_OK;
}
NS_IMETHODIMP
-MozDownload::SetDisplayName(const PRUnichar * aDisplayName)
+MozDownload::GetCurrentProgress(PRInt32 *aCurrentProgress)
{
- return NS_ERROR_NOT_IMPLEMENTED;
+ NS_ENSURE_ARG_POINTER(aCurrentProgress);
+ *aCurrentProgress = mCurrentProgress;
+
+ return NS_OK;
}
NS_IMETHODIMP
-MozDownload::GetStartTime(PRInt64 *aStartTime)
+MozDownload::GetState(EphyDownloadState *aDownloadState)
{
- NS_ENSURE_ARG_POINTER(aStartTime);
- *aStartTime = mStartTime;
+ NS_ENSURE_ARG_POINTER(aDownloadState);
+ *aDownloadState = mDownloadState;
return NS_OK;
}
@@ -326,7 +336,7 @@ MozDownload::OnStateChange (nsIWebProgress *aWebProgress, nsIRequest *aRequest,
if (aStateFlags & EPHY_EMBED_STATE_STOP)
{
/* Keep us alive */
- nsCOMPtr<nsIDownload> kungFuDeathGrip(this);
+ nsCOMPtr<nsITransfer> kungFuDeathGrip(this);
mDownloadState = NS_SUCCEEDED (aStatus) ? EPHY_DOWNLOAD_COMPLETED : EPHY_DOWNLOAD_FAILED;
if (mEphyDownload)
diff --git a/embed/mozilla/MozDownload.h b/embed/mozilla/MozDownload.h
index 9addcadb1..c4592ec5d 100644
--- a/embed/mozilla/MozDownload.h
+++ b/embed/mozilla/MozDownload.h
@@ -49,7 +49,6 @@
#include "ephy-download.h"
#include "ephy-embed-shell.h"
-#include <nsIDownload.h>
#include <nsIWebProgressListener.h>
#include <nsIDOMDocument.h>
#include <nsIURI.h>
@@ -59,6 +58,12 @@
#include <nsIRequest.h>
#include <nsIMIMEInfo.h>
+#ifdef HAVE_NSITRANSFER_H
+#include <nsITransfer.h>
+#else
+#include <nsIDownload.h>
+#endif
+
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
/* MozDownload
@@ -89,17 +94,31 @@ nsresult InitiateMozillaDownload (nsIDOMDocument *domDocument, nsIURI *sourceUri
PRInt32 aMaxSize);
nsresult BuildDownloadPath (const char *defaultFileName, nsILocalFile **_retval);
-class MozDownload : public nsIDownload,
+class MozDownload :
+#ifdef HAVE_NSITRANSFER_H
+ public nsITransfer
+#else
+ public nsIDownload,
public nsIWebProgressListener
+#endif
{
public:
MozDownload();
virtual ~MozDownload();
NS_DECL_ISUPPORTS
+ NS_DECL_NSIWEBPROGRESSLISTENER
NS_DECL_NSITRANSFER
+#ifndef HAVE_NSITRANSFER_H
NS_DECL_NSIDOWNLOAD
- NS_DECL_NSIWEBPROGRESSLISTENER
+#endif
+
+#ifdef HAVE_NSITRANSFER_H
+ nsresult GetMIMEInfo (nsIMIMEInfo **aMIMEInfo);
+ nsresult GetTargetFile (nsILocalFile **aFile);
+ nsresult GetSource(nsIURI * *aSource);
+ nsresult GetPercentComplete(PRInt32 *aPercentComplete);
+#endif
virtual void Cancel();
virtual void Pause();