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

Unified Diff: chrome/browser/ui/passwords/manage_passwords_ui_controller.cc

Issue 338103003: Password bubble: Ensure that the bubble stays open for at least 1 second. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed base. Created 6 years, 6 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
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..89c4c8a9944406f3fee6b8c8de24dea6ad6b9491 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 react to in-page (fragment) navigations.
if (details.is_in_page)
return;
+
+ // 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))
+ 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::

Powered by Google App Engine
This is Rietveld 408576698