Index: chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc |
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc |
index 22945750bc093f9828e75bfd1a2c58da595cf846..a0a54b1ea08c6ede46e2cea8cb6dc440af636258 100644 |
--- a/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc |
+++ b/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc |
@@ -23,8 +23,6 @@ ManagePasswordsIconView::~ManagePasswordsIconView() {} |
void ManagePasswordsIconView::UpdateVisibleUI() { |
if (state() == password_manager::ui::INACTIVE_STATE) { |
SetVisible(false); |
- if (ManagePasswordsBubbleView::IsShowing()) |
- ManagePasswordsBubbleView::CloseBubble(); |
return; |
} |
@@ -38,6 +36,12 @@ void ManagePasswordsIconView::UpdateVisibleUI() { |
parent()->Layout(); |
} |
+void ManagePasswordsIconView::OnChangingState() { |
+ // If there is an opened bubble for the current icon it should go away. |
+ if (active()) |
+ ManagePasswordsBubbleView::CloseBubble(); |
+} |
+ |
bool ManagePasswordsIconView::IsBubbleShowing() const { |
// If the bubble is being destroyed, it's considered showing though it may be |
// already invisible currently. |