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

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, 9 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..0f5141aa9de543ad027ebf82c2880d2fecb9f198 100644
--- a/components/password_manager/content/browser/credential_manager_dispatcher.cc
+++ b/components/password_manager/content/browser/credential_manager_dispatcher.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/memory/scoped_vector.h"
+#include "base/prefs/pref_service.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/common/password_form.h"
@@ -236,8 +237,10 @@ void CredentialManagerDispatcher::OnNotifySignedIn(
void CredentialManagerDispatcher::OnProvisionalSaveComplete() {
DCHECK(form_manager_);
- client_->PromptUserToSavePassword(
- form_manager_.Pass(), CredentialSourceType::CREDENTIAL_SOURCE_API);
+ if (IsSavingEnabledForCurrentPage() && !form_manager_->IsBlacklisted()) {
+ client_->PromptUserToSavePassword(
+ form_manager_.Pass(), CredentialSourceType::CREDENTIAL_SOURCE_API);
+ }
}
void CredentialManagerDispatcher::OnNotifySignedOut(int request_id) {
@@ -302,8 +305,11 @@ PasswordStore* CredentialManagerDispatcher::GetPasswordStore() {
}
bool CredentialManagerDispatcher::IsSavingEnabledForCurrentPage() const {
vabr (Chromium) 2015/03/30 10:58:42 Currently, this duplicates PasswordManager::IsSavi
melandory 2015/04/07 13:14:13 Done.
- // TODO(vasilii): add more, see http://crbug.com/450583.
- return !client_->IsOffTheRecord();
+ bool is_saving_enabled = client_->GetPrefs()->GetBoolean(
+ password_manager::prefs::kPasswordManagerSavingEnabled);
+ return is_saving_enabled && !client_->IsOffTheRecord() &&
+ !client_->DidLastPageLoadEncounterSSLErrors() &&
+ client_->IsPasswordManagerEnabledForCurrentPage();
}
bool CredentialManagerDispatcher::IsZeroClickAllowed() const {

Powered by Google App Engine
This is Rietveld 408576698