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

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: 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
« no previous file with comments | « chrome/browser/ui/passwords/manage_passwords_ui_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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::
« no previous file with comments | « chrome/browser/ui/passwords/manage_passwords_ui_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698