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

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

Issue 394403003: Close the password bubble on the icon click. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a test Created 6 years, 5 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
Index: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
index 356919e43c008c9ec0c899d2b20ca244aa3204db..56f94fae06b5a037a450eec92fe8defa4f143ede 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
@@ -126,6 +126,12 @@ void AddTitleRow(views::GridLayout* layout, ManagePasswordsBubbleModel* model) {
namespace chrome {
void ShowManagePasswordsBubble(content::WebContents* web_contents) {
+ if (ManagePasswordsBubbleView::IsShowing()) {
+ // IDC_MANAGE_PASSWORDS_FOR_PAGE command cann't open the bubble twice for
+ // the same tab. However, the bubble may be open in another tab.
+ DCHECK(ManagePasswordsBubbleView::Bubble()->web_contents() != web_contents);
Peter Kasting 2014/07/22 18:55:18 If this DCHECK is the only reason to expose web_co
vasilii 2014/07/23 09:22:53 Done.
+ ManagePasswordsBubbleView::CloseBubble();
+ }
ManagePasswordsUIController* controller =
ManagePasswordsUIController::FromWebContents(web_contents);
ManagePasswordsBubbleView::ShowBubble(
@@ -434,11 +440,6 @@ ManagePasswordsBubbleView* ManagePasswordsBubbleView::manage_passwords_bubble_ =
NULL;
// static
-const ManagePasswordsBubbleView* ManagePasswordsBubbleView::Bubble() {
- return ManagePasswordsBubbleView::manage_passwords_bubble_;
-}
-
-// static
void ManagePasswordsBubbleView::ShowBubble(content::WebContents* web_contents,
DisplayReason reason) {
Browser* browser = chrome::FindBrowserWithWebContents(web_contents);
@@ -493,6 +494,15 @@ bool ManagePasswordsBubbleView::IsShowing() {
manage_passwords_bubble_->GetWidget()->IsVisible();
}
+// static
+const ManagePasswordsBubbleView* ManagePasswordsBubbleView::Bubble() {
+ return ManagePasswordsBubbleView::manage_passwords_bubble_;
+}
+
+content::WebContents* ManagePasswordsBubbleView::web_contents() const {
+ return model()->web_contents();
+}
+
ManagePasswordsBubbleView::ManagePasswordsBubbleView(
content::WebContents* web_contents,
ManagePasswordsIconView* anchor_view,

Powered by Google App Engine
This is Rietveld 408576698