Chromium Code Reviews| Index: chrome/browser/ui/passwords/manage_passwords_ui_controller.cc |
| diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc |
| index 9cbd290acd9104a80c772839c5873e83ea466cb8..f8a78478a5ca04bc74af31d40893a8602a597c04 100644 |
| --- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc |
| +++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc |
| @@ -171,10 +171,19 @@ void ManagePasswordsUIController::UnblacklistSite() { |
| void ManagePasswordsUIController::DidNavigateMainFrame( |
| const content::LoadCommittedDetails& details, |
| const content::FrameNavigateParams& params) { |
| + // Don't do anything if a navigation occurs before a user could reasonably |
| + // interact with the password bubble. |
| + if (timer_ && timer_->Elapsed() < base::TimeDelta::FromSeconds(1)) |
|
vabr (Chromium)
2014/06/16 15:02:00
optional nit: You could make the 1 a named global
|
| + return; |
| + |
| + // Don't react to in-page (fragment) navigations. |
| if (details.is_in_page) |
|
vabr (Chromium)
2014/06/16 15:02:00
optional nit: As the cheapest check, this should p
|
| return; |
| + |
| + // Otherwise, reset the password manager and the timer. |
| state_ = password_manager::ui::INACTIVE_STATE; |
| UpdateBubbleAndIconVisibility(); |
| + timer_.reset(new base::ElapsedTimer()); |
| } |
| const autofill::PasswordForm& ManagePasswordsUIController:: |