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

Unified Diff: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h

Issue 441953002: Inactive password bubble should dissappear after timeout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rearrange Created 6 years, 4 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 | « no previous file | chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h
index 6acad537c30cade0c50ac003af1081b893ed028d..1b5976da39f8712d6bd31d6003bdb9b1ebbaf4b2 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_
#include "base/basictypes.h"
+#include "base/timer/timer.h"
#include "chrome/browser/ui/passwords/manage_passwords_bubble.h"
#include "chrome/browser/ui/views/passwords/save_password_refusal_combobox_model.h"
#include "ui/views/bubble/bubble_delegate.h"
@@ -171,6 +172,10 @@ class ManagePasswordsBubbleView : public ManagePasswordsBubble,
return initially_focused_view_;
}
+ bool IsTimerRunning() const {
+ return timer_.IsRunning();
+ }
+
private:
ManagePasswordsBubbleView(content::WebContents* web_contents,
ManagePasswordsIconView* anchor_view,
@@ -202,13 +207,22 @@ class ManagePasswordsBubbleView : public ManagePasswordsBubble,
// undo the action and refresh to PendingView.
void NotifyUndoNeverForThisSite();
+ // Starts a timer which will close the bubble if it's inactive.
+ void StartTimerIfNecessary();
+
// views::BubbleDelegateView:
virtual void Init() OVERRIDE;
virtual void WindowClosing() OVERRIDE;
+ virtual void OnWidgetActivationChanged(views::Widget* widget,
+ bool active) OVERRIDE;
// views::WidgetDelegate
virtual views::View* GetInitiallyFocusedView() OVERRIDE;
+ // views::View methods.
+ virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
+ virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
+
void set_initially_focused_view(views::View* view) {
DCHECK(!initially_focused_view_);
initially_focused_view_ = view;
@@ -227,6 +241,9 @@ class ManagePasswordsBubbleView : public ManagePasswordsBubble,
views::View* initially_focused_view_;
+ // Timer used to close the bubble after timeout.
+ base::OneShotTimer<ManagePasswordsBubbleView> timer_;
+
DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleView);
};
« no previous file with comments | « no previous file | chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698