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

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: 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 edeadedbc92852e6e4f4d74fee4b0c27feb737ec..4663ee715d0c918412016b9a9ce4a5bb228e98f3 100644
--- a/components/password_manager/core/browser/password_manager.cc
+++ b/components/password_manager/core/browser/password_manager.cc
@@ -488,6 +488,11 @@ void PasswordManager::OnPasswordFormsRendered(
// Clear all_visible_forms_ after checking all the visible forms.
all_visible_forms_.clear();
+ // 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())
vabr (Chromium) 2014/11/17 15:32:15 Would you mind moving this whole check up, to just
Sunil Ratnu 2014/11/18 06:40:05 Done.
+ return;
vabr (Chromium) 2014/11/17 15:32:15 You need to call SubmitFailed() on the saved form
Sunil Ratnu 2014/11/18 06:40:05 Done.
+
// Looks like a successful login attempt. Either show an infobar or
// automatically save the login data. We prompt when the user hasn't
// already given consent, either through previously accepting the infobar

Powered by Google App Engine
This is Rietveld 408576698