| Index: chrome/browser/password_manager/password_form_manager.cc
|
| diff --git a/chrome/browser/password_manager/password_form_manager.cc b/chrome/browser/password_manager/password_form_manager.cc
|
| index 59c5a6a2e16fcf646892747a4edb4440b8930f07..a250382e39b9c1fb24b5fc43dea0398cd7698941 100644
|
| --- a/chrome/browser/password_manager/password_form_manager.cc
|
| +++ b/chrome/browser/password_manager/password_form_manager.cc
|
| @@ -106,6 +106,40 @@ bool PasswordFormManager::DoesManage(const PasswordForm& form,
|
| return true;
|
| }
|
|
|
| +void PasswordFormManager::SavePassword() {
|
| + PasswordStore* password_store = PasswordStoreFactory::GetForProfile(
|
| + profile_, Profile::EXPLICIT_ACCESS).get();
|
| + if (!password_store) {
|
| + NOTREACHED();
|
| + return;
|
| + }
|
| + DCHECK_EQ(state_, POST_MATCHING_PHASE);
|
| +
|
| + // Configure the form about to be saved for non-blacklisted status.
|
| + // This is done as the user can choose to blacklist the password and then
|
| + // undo the previously selected and save the password.
|
| + pending_credentials_.preferred = true;
|
| + pending_credentials_.blacklisted_by_user = false;
|
| +
|
| + // Save the pending_credentials_ entry marked as not-blacklisted.
|
| + DCHECK(!profile_->IsOffTheRecord());
|
| + if (IsNewLogin()) {
|
| + SaveAsNewLogin(true);
|
| + } else {
|
| + UpdateLogin();
|
| + }
|
| +}
|
| +
|
| +void PasswordFormManager::DeleteSavedPassword() {
|
| + PasswordStore* password_store = PasswordStoreFactory::GetForProfile(
|
| + profile_, Profile::EXPLICIT_ACCESS).get();
|
| + if (!password_store) {
|
| + NOTREACHED();
|
| + return;
|
| + }
|
| + password_store->RemoveLogin(pending_credentials_);
|
| +}
|
| +
|
| bool PasswordFormManager::IsBlacklisted() {
|
| DCHECK_EQ(state_, POST_MATCHING_PHASE);
|
| if (preferred_match_ && preferred_match_->blacklisted_by_user)
|
| @@ -119,8 +153,6 @@ void PasswordFormManager::PermanentlyBlacklist() {
|
| // Configure the form about to be saved for blacklist status.
|
| pending_credentials_.preferred = true;
|
| pending_credentials_.blacklisted_by_user = true;
|
| - pending_credentials_.username_value.clear();
|
| - pending_credentials_.password_value.clear();
|
|
|
| // Retroactively forget existing matches for this form, so we NEVER prompt or
|
| // autofill it again.
|
|
|