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

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

Issue 520743002: The password bubble should fade out on click on the web page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix the nit 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 1f9b887ad38bc47b28756491359598a32d0eed43..8101af8e1411732c51f53ad86efa0b02d354bf49 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h
@@ -6,7 +6,6 @@
#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/passwords/save_password_refusal_combobox_model.h"
#include "ui/views/bubble/bubble_delegate.h"
@@ -175,8 +174,8 @@ class ManagePasswordsBubbleView : public ManagePasswordsBubble,
return initially_focused_view_;
}
- bool IsTimerRunning() const {
- return timer_.IsRunning();
+ bool IsFadingAway() const {
+ return fadeout_observer_;
}
private:
@@ -210,9 +209,6 @@ 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;
@@ -224,10 +220,15 @@ class ManagePasswordsBubbleView : public ManagePasswordsBubble,
// views::View methods.
virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
- // Called from WebContentMouseHandler when user clicks the web view.
- void OnWebContentClicked();
+ // Starts animating the bubble.
+ void StartFadingOut();
+
+ // Cancel fading out if it's active.
+ void CancelFadingOut();
+
+ // Called when the bubble completely faded out.
+ void OnBubbleDisappeared();
void set_initially_focused_view(views::View* view) {
DCHECK(!initially_focused_view_);
@@ -248,12 +249,14 @@ class ManagePasswordsBubbleView : public ManagePasswordsBubble,
views::View* initially_focused_view_;
- // Timer used to close the bubble after timeout.
- base::OneShotTimer<ManagePasswordsBubbleView> timer_;
-
+ // A helper to intercept mouse click events on the web contents.
class WebContentMouseHandler;
scoped_ptr<WebContentMouseHandler> mouse_handler_;
+ // A helper to get a notification when the bubble fades out completely.
+ class FadeOutObserver;
+ scoped_ptr<FadeOutObserver> fadeout_observer_;
+
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