aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla
diff options
context:
space:
mode:
authorWouter Bolsterlee <wbolster@gnome.org>2006-10-15 06:15:58 +0800
committerWouter Bolsterlee <wbolster@src.gnome.org>2006-10-15 06:15:58 +0800
commit617e8a31a14c7acb1fbebad4475c43cc24f9476e (patch)
treef0dde24d232c94a02f62879f5451f78a20a06adb /embed/mozilla
parent0022a8d02886074729d67642f5dabc5b15430d00 (diff)
downloadgsoc2013-epiphany-617e8a31a14c7acb1fbebad4475c43cc24f9476e.tar
gsoc2013-epiphany-617e8a31a14c7acb1fbebad4475c43cc24f9476e.tar.gz
gsoc2013-epiphany-617e8a31a14c7acb1fbebad4475c43cc24f9476e.tar.bz2
gsoc2013-epiphany-617e8a31a14c7acb1fbebad4475c43cc24f9476e.tar.lz
gsoc2013-epiphany-617e8a31a14c7acb1fbebad4475c43cc24f9476e.tar.xz
gsoc2013-epiphany-617e8a31a14c7acb1fbebad4475c43cc24f9476e.tar.zst
gsoc2013-epiphany-617e8a31a14c7acb1fbebad4475c43cc24f9476e.zip
Implement EphyPasswordManagerIface.add to add stored passwords. Fixes bug
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.
Diffstat (limited to 'embed/mozilla')
-rw-r--r--embed/mozilla/mozilla-embed-single.cpp30
1 files changed, 29 insertions, 1 deletions
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;
}