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

Unified Diff: chrome/browser/password_manager/password_manager.cc

Issue 9950139: Prevent the PasswordManager from provisionally saving data from username-less forms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make sure the code is actually not reachable Created 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/password_manager.cc
diff --git a/chrome/browser/password_manager/password_manager.cc b/chrome/browser/password_manager/password_manager.cc
index 0ba11e98b6a3568be54c2acedc36dd93665ed8d2..1af190b939d091f5ec1dce2f5300427d7434d7ae 100644
--- a/chrome/browser/password_manager/password_manager.cc
+++ b/chrome/browser/password_manager/password_manager.cc
@@ -112,6 +112,10 @@ void PasswordManager::ProvisionallySavePassword(const PasswordForm& form) {
if (manager->IsBlacklisted())
return;
+ // Bail if we're missing any of the necessary form components.
+ if (!manager->HasValidPasswordForm())
+ return;
+
PasswordForm provisionally_saved_form(form);
provisionally_saved_form.ssl_valid = form.origin.SchemeIsSecure() &&
!delegate_->DidLastPageLoadEncounterSSLErrors();
@@ -184,8 +188,6 @@ void PasswordManager::OnPasswordFormsRendered(
if (provisional_save_manager_->DoesManage(*iter)) {
// The form trying to be saved has immediately re-appeared. Assume login
// failure and abort this save, by clearing provisional_save_manager_.
- // Don't delete the login managers since the user may try again
- // and we want to be able to save in that case.
provisional_save_manager_->SubmitFailed();
provisional_save_manager_.reset();
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698