diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/password_manager.cc | 9 | ||||
-rw-r--r-- | chrome/browser/password_manager.h | 7 | ||||
-rw-r--r-- | chrome/browser/web_contents.cc | 5 |
3 files changed, 14 insertions, 7 deletions
diff --git a/chrome/browser/password_manager.cc b/chrome/browser/password_manager.cc index cd99f82..f046773 100644 --- a/chrome/browser/password_manager.cc +++ b/chrome/browser/password_manager.cc @@ -88,17 +88,16 @@ void PasswordManager::ProvisionallySavePassword(PasswordForm form) { void PasswordManager::DidNavigate() { // As long as this navigation isn't due to a currently pending // password form submit, we're ready to reset and move on. - // Rest assured that if a navigation happens due to a redirect between submit - // and landing at a destination page after successful login we don't mess - // anything up, because either the credentials have already been saved or it - // is now the responsibility of the SavePasswordBar to deal with the lingering - // PasswordFormManager. if (!pending_save_manager_.get() && !pending_login_managers_.empty()) { STLDeleteElements(&pending_login_managers_); pending_login_managers_.clear(); } } +void PasswordManager::ClearProvisionalSave() { + pending_save_manager_.reset(); +} + void PasswordManager::DidStopLoading() { if (!pending_save_manager_.get()) return; diff --git a/chrome/browser/password_manager.h b/chrome/browser/password_manager.h index 7c0613b..ecdac61 100644 --- a/chrome/browser/password_manager.h +++ b/chrome/browser/password_manager.h @@ -37,8 +37,8 @@ class PasswordManager : public views::LoginModel { // Closes any visible password manager UI void CloseBars(); - // Notification that the user initiated a navigation away from the current - // page. Unless this is a password form submission, for our purposes this + // Notification that the user navigated away from the current page. + // Unless this is a password form submission, for our purposes this // means we're done with the current page, so we can clean-up. void DidNavigate(); @@ -54,6 +54,9 @@ class PasswordManager : public views::LoginModel { // of 2 (see SavePassword). void ProvisionallySavePassword(PasswordForm form); + // Clear any pending saves + void ClearProvisionalSave(); + // LoginModel implementation. virtual void SetObserver(views::LoginModelObserver* observer) { observer_ = observer; diff --git a/chrome/browser/web_contents.cc b/chrome/browser/web_contents.cc index 50ec3cd..fe35c73 100644 --- a/chrome/browser/web_contents.cc +++ b/chrome/browser/web_contents.cc @@ -371,6 +371,11 @@ bool WebContents::NavigateToPendingEntry(bool reload) { return false; } + // Clear any provisional password saves - this stops password infobars + // showing up on pages the user navigates to while the right page is + // loading. + GetPasswordManager()->ClearProvisionalSave(); + if (reload && !profile()->IsOffTheRecord()) { HistoryService* history = profile()->GetHistoryService(Profile::IMPLICIT_ACCESS); |