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

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

Issue 1960653002: Fix blacklisting password forms with Credential Manager API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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
Index: components/password_manager/core/common/credential_manager_types.cc
diff --git a/components/password_manager/core/common/credential_manager_types.cc b/components/password_manager/core/common/credential_manager_types.cc
index 8f364867eb8d92b156ada0d45a856442b444a145..33c6bc79b7b34565547d5023bcd67c38038c7531 100644
--- a/components/password_manager/core/common/credential_manager_types.cc
+++ b/components/password_manager/core/common/credential_manager_types.cc
@@ -43,6 +43,12 @@ CredentialInfo::CredentialInfo(const CredentialInfo& other) = default;
CredentialInfo::~CredentialInfo() {
}
+bool CredentialInfo::operator==(const CredentialInfo& rhs) const {
+ return (type == rhs.type && id == rhs.id && name == rhs.name &&
+ icon == rhs.icon && password == rhs.password &&
+ federation.Serialize() == rhs.federation.Serialize());
+}
+
std::unique_ptr<autofill::PasswordForm> CreatePasswordFormFromCredentialInfo(
const CredentialInfo& info,
const GURL& origin) {
@@ -67,10 +73,15 @@ std::unique_ptr<autofill::PasswordForm> CreatePasswordFormFromCredentialInfo(
form->username_value = info.id;
return form;
}
-bool CredentialInfo::operator==(const CredentialInfo& rhs) const {
- return (type == rhs.type && id == rhs.id && name == rhs.name &&
- icon == rhs.icon && password == rhs.password &&
- federation.Serialize() == rhs.federation.Serialize());
+
+std::unique_ptr<autofill::PasswordForm> CreateObservedPasswordFormFromOrigin(
+ const GURL& origin) {
+ std::unique_ptr<autofill::PasswordForm> form(new autofill::PasswordForm);
+ form->origin = origin;
+ form->scheme = autofill::PasswordForm::SCHEME_HTML;
+ form->type = autofill::PasswordForm::TYPE_API;
+ form->signon_realm = origin.spec();
+ return form;
}
} // namespace password_manager

Powered by Google App Engine
This is Rietveld 408576698