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

Unified Diff: components/password_manager/core/browser/credential_manager_pending_require_user_mediation_task.cc

Issue 1928323002: CREDENTIAL: Tighten the behavior of 'requireUserMediation()' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « components/password_manager/core/browser/credential_manager_pending_require_user_mediation_task.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/core/browser/credential_manager_pending_require_user_mediation_task.cc
diff --git a/components/password_manager/core/browser/credential_manager_pending_require_user_mediation_task.cc b/components/password_manager/core/browser/credential_manager_pending_require_user_mediation_task.cc
index 9a2aba77e93a1a0d2064b7a3b5708393888f3b09..8cf5b31bf420aa8bbd1307894193c922e9e622fa 100644
--- a/components/password_manager/core/browser/credential_manager_pending_require_user_mediation_task.cc
+++ b/components/password_manager/core/browser/credential_manager_pending_require_user_mediation_task.cc
@@ -7,6 +7,7 @@
#include "components/autofill/core/common/password_form.h"
#include "components/password_manager/core/browser/affiliated_match_helper.h"
#include "components/password_manager/core/browser/password_store.h"
+#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "url/gurl.h"
namespace password_manager {
@@ -18,7 +19,10 @@ CredentialManagerPendingRequireUserMediationTask::
const std::vector<std::string>& affiliated_realms)
: delegate_(delegate),
affiliated_realms_(affiliated_realms.begin(), affiliated_realms.end()) {
- origins_.insert(origin.spec());
+ registrable_domains_.insert(
+ net::registry_controlled_domains::GetDomainAndRegistry(
+ origin,
+ net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES));
}
CredentialManagerPendingRequireUserMediationTask::
@@ -26,14 +30,21 @@ CredentialManagerPendingRequireUserMediationTask::
void CredentialManagerPendingRequireUserMediationTask::AddOrigin(
const GURL& origin) {
- origins_.insert(origin.spec());
+ registrable_domains_.insert(
+ net::registry_controlled_domains::GetDomainAndRegistry(
+ origin,
+ net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES));
}
void CredentialManagerPendingRequireUserMediationTask::
OnGetPasswordStoreResults(ScopedVector<autofill::PasswordForm> results) {
PasswordStore* store = delegate_->GetPasswordStore();
for (autofill::PasswordForm* form : results) {
- if (origins_.count(form->origin.spec()) ||
+ std::string form_registrable_domain =
+ net::registry_controlled_domains::GetDomainAndRegistry(
+ form->origin,
+ net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
+ if (registrable_domains_.count(form_registrable_domain) ||
(affiliated_realms_.count(form->signon_realm) &&
AffiliatedMatchHelper::IsValidAndroidCredential(*form))) {
form->skip_zero_click = true;
« no previous file with comments | « components/password_manager/core/browser/credential_manager_pending_require_user_mediation_task.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698