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

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

Issue 848723002: Credential Manager API: Showing both local and federated logins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 4ab49d917b855a9b170bd63c5077589e940cb208..ea55c0683c00e2069b4c562f10a31af73ff3ac91 100644
--- a/components/password_manager/content/common/credential_manager_types.cc
+++ b/components/password_manager/content/common/credential_manager_types.cc
@@ -33,15 +33,26 @@ CredentialInfo::CredentialInfo(const blink::WebCredential& credential)
}
}
-CredentialInfo::CredentialInfo(const autofill::PasswordForm& form)
- : id(form.username_value),
+CredentialInfo::CredentialInfo(const autofill::PasswordForm& form,
+ CredentialType form_type)
+ : type(form_type),
+ 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() ? CredentialType::CREDENTIAL_TYPE_FEDERATED
- : CredentialType::CREDENTIAL_TYPE_LOCAL;
+ switch (form_type) {
+ case CredentialType::CREDENTIAL_TYPE_EMPTY:
+ password = base::string16();
+ federation = GURL();
+ break;
+ case CredentialType::CREDENTIAL_TYPE_LOCAL:
+ federation = GURL();
+ break;
+ case CredentialType::CREDENTIAL_TYPE_FEDERATED:
+ password = base::string16();
+ break;
+ }
}
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