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

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

Issue 2598003002: Suppress save and update bubbles when storing a PSL matched credential (Closed)
Patch Set: Cleanup includes and update doc Created 4 years 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 80b11b9697d868fdf4278d31534d9dab5a78d737..6ba6e300385e6958ca4f73216ca44cbb720cd86e 100644
--- a/components/password_manager/content/browser/credential_manager_impl.cc
+++ b/components/password_manager/content/browser/credential_manager_impl.cc
@@ -86,6 +86,16 @@ void CredentialManagerImpl::OnProvisionalSaveComplete() {
DCHECK(client_->IsSavingAndFillingEnabledForCurrentPage());
const autofill::PasswordForm& form = form_manager_->pending_credentials();
+ if (form.is_public_suffix_match) {
vasilii 2016/12/22 13:24:59 Use IsPendingCredentialsPublicSuffixMatch() for co
jdoerrie 2016/12/22 16:20:01 Done.
+ // Having a credential with a PSL match implies there is no credential with
+ // an exactly matching origin. This is because the presence of the exact
vasilii 2016/12/22 13:24:58 exactly matching origin and username.
jdoerrie 2016/12/22 16:20:01 Done.
+ // match would stop the PSL matches from appearing in the account chooser.
vasilii 2016/12/22 13:24:59 The explanation is wrong. A site doesn't have to u
jdoerrie 2016/12/22 16:20:01 Acknowledged.
+ // In order to avoid showing a save bubble to the user when he already chose
+ // this credential via the account chooser Save() is called directly.
+ form_manager_->Save();
+ return;
+ }
+
if (!form.federation_origin.unique()) {
// If this is a federated credential, check it against the federated matches
// produced by the PasswordFormManager. If a match is found, update it and

Powered by Google App Engine
This is Rietveld 408576698