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

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

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: test 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.h
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.h b/chrome/browser/ui/passwords/manage_passwords_ui_controller.h
index 7e1b67e0a1b8f53e4a6523e3ae46f1f4db8551d1..bae6f23554c5806dee49fc90471b55c521a566c0 100644
--- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.h
+++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.h
@@ -5,7 +5,9 @@
#ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_
#define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_
+#include "base/gtest_prod_util.h"
#include "base/memory/scoped_vector.h"
+#include "base/timer/elapsed_timer.h"
#include "components/autofill/core/common/password_form.h"
#include "components/password_manager/core/browser/password_form_manager.h"
#include "components/password_manager/core/browser/password_store.h"
@@ -91,6 +93,11 @@ class ManagePasswordsUIController
explicit ManagePasswordsUIController(
content::WebContents* web_contents);
+ // content::WebContentsObserver:
+ virtual void DidNavigateMainFrame(
+ const content::LoadCommittedDetails& details,
+ const content::FrameNavigateParams& params) OVERRIDE;
+
// All previously stored credentials for a specific site. Set by
// OnPasswordSubmitted(), OnPasswordAutofilled(), or
// OnBlacklistBlockedAutofill(). Protected, not private, so we can mess with
@@ -106,6 +113,11 @@ class ManagePasswordsUIController
// the value in tests.
password_manager::ui::State state_;
+ // Used to measure the amount of time on a page; if it's less than some
+ // reasonable limit, then don't close the bubble upon navigation. We create
+ // (and destroy) the timer in DidNavigateMainFrame.
+ scoped_ptr<base::ElapsedTimer> timer_;
+
private:
friend class content::WebContentsUserData<ManagePasswordsUIController>;
@@ -119,9 +131,6 @@ class ManagePasswordsUIController
void UpdateBubbleAndIconVisibility();
// content::WebContentsObserver:
- virtual void DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) OVERRIDE;
virtual void WebContentsDestroyed() OVERRIDE;
// Set by OnPasswordSubmitted() when the user submits a form containing login

Powered by Google App Engine
This is Rietveld 408576698