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

Side by Side Diff: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h

Issue 512683003: Password bubble should close if user clicks on the web page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a test Created 6 years, 3 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 unified diff | Download patch
OLDNEW
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 "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/timer/timer.h" 9 #include "base/timer/timer.h"
10 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h" 10 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 virtual void OnWidgetActivationChanged(views::Widget* widget, 219 virtual void OnWidgetActivationChanged(views::Widget* widget,
220 bool active) OVERRIDE; 220 bool active) OVERRIDE;
221 221
222 // views::WidgetDelegate 222 // views::WidgetDelegate
223 virtual views::View* GetInitiallyFocusedView() OVERRIDE; 223 virtual views::View* GetInitiallyFocusedView() OVERRIDE;
224 224
225 // views::View methods. 225 // views::View methods.
226 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; 226 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
227 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; 227 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
228 228
229 // Called from WebContentMouseHandler when user clicks the web view.
230 void OnWebContentClicked();
231
229 void set_initially_focused_view(views::View* view) { 232 void set_initially_focused_view(views::View* view) {
230 DCHECK(!initially_focused_view_); 233 DCHECK(!initially_focused_view_);
231 initially_focused_view_ = view; 234 initially_focused_view_ = view;
232 } 235 }
233 236
234 // Singleton instance of the Password bubble. The Password bubble can only be 237 // Singleton instance of the Password bubble. The Password bubble can only be
235 // shown on the active browser window, so there is no case in which it will be 238 // shown on the active browser window, so there is no case in which it will be
236 // shown twice at the same time. The instance is owned by the Bubble and will 239 // shown twice at the same time. The instance is owned by the Bubble and will
237 // be deleted when the bubble closes. 240 // be deleted when the bubble closes.
238 static ManagePasswordsBubbleView* manage_passwords_bubble_; 241 static ManagePasswordsBubbleView* manage_passwords_bubble_;
239 242
240 ManagePasswordsIconView* anchor_view_; 243 ManagePasswordsIconView* anchor_view_;
241 244
242 // If true upon destruction, the user has confirmed that she never wants to 245 // If true upon destruction, the user has confirmed that she never wants to
243 // save passwords for a particular site. 246 // save passwords for a particular site.
244 bool never_save_passwords_; 247 bool never_save_passwords_;
245 248
246 views::View* initially_focused_view_; 249 views::View* initially_focused_view_;
247 250
248 // Timer used to close the bubble after timeout. 251 // Timer used to close the bubble after timeout.
249 base::OneShotTimer<ManagePasswordsBubbleView> timer_; 252 base::OneShotTimer<ManagePasswordsBubbleView> timer_;
250 253
254 class WebContentMouseHandler;
255 scoped_ptr<WebContentMouseHandler> mouse_handler_;
256
251 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleView); 257 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleView);
252 }; 258 };
253 259
254 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ 260 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698