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

Unified Diff: components/password_manager/content/browser/credential_manager_impl.cc

Issue 2447143002: Stop prerendering of a site if it uses the Credential Manager API. (Closed)
Patch Set: rebase Created 4 years, 2 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/content/browser/credential_manager_impl.cc
diff --git a/components/password_manager/content/browser/credential_manager_impl.cc b/components/password_manager/content/browser/credential_manager_impl.cc
index aaa112d89c36149ed90e6ffcd2cbb205a4b1582e..a4fc48cb957cb83c04a51a5779886e3c9c8e0417 100644
--- a/components/password_manager/content/browser/credential_manager_impl.cc
+++ b/components/password_manager/content/browser/credential_manager_impl.cc
@@ -63,7 +63,8 @@ void CredentialManagerImpl::Store(const CredentialInfo& credential,
// Send acknowledge response back.
callback.Run();
- if (!client_->IsSavingAndFillingEnabledForCurrentPage())
+ if (!client_->IsSavingAndFillingEnabledForCurrentPage() ||
+ !client_->OnCredentialManagerUsed())
return;
client_->NotifyStorePasswordCalled();
@@ -117,7 +118,8 @@ void CredentialManagerImpl::RequireUserMediation(
.LogRequireUserMediation(web_contents()->GetLastCommittedURL());
}
PasswordStore* store = GetPasswordStore();
- if (!store || !client_->IsSavingAndFillingEnabledForCurrentPage()) {
+ if (!store || !client_->IsSavingAndFillingEnabledForCurrentPage() ||
+ !client_->OnCredentialManagerUsed()) {
callback.Run();
return;
}
@@ -179,6 +181,7 @@ void CredentialManagerImpl::Get(bool zero_click_only,
// Return an empty credential if zero-click is required but disabled, or if
// the current page has TLS errors.
if (!client_->IsFillingEnabledForCurrentPage() ||
+ !client_->OnCredentialManagerUsed() ||
(zero_click_only && !IsZeroClickAllowed())) {
// Callback with empty credential info.
callback.Run(mojom::CredentialManagerError::SUCCESS, CredentialInfo());

Powered by Google App Engine
This is Rietveld 408576698