Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Unified Diff: components/password_manager/content/common/credential_manager_types.cc

Issue 615383002: Credential Manager: Return the first valid item from the PasswordStore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/password_manager/content/common/credential_manager_types.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/content/common/credential_manager_types.cc
diff --git a/components/password_manager/content/common/credential_manager_types.cc b/components/password_manager/content/common/credential_manager_types.cc
index 6d14d18c94a3f14ea965ebdc2eee97ed6189220d..158b1e3f6e07a549c6fb591b8941da2ecf015bad 100644
--- a/components/password_manager/content/common/credential_manager_types.cc
+++ b/components/password_manager/content/common/credential_manager_types.cc
@@ -4,6 +4,9 @@
#include "components/password_manager/content/common/credential_manager_types.h"
+#include "base/logging.h"
+#include "components/autofill/core/common/password_form.h"
+
namespace password_manager {
CredentialInfo::CredentialInfo() : type(CREDENTIAL_TYPE_UNKNOWN) {
@@ -18,6 +21,16 @@ CredentialInfo::CredentialInfo(const base::string16& id,
avatar(avatar) {
}
+CredentialInfo::CredentialInfo(const autofill::PasswordForm& form)
+ : id(form.username_value),
+ name(form.display_name),
+ avatar(form.avatar_url),
+ password(form.password_value),
+ federation(form.federation_url) {
+ DCHECK(!password.empty() || !federation.is_empty());
+ type = password.empty() ? CREDENTIAL_TYPE_FEDERATED : CREDENTIAL_TYPE_LOCAL;
+}
+
CredentialInfo::~CredentialInfo() {
}
« no previous file with comments | « components/password_manager/content/common/credential_manager_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698