Chromium Code Reviews| 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..44446d51d1056d890d632e1d6a19e33a8f4247c8 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_; |
|
Mike West
2014/08/05 16:47:59
Perhaps we should move this out to the platform ag
vasilii
2014/08/06 10:36:10
It sounds unclear. We can move it to ManagePasswor
dconnelly
2014/08/06 11:17:59
I can't tell that this bug reproduces on Mac -- th
|
| + |
| DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleView); |
| }; |