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

Unified Diff: components/password_manager/core/browser/password_manager.cc

Issue 733953002: Do not save passwords if the landing page has HTTP status 5xx or 4xx (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 1 month 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/core/browser/password_manager.cc
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc
index 069e2abcb9293205f70a1c8600fc9a458ce598de..4ac56380d8cc3a3c275e7764b389308ca6812345 100644
--- a/components/password_manager/core/browser/password_manager.cc
+++ b/components/password_manager/core/browser/password_manager.cc
@@ -450,6 +450,16 @@ void PasswordManager::OnPasswordFormsRendered(
DCHECK(IsSavingEnabledForCurrentPage());
+ // If the server throws an internal error, access denied page, page not
+ // found etc. after a login attempt, we do not save the credentials.
+ if (client_->WasLastNavigationHTTPError()) {
+ if (logger)
+ logger->LogMessage(Logger::STRING_DECISION_DROP);
+ provisional_save_manager_->SubmitFailed();
+ provisional_save_manager_.reset();
+ return;
+ }
+
if (logger) {
logger->LogNumber(Logger::STRING_NUMBER_OF_VISIBLE_FORMS,
visible_forms.size());

Powered by Google App Engine
This is Rietveld 408576698