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

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

Issue 1031153002: [Credential Management] Smart lock save Credentials bubble should not always pop up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/content/browser/credential_manager_dispatcher.cc
diff --git a/components/password_manager/content/browser/credential_manager_dispatcher.cc b/components/password_manager/content/browser/credential_manager_dispatcher.cc
index 8d20793c37bd2f03ac8295590114d1b35d7b8ddc..2ab09477b4cbfa85491c661123a1932194ab93e0 100644
--- a/components/password_manager/content/browser/credential_manager_dispatcher.cc
+++ b/components/password_manager/content/browser/credential_manager_dispatcher.cc
@@ -220,7 +220,7 @@ void CredentialManagerDispatcher::OnNotifySignedIn(
new CredentialManagerMsg_AcknowledgeSignedIn(
web_contents()->GetRenderViewHost()->GetRoutingID(), request_id));
- if (!IsSavingEnabledForCurrentPage())
+ if (!client_->IsSavingEnabledForCurrentPage())
return;
scoped_ptr<autofill::PasswordForm> form(CreatePasswordFormFromCredentialInfo(
@@ -236,8 +236,11 @@ void CredentialManagerDispatcher::OnNotifySignedIn(
void CredentialManagerDispatcher::OnProvisionalSaveComplete() {
DCHECK(form_manager_);
- client_->PromptUserToSavePassword(
- form_manager_.Pass(), CredentialSourceType::CREDENTIAL_SOURCE_API);
+ if (client_->IsSavingEnabledForCurrentPage() &&
+ !form_manager_->IsBlacklisted()) {
+ client_->PromptUserToSavePassword(
+ form_manager_.Pass(), CredentialSourceType::CREDENTIAL_SOURCE_API);
+ }
}
void CredentialManagerDispatcher::OnNotifySignedOut(int request_id) {
@@ -301,11 +304,6 @@ PasswordStore* CredentialManagerDispatcher::GetPasswordStore() {
return client_ ? client_->GetPasswordStore() : nullptr;
}
-bool CredentialManagerDispatcher::IsSavingEnabledForCurrentPage() const {
- // TODO(vasilii): add more, see http://crbug.com/450583.
- return !client_->IsOffTheRecord();
-}
-
bool CredentialManagerDispatcher::IsZeroClickAllowed() const {
return *auto_signin_enabled_ && !client_->IsOffTheRecord();
}

Powered by Google App Engine
This is Rietveld 408576698