aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--embed/mozilla/mozilla-embed-single.cpp30
2 files changed, 35 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index cf9165569..b5307a5f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-15 Wouter Bolsterlee <wbolster@gnome.org>
+
+ * embed/mozilla/mozilla-embed-single.cpp:
+ Implement EphyPasswordManagerIface.add to add stored
+ passwords. Fixes bug #361606, patch by John Millikin.
+
2006-10-08 Christian Persch <chpe@cvs.gnome.org>
* embed/Makefile.am:
diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp
index be87caac9..de8485bdc 100644
--- a/embed/mozilla/mozilla-embed-single.cpp
+++ b/embed/mozilla/mozilla-embed-single.cpp
@@ -956,6 +956,34 @@ impl_remove_password (EphyPasswordManager *manager,
}
static void
+impl_add_password (EphyPasswordManager *manager,
+ EphyPasswordInfo *info)
+{
+ nsCOMPtr<nsIPasswordManager> pm =
+ do_GetService (NS_PASSWORDMANAGER_CONTRACTID);
+ if (!pm) return;
+
+ nsCOMPtr<nsIIDNService> idnService
+ (do_GetService ("@mozilla.org/network/idn-service;1"));
+ NS_ENSURE_TRUE (idnService, );
+
+ nsresult rv;
+ nsCString host;
+ rv = idnService->ConvertUTF8toACE (nsCString(info->host), host);
+ NS_ENSURE_SUCCESS (rv, );
+
+ nsString username;
+ NS_CStringToUTF16 (nsCString(info->username),
+ NS_CSTRING_ENCODING_UTF8, username);
+
+ nsString password;
+ NS_CStringToUTF16 (nsCString(info->password),
+ NS_CSTRING_ENCODING_UTF8, password);
+
+ pm->AddUser(host, username, password);
+}
+
+static void
impl_permission_manager_add (EphyPermissionManager *manager,
const char *host,
const char *type,
@@ -1305,7 +1333,7 @@ ephy_cookie_manager_iface_init (EphyCookieManagerIface *iface)
static void
ephy_password_manager_iface_init (EphyPasswordManagerIface *iface)
{
- iface->add = NULL; /* not implemented yet */
+ iface->add = impl_add_password;
iface->remove = impl_remove_password;
iface->list = impl_list_passwords;
}