Index: chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.mm |
diff --git a/chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.mm b/chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.mm |
index 5877df793ee868dc2443363cd131bfa2f3ead41d..d6df328d5639db6b84eeccd5f14be1511163e7ea 100644 |
--- a/chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.mm |
+++ b/chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.mm |
@@ -52,6 +52,8 @@ |
- (void)close { |
[currentController_ bubbleWillDisappear]; |
+ // The bubble is about to be closed. It destroys the model. |
+ model_ = nil; |
[super close]; |
} |
@@ -60,13 +62,11 @@ |
currentController_.reset(); |
if (model_->state() == password_manager::ui::PENDING_PASSWORD_STATE) { |
currentController_.reset([[SavePendingPasswordViewController alloc] |
- initWithModel:model_ |
- delegate:self]); |
+ initWithDelegate:self]); |
} else if (model_->state() == |
password_manager::ui::PENDING_PASSWORD_UPDATE_STATE) { |
currentController_.reset([[UpdatePendingPasswordViewController alloc] |
- initWithModel:model_ |
- delegate:self]); |
+ initWithDelegate:self]); |
} else if (model_->state() == password_manager::ui::CONFIRMATION_STATE) { |
currentController_.reset( |
[[ManagePasswordsBubbleConfirmationViewController alloc] |
@@ -148,6 +148,10 @@ |
[self close]; |
} |
+- (ManagePasswordsBubbleModel*)model { |
+ return model_; |
+} |
+ |
@end |
@implementation ManagePasswordsBubbleController (Testing) |