aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/EphyHeaderSniffer.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-05-11 02:07:03 +0800
committerChristian Persch <chpe@src.gnome.org>2006-05-11 02:07:03 +0800
commit24b71aa8ac7de8dd140092705bb7cc439f6b3309 (patch)
tree65631a3c5c3b28414788e1f9ef060962b95de9a1 /embed/mozilla/EphyHeaderSniffer.cpp
parentc3a7867c638dd105405fa2078b2de828a318b909 (diff)
downloadgsoc2013-epiphany-24b71aa8ac7de8dd140092705bb7cc439f6b3309.tar
gsoc2013-epiphany-24b71aa8ac7de8dd140092705bb7cc439f6b3309.tar.gz
gsoc2013-epiphany-24b71aa8ac7de8dd140092705bb7cc439f6b3309.tar.bz2
gsoc2013-epiphany-24b71aa8ac7de8dd140092705bb7cc439f6b3309.tar.lz
gsoc2013-epiphany-24b71aa8ac7de8dd140092705bb7cc439f6b3309.tar.xz
gsoc2013-epiphany-24b71aa8ac7de8dd140092705bb7cc439f6b3309.tar.zst
gsoc2013-epiphany-24b71aa8ac7de8dd140092705bb7cc439f6b3309.zip
Drop support for gecko 1.7.
2006-05-10 Christian Persch <chpe@cvs.gnome.org> * configure.ac: * data/glade/prefs-dialog.glade: * embed/ephy-favicon-cache.c: (ephy_favicon_cache_get): * embed/mozilla/AutoJSContextStack.cpp: * embed/mozilla/ContentHandler.cpp: * embed/mozilla/ContentHandler.h: * embed/mozilla/EphyAboutModule.cpp: * embed/mozilla/EphyAboutModule.h: * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * embed/mozilla/EphyContentPolicy.cpp: * embed/mozilla/EphyContentPolicy.h: * embed/mozilla/EphyDirectoryProvider.cpp: * embed/mozilla/EphyFind.cpp: * embed/mozilla/EphyFind.h: * embed/mozilla/EphyHeaderSniffer.cpp: * embed/mozilla/EphyHeaderSniffer.h: * embed/mozilla/EphyHistoryListener.cpp: * embed/mozilla/EphyHistoryListener.h: * embed/mozilla/EphyPromptService.cpp: * embed/mozilla/EphySidebar.cpp: * embed/mozilla/EphySidebar.h: * embed/mozilla/EphySingle.cpp: * embed/mozilla/EphySingle.h: * embed/mozilla/EphyUtils.cpp: * embed/mozilla/EphyUtils.h: * embed/mozilla/EventContext.cpp: * embed/mozilla/EventContext.h: * embed/mozilla/FilePicker.cpp: * embed/mozilla/FilePicker.h: * embed/mozilla/GlobalHistory.cpp: * embed/mozilla/GlobalHistory.h: * embed/mozilla/GtkNSSClientAuthDialogs.cpp: * embed/mozilla/GtkNSSDialogs.cpp: * embed/mozilla/GtkNSSKeyPairDialogs.cpp: * embed/mozilla/GtkNSSSecurityWarningDialogs.cpp: * embed/mozilla/GtkNSSSecurityWarningDialogs.h: * embed/mozilla/Makefile.am: * embed/mozilla/MozDownload.cpp: * embed/mozilla/MozDownload.h: * embed/mozilla/MozRegisterComponents.cpp: * embed/mozilla/MozRegisterComponents.h: * embed/mozilla/MozillaPrivate.cpp: * embed/mozilla/MozillaPrivate.h: * embed/mozilla/PrintingPromptService.cpp: * embed/mozilla/PrintingPromptService.h: * embed/mozilla/mozilla-download.cpp: * embed/mozilla/mozilla-download.h: * embed/mozilla/mozilla-embed-event.cpp: * embed/mozilla/mozilla-embed-event.h: * embed/mozilla/mozilla-embed-find.cpp: * embed/mozilla/mozilla-embed-find.h: * embed/mozilla/mozilla-embed-persist.cpp: * embed/mozilla/mozilla-embed-persist.h: * embed/mozilla/mozilla-embed-single.cpp: * embed/mozilla/mozilla-embed.cpp: * embed/mozilla/mozilla-embed.h: * embed/mozilla/mozilla-notifiers.cpp: * embed/mozilla/mozilla-notifiers.h: * embed/mozilla/mozilla-x509-cert.cpp: * embed/mozilla/mozilla-x509-cert.h: * lib/ephy-gui.c: * lib/ephy-gui.h: * lib/ephy-langs.c: * m4/gecko.m4: * src/ephy-window.c: (sync_tab_security): * src/prefs-dialog.c: (prefs_dialog_init): Drop support for gecko 1.7.
Diffstat (limited to 'embed/mozilla/EphyHeaderSniffer.cpp')
-rw-r--r--embed/mozilla/EphyHeaderSniffer.cpp72
1 files changed, 35 insertions, 37 deletions
diff --git a/embed/mozilla/EphyHeaderSniffer.cpp b/embed/mozilla/EphyHeaderSniffer.cpp
index de18a5ff4..b0d1ceb88 100644
--- a/embed/mozilla/EphyHeaderSniffer.cpp
+++ b/embed/mozilla/EphyHeaderSniffer.cpp
@@ -40,35 +40,43 @@
*/
#include "mozilla-config.h"
-
#include "config.h"
-#include "MozDownload.h"
-#include "EphyHeaderSniffer.h"
-
-#include "ephy-file-chooser.h"
-#include "ephy-prefs.h"
-#include "ephy-gui.h"
-#include "eel-gconf-extensions.h"
-#include "ephy-debug.h"
-
#include <glib/gi18n.h>
#include <libgnomevfs/gnome-vfs-utils.h>
+#include <nsStringAPI.h>
+
+#include <nsComponentManagerUtils.h>
#include <nsIChannel.h>
-#include <nsIHttpChannel.h>
-#include <nsIURL.h>
-#include <nsIPrefService.h>
-#include <nsIMIMEService.h>
-#include <nsIMIMEInfo.h>
+#include <nsIDOMDocument.h>
#include <nsIDOMHTMLDocument.h>
#include <nsIDownload.h>
+#include <nsIHttpChannel.h>
+#include <nsIInputStream.h>
+#include <nsILocalFile.h>
#include <nsIMIMEHeaderParam.h>
+#include <nsIMIMEInfo.h>
+#include <nsIMIMEService.h>
+#include <nsIPrefService.h>
+#include <nsIPromptService.h>
+#include <nsIURI.h>
+#include <nsIURL.h>
+#include <nsIWebBrowserPersist.h>
#include <nsIWindowWatcher.h>
+#include <nsServiceManagerUtils.h>
+#include <nsXPCOMCID.h>
+
+#include "eel-gconf-extensions.h"
+#include "ephy-debug.h"
+#include "ephy-file-chooser.h"
+#include "ephy-gui.h"
+#include "ephy-prefs.h"
-#ifdef HAVE_GECKO_1_8
#include "EphyBadCertRejector.h"
-#endif
+#include "MozDownload.h"
+
+#include "EphyHeaderSniffer.h"
EphyHeaderSniffer::EphyHeaderSniffer (nsIWebBrowserPersist* aPersist, MozillaEmbedPersist *aEmbedPersist,
nsIFile* aFile, nsIURI* aURL, nsIDOMDocument* aDocument, nsIInputStream* aPostData,
@@ -105,22 +113,16 @@ EphyHeaderSniffer::~EphyHeaderSniffer()
}
}
-#ifdef HAVE_GECKO_1_8
NS_IMPL_ISUPPORTS3 (EphyHeaderSniffer,
nsIWebProgressListener,
nsIInterfaceRequestor,
nsIAuthPrompt)
-#else
-NS_IMPL_ISUPPORTS2 (EphyHeaderSniffer,
- nsIWebProgressListener,
- nsIAuthPrompt)
-#endif
NS_IMETHODIMP
EphyHeaderSniffer::HandleContent ()
{
gboolean handled = FALSE;
- nsEmbedCString uriSpec;
+ nsCString uriSpec;
if (mPostData || !mSingle) return NS_ERROR_FAILURE;
@@ -154,7 +156,7 @@ EphyHeaderSniffer::OnStateChange (nsIWebProgress *aWebProgress, nsIRequest *aReq
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
if (httpChannel)
{
- httpChannel->GetResponseHeader(nsEmbedCString("content-disposition"),
+ httpChannel->GetResponseHeader(nsCString("content-disposition"),
mContentDisposition);
}
@@ -215,8 +217,6 @@ EphyHeaderSniffer::OnSecurityChange (nsIWebProgress *aWebProgress, nsIRequest *a
return NS_OK;
}
-#ifdef HAVE_GECKO_1_8
-
/* void getInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
NS_IMETHODIMP
EphyHeaderSniffer::GetInterface(const nsIID & uuid, void * *result)
@@ -243,8 +243,6 @@ EphyHeaderSniffer::GetInterface(const nsIID & uuid, void * *result)
return NS_ERROR_NO_INTERFACE;
}
-#endif /* HAVE_GECKO_1_8 */
-
static void
filechooser_response_cb (GtkWidget *dialog,
gint response,
@@ -265,7 +263,7 @@ filechooser_response_cb (GtkWidget *dialog,
nsCOMPtr<nsILocalFile> destFile = do_CreateInstance (NS_LOCAL_FILE_CONTRACTID);
if (destFile)
{
- destFile->InitWithNativePath (nsEmbedCString (filename));
+ destFile->InitWithNativePath (nsCString (filename));
sniffer->InitiateDownload (destFile);
}
@@ -289,7 +287,7 @@ nsresult EphyHeaderSniffer::PerformSave (nsIURI* inOriginalURI)
flags = ephy_embed_persist_get_flags (EPHY_EMBED_PERSIST (mEmbedPersist));
askDownloadDest = flags & EPHY_EMBED_PERSIST_ASK_DESTINATION;
- nsEmbedString defaultFileName;
+ nsString defaultFileName;
if (!defaultFileName.Length() && mContentDisposition.Length())
{
@@ -299,13 +297,13 @@ nsresult EphyHeaderSniffer::PerformSave (nsIURI* inOriginalURI)
if (mimehdrpar)
{
- nsEmbedCString fallbackCharset;
+ nsCString fallbackCharset;
if (mURL)
{
mURL->GetOriginCharset(fallbackCharset);
}
- nsEmbedString fileName;
+ nsString fileName;
rv = mimehdrpar->GetParameter (mContentDisposition, "filename",
fallbackCharset, PR_TRUE, nsnull,
@@ -331,7 +329,7 @@ nsresult EphyHeaderSniffer::PerformSave (nsIURI* inOriginalURI)
nsCOMPtr<nsIURL> url(do_QueryInterface(mURL));
if (url)
{
- nsEmbedCString fileNameCString;
+ nsCString fileNameCString;
url->GetFileName(fileNameCString);
NS_CStringToUTF16 (fileNameCString, NS_CSTRING_ENCODING_UTF8,
defaultFileName);
@@ -352,7 +350,7 @@ nsresult EphyHeaderSniffer::PerformSave (nsIURI* inOriginalURI)
if (!defaultFileName.Length() && mURL)
{
/* 4 Use the host. */
- nsEmbedCString hostName;
+ nsCString hostName;
mURL->GetHost(hostName);
NS_CStringToUTF16 (hostName, NS_CSTRING_ENCODING_UTF8,
defaultFileName);
@@ -361,12 +359,12 @@ nsresult EphyHeaderSniffer::PerformSave (nsIURI* inOriginalURI)
/* 5 One last case to handle about:blank and other untitled pages. */
if (!defaultFileName.Length())
{
- NS_CStringToUTF16 (nsEmbedCString(_("Untitled")),
+ NS_CStringToUTF16 (nsCString(_("Untitled")),
NS_CSTRING_ENCODING_UTF8, defaultFileName);
}
/* Validate the file name to ensure legality. */
- nsEmbedCString cDefaultFileName;
+ nsCString cDefaultFileName;
NS_UTF16ToCString (defaultFileName, NS_CSTRING_ENCODING_UTF8,
cDefaultFileName);
char *default_name = g_strdup (cDefaultFileName.get());