OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ |
7 | 7 |
8 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h" | 8 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h" |
9 #include "ui/views/bubble/bubble_delegate.h" | 9 #include "ui/views/bubble/bubble_delegate.h" |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 static const ManagePasswordsBubbleView* manage_password_bubble() { | 42 static const ManagePasswordsBubbleView* manage_password_bubble() { |
43 return manage_passwords_bubble_; | 43 return manage_passwords_bubble_; |
44 } | 44 } |
45 | 45 |
46 content::WebContents* web_contents() const; | 46 content::WebContents* web_contents() const; |
47 | 47 |
48 const View* initially_focused_view() const { | 48 const View* initially_focused_view() const { |
49 return initially_focused_view_; | 49 return initially_focused_view_; |
50 } | 50 } |
51 | 51 |
52 bool IsFadingAway() const { | |
53 return fadeout_observer_; | |
54 } | |
55 | |
56 private: | 52 private: |
57 class BlacklistedView; | 53 class BlacklistedView; |
58 class ConfirmNeverView; | 54 class ConfirmNeverView; |
59 class ManageView; | 55 class ManageView; |
60 class PendingView; | 56 class PendingView; |
61 class SaveConfirmationView; | 57 class SaveConfirmationView; |
62 | 58 |
63 ManagePasswordsBubbleView(content::WebContents* web_contents, | 59 ManagePasswordsBubbleView(content::WebContents* web_contents, |
64 ManagePasswordsIconView* anchor_view, | 60 ManagePasswordsIconView* anchor_view, |
65 DisplayReason reason); | 61 DisplayReason reason); |
(...skipping 20 matching lines...) Expand all Loading... |
86 // save passwords, and remove existing passwords, for a site. | 82 // save passwords, and remove existing passwords, for a site. |
87 void NotifyConfirmedNeverForThisSite(); | 83 void NotifyConfirmedNeverForThisSite(); |
88 | 84 |
89 // Called from ConfirmNeverView if the user clicks on "Undo" in order to | 85 // Called from ConfirmNeverView if the user clicks on "Undo" in order to |
90 // undo the action and refresh to PendingView. | 86 // undo the action and refresh to PendingView. |
91 void NotifyUndoNeverForThisSite(); | 87 void NotifyUndoNeverForThisSite(); |
92 | 88 |
93 // views::BubbleDelegateView: | 89 // views::BubbleDelegateView: |
94 virtual void Init() OVERRIDE; | 90 virtual void Init() OVERRIDE; |
95 virtual void WindowClosing() OVERRIDE; | 91 virtual void WindowClosing() OVERRIDE; |
96 virtual void OnWidgetActivationChanged(views::Widget* widget, | |
97 bool active) OVERRIDE; | |
98 | 92 |
99 // views::WidgetDelegate | 93 // views::WidgetDelegate |
100 virtual views::View* GetInitiallyFocusedView() OVERRIDE; | 94 virtual views::View* GetInitiallyFocusedView() OVERRIDE; |
101 | 95 |
102 // views::View methods. | |
103 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | |
104 | |
105 // Starts animating the bubble. | |
106 void StartFadingOut(); | |
107 | |
108 // Cancel fading out if it's active. | |
109 void CancelFadingOut(); | |
110 | |
111 // Called when the bubble completely faded out. | |
112 void OnBubbleDisappeared(); | |
113 | |
114 void set_initially_focused_view(views::View* view) { | 96 void set_initially_focused_view(views::View* view) { |
115 DCHECK(!initially_focused_view_); | 97 DCHECK(!initially_focused_view_); |
116 initially_focused_view_ = view; | 98 initially_focused_view_ = view; |
117 } | 99 } |
118 | 100 |
119 // Singleton instance of the Password bubble. The Password bubble can only be | 101 // Singleton instance of the Password bubble. The Password bubble can only be |
120 // shown on the active browser window, so there is no case in which it will be | 102 // shown on the active browser window, so there is no case in which it will be |
121 // shown twice at the same time. The instance is owned by the Bubble and will | 103 // shown twice at the same time. The instance is owned by the Bubble and will |
122 // be deleted when the bubble closes. | 104 // be deleted when the bubble closes. |
123 static ManagePasswordsBubbleView* manage_passwords_bubble_; | 105 static ManagePasswordsBubbleView* manage_passwords_bubble_; |
124 | 106 |
125 ManagePasswordsIconView* anchor_view_; | 107 ManagePasswordsIconView* anchor_view_; |
126 | 108 |
127 // If true upon destruction, the user has confirmed that she never wants to | 109 // If true upon destruction, the user has confirmed that she never wants to |
128 // save passwords for a particular site. | 110 // save passwords for a particular site. |
129 bool never_save_passwords_; | 111 bool never_save_passwords_; |
130 | 112 |
131 views::View* initially_focused_view_; | 113 views::View* initially_focused_view_; |
132 | 114 |
133 // A helper to intercept mouse click events on the web contents. | 115 // A helper to intercept mouse click events on the web contents. |
134 class WebContentMouseHandler; | 116 class WebContentMouseHandler; |
135 scoped_ptr<WebContentMouseHandler> mouse_handler_; | 117 scoped_ptr<WebContentMouseHandler> mouse_handler_; |
136 | 118 |
137 // A helper to get a notification when the bubble fades out completely. | |
138 class FadeOutObserver; | |
139 scoped_ptr<FadeOutObserver> fadeout_observer_; | |
140 | |
141 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleView); | 119 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleView); |
142 }; | 120 }; |
143 | 121 |
144 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ | 122 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ |
OLD | NEW |