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

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

Issue 1946563003: Fix blacklisting password forms with Credential Manager API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ios Created 4 years, 8 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 6d431e1a114edaadd115bdc6df4864895a231b00..484b2be7858403a418b1e2caa1ab90fb3958589f 100644
--- a/components/password_manager/core/common/credential_manager_types.cc
+++ b/components/password_manager/core/common/credential_manager_types.cc
@@ -51,6 +51,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) {
@@ -75,10 +81,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