aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-05-07 23:06:08 +0800
committerChristian Persch <chpe@src.gnome.org>2004-05-07 23:06:08 +0800
commit618cefbe30fd0fa649f3c8c88a3c0afd2e24687f (patch)
tree2fd61191be6f9a9d741cdedd36a462ddb7a79a0a
parent8eaf91dea1f8ec8ef53507cbb3f712cfb8698a1d (diff)
downloadgsoc2013-epiphany-618cefbe30fd0fa649f3c8c88a3c0afd2e24687f.tar
gsoc2013-epiphany-618cefbe30fd0fa649f3c8c88a3c0afd2e24687f.tar.gz
gsoc2013-epiphany-618cefbe30fd0fa649f3c8c88a3c0afd2e24687f.tar.bz2
gsoc2013-epiphany-618cefbe30fd0fa649f3c8c88a3c0afd2e24687f.tar.lz
gsoc2013-epiphany-618cefbe30fd0fa649f3c8c88a3c0afd2e24687f.tar.xz
gsoc2013-epiphany-618cefbe30fd0fa649f3c8c88a3c0afd2e24687f.tar.zst
gsoc2013-epiphany-618cefbe30fd0fa649f3c8c88a3c0afd2e24687f.zip
Use the single sign-on prompt service.
2004-05-07 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/EphyHeaderSniffer.cpp: * embed/mozilla/EphyHeaderSniffer.h: Use the single sign-on prompt service.
-rw-r--r--ChangeLog7
-rw-r--r--embed/mozilla/EphyHeaderSniffer.cpp39
-rw-r--r--embed/mozilla/EphyHeaderSniffer.h4
3 files changed, 16 insertions, 34 deletions
diff --git a/ChangeLog b/ChangeLog
index 357b97123..6618b69ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2004-05-07 Christian Persch <chpe@cvs.gnome.org>
+ * embed/mozilla/EphyHeaderSniffer.cpp:
+ * embed/mozilla/EphyHeaderSniffer.h:
+
+ Use the single sign-on prompt service.
+
+2004-05-07 Christian Persch <chpe@cvs.gnome.org>
+
* embed/mozilla/FilePicker.cpp:
Adjust some MOZILLA_SNAPSHOT checks.
diff --git a/embed/mozilla/EphyHeaderSniffer.cpp b/embed/mozilla/EphyHeaderSniffer.cpp
index 2d043fb14..f90a3a0cd 100644
--- a/embed/mozilla/EphyHeaderSniffer.cpp
+++ b/embed/mozilla/EphyHeaderSniffer.cpp
@@ -67,6 +67,7 @@
#include "nsIMIMEInfo.h"
#include "nsIDOMHTMLDocument.h"
#include "nsIDownload.h"
+#include "nsIWindowWatcher.h"
#if MOZILLA_SNAPSHOT > 10
#include "nsIMIMEHeaderParam.h"
#endif
@@ -84,9 +85,13 @@ EphyHeaderSniffer::EphyHeaderSniffer (nsIWebBrowserPersist* aPersist, MozillaEmb
, mDocument(aDocument)
, mPostData(aPostData)
{
- mPrompt = do_GetService("@mozilla.org/embedcomp/prompt-service;1");
-
LOG ("EphyHeaderSniffer ctor (%p)", this)
+
+ nsCOMPtr<nsIWindowWatcher> watcher
+ (do_GetService("@mozilla.org/embedcomp/window-watcher;1"));
+ if (!watcher) return;
+
+ watcher->GetNewAuthPrompter (nsnull, getter_AddRefs (mAuthPrompt));
}
EphyHeaderSniffer::~EphyHeaderSniffer()
@@ -390,33 +395,3 @@ nsresult EphyHeaderSniffer::InitiateDownload (nsILocalFile *aDestFile)
mContentType.get(), mOriginalURI, mEmbedPersist,
mPostData, nsnull, -1);
}
-
-NS_IMETHODIMP EphyHeaderSniffer::Prompt (const PRUnichar *dialogTitle, const PRUnichar *text,
- const PRUnichar *passwordRealm, PRUint32 savePassword,
- const PRUnichar *defaultText, PRUnichar **result, PRBool *_retval)
-{
- if (defaultText) *result = ToNewUnicode(nsDependentString(defaultText));
-
- return mPrompt->Prompt (nsnull, dialogTitle, text, result,
- nsnull, nsnull, _retval);
-}
-
-NS_IMETHODIMP EphyHeaderSniffer::PromptUsernameAndPassword (const PRUnichar *dialogTitle, const PRUnichar *text,
- const PRUnichar *passwordRealm, PRUint32 savePassword,
- PRUnichar **user, PRUnichar **pwd, PRBool *_retval)
-{
- *_retval = savePassword;
-
- return mPrompt->PromptUsernameAndPassword (nsnull, dialogTitle, text, user, pwd,
- nsnull, nsnull, _retval);
-}
-
-NS_IMETHODIMP EphyHeaderSniffer::PromptPassword (const PRUnichar *dialogTitle, const PRUnichar *text,
- const PRUnichar *passwordRealm, PRUint32 savePassword,
- PRUnichar **pwd, PRBool *_retval)
-{
- *_retval = savePassword;
-
- return mPrompt->PromptPassword (nsnull, dialogTitle, text, pwd,
- nsnull, nsnull, _retval);
-}
diff --git a/embed/mozilla/EphyHeaderSniffer.h b/embed/mozilla/EphyHeaderSniffer.h
index 45a3b0f91..ba64444df 100644
--- a/embed/mozilla/EphyHeaderSniffer.h
+++ b/embed/mozilla/EphyHeaderSniffer.h
@@ -59,7 +59,7 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBPROGRESSLISTENER
- NS_DECL_NSIAUTHPROMPT
+ NS_FORWARD_SAFE_NSIAUTHPROMPT(mAuthPrompt)
nsresult InitiateDownload (nsILocalFile *aDestFile);
@@ -77,6 +77,6 @@ private:
nsCOMPtr<nsIInputStream> mPostData;
nsCString mContentType;
nsCString mContentDisposition;
- nsCOMPtr<nsIPromptService> mPrompt;
+ nsCOMPtr<nsIAuthPrompt> mAuthPrompt;
};