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..c3ec1426a6e4011467e1daf0e581dcc47dd0a513 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,10 @@ void AddTitleRow(views::GridLayout* layout, ManagePasswordsBubbleModel* model) { |
namespace chrome { |
void ShowManagePasswordsBubble(content::WebContents* web_contents) { |
+ if (ManagePasswordsBubbleView::IsShowing()) { |
+ DCHECK(ManagePasswordsBubbleView::Bubble()->web_contents() != web_contents); |
Mike West
2014/07/22 12:08:40
Can you add a comment about this case? It's not cl
vasilii
2014/07/22 14:18:51
Done.
|
+ ManagePasswordsBubbleView::CloseBubble(); |
+ } |
ManagePasswordsUIController* controller = |
ManagePasswordsUIController::FromWebContents(web_contents); |
ManagePasswordsBubbleView::ShowBubble( |
@@ -434,11 +438,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 +492,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, |