Chromium Code Reviews| Index: chrome/browser/ui/cocoa/autofill/save_card_bubble_view_bridge.mm |
| diff --git a/chrome/browser/ui/cocoa/autofill/save_card_bubble_view_bridge.mm b/chrome/browser/ui/cocoa/autofill/save_card_bubble_view_bridge.mm |
| index 051bd0b8f981242e4a29cbe1da54eda89cc0c9bd..ab08a77ccb93a7a30daa3efdfe14c8a51ae50998 100644 |
| --- a/chrome/browser/ui/cocoa/autofill/save_card_bubble_view_bridge.mm |
| +++ b/chrome/browser/ui/cocoa/autofill/save_card_bubble_view_bridge.mm |
| @@ -99,11 +99,13 @@ void SaveCardBubbleViewBridge::OnBubbleClosed() { |
| } |
| void SaveCardBubbleViewBridge::Hide() { |
|
groby-ooo-7-16
2016/08/10 19:49:35
That means Hide() can be called several times? How
Justin Donnelly
2016/08/11 15:41:15
Well, to be honest, I can't say that I 100% unders
|
| - // SaveCardBubbleViewBridge::OnBubbleClosed won't be able to call |
| - // OnBubbleClosed on the bubble controller since we null the reference to it |
| - // below. So we need to call it here. |
| - controller_->OnBubbleClosed(); |
| - controller_ = nullptr; |
| + if (controller_) { |
| + // SaveCardBubbleViewBridge::OnBubbleClosed won't be able to call |
| + // OnBubbleClosed on the bubble controller since we null the reference to it |
| + // below. So we need to call it here. |
| + controller_->OnBubbleClosed(); |
| + controller_ = nullptr; |
| + } |
| [view_controller_ close]; |
| } |